diff --git a/subsys/bluetooth/mesh/gatt.h b/subsys/bluetooth/mesh/gatt.h new file mode 100644 index 00000000000..ee5edf9cadc --- /dev/null +++ b/subsys/bluetooth/mesh/gatt.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#define ADV_SLOW_INT \ + .interval_min = BT_GAP_ADV_SLOW_INT_MIN, \ + .interval_max = BT_GAP_ADV_SLOW_INT_MAX + +#define ADV_FAST_INT \ + .interval_min = BT_GAP_ADV_FAST_INT_MIN_2, \ + .interval_max = BT_GAP_ADV_FAST_INT_MAX_2 + +#define BT_DEVICE_NAME (IS_ENABLED(CONFIG_BT_DEVICE_NAME_DYNAMIC) ? \ + (const uint8_t *)bt_get_name() : \ + (const uint8_t *)CONFIG_BT_DEVICE_NAME) +#define BT_DEVICE_NAME_LEN (IS_ENABLED(CONFIG_BT_DEVICE_NAME_DYNAMIC) ? strlen(bt_get_name()) : \ + (sizeof(CONFIG_BT_DEVICE_NAME) - 1)) diff --git a/subsys/bluetooth/mesh/pb_gatt_srv.c b/subsys/bluetooth/mesh/pb_gatt_srv.c index 288e71e38a4..67ba1c63408 100644 --- a/subsys/bluetooth/mesh/pb_gatt_srv.c +++ b/subsys/bluetooth/mesh/pb_gatt_srv.c @@ -26,6 +26,7 @@ #include "foundation.h" #include "access.h" #include "proxy.h" +#include "gatt.h" #include "proxy_msg.h" #include "pb_gatt_srv.h" diff --git a/subsys/bluetooth/mesh/proxy.h b/subsys/bluetooth/mesh/proxy.h index c56e9dab0d1..102ff1834a7 100644 --- a/subsys/bluetooth/mesh/proxy.h +++ b/subsys/bluetooth/mesh/proxy.h @@ -10,20 +10,6 @@ #define ADV_OPT_USE_IDENTITY 0 #endif -#define ADV_SLOW_INT \ - .interval_min = BT_GAP_ADV_SLOW_INT_MIN, \ - .interval_max = BT_GAP_ADV_SLOW_INT_MAX - -#define ADV_FAST_INT \ - .interval_min = BT_GAP_ADV_FAST_INT_MIN_2, \ - .interval_max = BT_GAP_ADV_FAST_INT_MAX_2 - -#define BT_DEVICE_NAME (IS_ENABLED(CONFIG_BT_DEVICE_NAME_DYNAMIC) ? \ - (const uint8_t *)bt_get_name() : \ - (const uint8_t *)CONFIG_BT_DEVICE_NAME) -#define BT_DEVICE_NAME_LEN (IS_ENABLED(CONFIG_BT_DEVICE_NAME_DYNAMIC) ? strlen(bt_get_name()) : \ - (sizeof(CONFIG_BT_DEVICE_NAME) - 1)) - #define BT_MESH_ID_TYPE_NET 0x00 #define BT_MESH_ID_TYPE_NODE 0x01 #define BT_MESH_ID_TYPE_PRIV_NET 0x02 diff --git a/subsys/bluetooth/mesh/proxy_srv.c b/subsys/bluetooth/mesh/proxy_srv.c index ac06c0a9595..aab4afe47df 100644 --- a/subsys/bluetooth/mesh/proxy_srv.c +++ b/subsys/bluetooth/mesh/proxy_srv.c @@ -28,6 +28,7 @@ #include "foundation.h" #include "access.h" #include "proxy.h" +#include "gatt.h" #include "proxy_msg.h" #include "crypto.h"