Skip to content

Commit eab2aea

Browse files
PavelVPVjukkar
authored andcommitted
[nrf fromtree] bluetooth: mesh: gatt: Move generic GATT related defines to gatt.h
This moves GATT releated defines that are used by both Mesh Proxy Service and Mesh Provisioning Service implementations to a common header file. Signed-off-by: Pavel Vasilyev <[email protected]> (cherry picked from commit 684c94e) Signed-off-by: Håvard Reierstad <[email protected]> (cherry picked from commit 3ff85af)
1 parent 453a680 commit eab2aea

File tree

4 files changed

+21
-14
lines changed

4 files changed

+21
-14
lines changed

subsys/bluetooth/mesh/gatt.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#define ADV_SLOW_INT \
8+
.interval_min = BT_GAP_ADV_SLOW_INT_MIN, \
9+
.interval_max = BT_GAP_ADV_SLOW_INT_MAX
10+
11+
#define ADV_FAST_INT \
12+
.interval_min = BT_GAP_ADV_FAST_INT_MIN_2, \
13+
.interval_max = BT_GAP_ADV_FAST_INT_MAX_2
14+
15+
#define BT_DEVICE_NAME (IS_ENABLED(CONFIG_BT_DEVICE_NAME_DYNAMIC) ? \
16+
(const uint8_t *)bt_get_name() : \
17+
(const uint8_t *)CONFIG_BT_DEVICE_NAME)
18+
#define BT_DEVICE_NAME_LEN (IS_ENABLED(CONFIG_BT_DEVICE_NAME_DYNAMIC) ? strlen(bt_get_name()) : \
19+
(sizeof(CONFIG_BT_DEVICE_NAME) - 1))

subsys/bluetooth/mesh/pb_gatt_srv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "foundation.h"
2727
#include "access.h"
2828
#include "proxy.h"
29+
#include "gatt.h"
2930
#include "proxy_msg.h"
3031
#include "pb_gatt_srv.h"
3132

subsys/bluetooth/mesh/proxy.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,6 @@
1010
#define ADV_OPT_USE_IDENTITY 0
1111
#endif
1212

13-
#define ADV_SLOW_INT \
14-
.interval_min = BT_GAP_ADV_SLOW_INT_MIN, \
15-
.interval_max = BT_GAP_ADV_SLOW_INT_MAX
16-
17-
#define ADV_FAST_INT \
18-
.interval_min = BT_GAP_ADV_FAST_INT_MIN_2, \
19-
.interval_max = BT_GAP_ADV_FAST_INT_MAX_2
20-
21-
#define BT_DEVICE_NAME (IS_ENABLED(CONFIG_BT_DEVICE_NAME_DYNAMIC) ? \
22-
(const uint8_t *)bt_get_name() : \
23-
(const uint8_t *)CONFIG_BT_DEVICE_NAME)
24-
#define BT_DEVICE_NAME_LEN (IS_ENABLED(CONFIG_BT_DEVICE_NAME_DYNAMIC) ? strlen(bt_get_name()) : \
25-
(sizeof(CONFIG_BT_DEVICE_NAME) - 1))
26-
2713
#define BT_MESH_ID_TYPE_NET 0x00
2814
#define BT_MESH_ID_TYPE_NODE 0x01
2915
#define BT_MESH_ID_TYPE_PRIV_NET 0x02

subsys/bluetooth/mesh/proxy_srv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "foundation.h"
2929
#include "access.h"
3030
#include "proxy.h"
31+
#include "gatt.h"
3132
#include "proxy_msg.h"
3233
#include "crypto.h"
3334

0 commit comments

Comments
 (0)