Skip to content

Commit 740e7d9

Browse files
akredalenanangl
authored andcommitted
samples: bluetooth: mesh: Add HVAC Integration NLC Profile support
- Added NLC HVAC Integration support to the mesh Sensor Client sample. - Redesigned the NLC Kconfig with BASELINE/STRICT tiers, individual profile options, and backward compatibility. - Updated existing mesh NLC samples to use the new individual profile configurations. - Updated documentation and release notes. Signed-off-by: Stine Åkredalen <[email protected]>
1 parent 600f876 commit 740e7d9

File tree

10 files changed

+142
-56
lines changed

10 files changed

+142
-56
lines changed

doc/nrf/protocols/bt/bt_mesh/overview/nlc.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@ Bluetooth® Networked Lighting Control (NLC) profiles are a set of device profil
77
The NLC profiles can be used to implement interoperable network controlled lighting setups, including sensors, light fixtures, energy monitoring, scene selectors and dimmer controls.
88
Each of the profiles specifies a set of models and a set of performance parameters.
99

10-
Enable the :kconfig:option:`CONFIG_BT_MESH_NLC_PERF_CONF` Kconfig option to set the required performance configurations for the NLC profiles.
11-
When implementing the NLC Basic Lightness Controller profile individually or in conjunction with other NLC profiles, also enable the :kconfig:option:`CONFIG_BT_MESH_NLC_PERF_LIGHTNESS_CTRL` Kconfig option.
10+
Multiple NLC profiles can be combined on a single device.
11+
When combining profiles, the device will use the highest minimum requirements, as defined in the NLC Profile specifications.
12+
13+
For specific profile implementations, enable the following Kconfig options:
14+
15+
* :kconfig:option:`CONFIG_BT_MESH_NLC_PERF_AMBIENT_LIGHT_SENSOR` - for the Ambient Light Sensor NLC profile
16+
* :kconfig:option:`CONFIG_BT_MESH_NLC_PERF_DIMMING_CONTROL` - for the Dimming Control NLC profile
17+
* :kconfig:option:`CONFIG_BT_MESH_NLC_PERF_ENERGY_MONITOR` - for the Energy Monitor NLC profile
18+
* :kconfig:option:`CONFIG_BT_MESH_NLC_PERF_HVAC_INTEGRATION` - for the HVAC Integration NLC profile
19+
* :kconfig:option:`CONFIG_BT_MESH_NLC_PERF_LIGHTNESS_CTRL` - for the Basic Lightness Controller NLC profile
20+
* :kconfig:option:`CONFIG_BT_MESH_NLC_PERF_OCCUPANCY_SENSOR` - for the Occupancy Sensor NLC profile
21+
* :kconfig:option:`CONFIG_BT_MESH_NLC_PERF_SCENE_SELECTOR` - for the Basic Scene Selector NLC profile
1222

1323
The |NCS| provides a demonstration of how to implement each of these profiles as part of the Bluetooth samples.
1424
An overview of the NLC profiles and the samples supporting them is provided in a table below.
@@ -29,5 +39,7 @@ An overview of the NLC profiles and the samples supporting them is provided in a
2939
+-----------------------------------------+--------------------------------------+
3040
| Energy Monitor NLC Profile | :ref:`bluetooth_mesh_light_lc` |
3141
+-----------------------------------------+--------------------------------------+
42+
| HVAC Integration NLC Profile | :ref:`bluetooth_mesh_sensor_client` |
43+
+-----------------------------------------+--------------------------------------+
3244
| Occupancy Sensor NLC Profile | :ref:`bluetooth_mesh_sensor_server` |
3345
+-----------------------------------------+--------------------------------------+

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ Bluetooth® LE
138138
Bluetooth Mesh
139139
--------------
140140

141-
|no_changes_yet_note|
141+
* Updated the NLC profile configuration system:
142+
143+
* Introduced individual profile configuration options for better user control.
144+
* Deprecated the ``CONFIG_BT_MESH_NLC_PERF_CONF`` and ``CONFIG_BT_MESH_NLC_PERF_DEFAULT`` Kconfig options.
145+
Existing configurations continue to work but you should migrate to individual profile options.
142146

143147
DECT NR+
144148
--------
@@ -278,6 +282,18 @@ Bluetooth Mesh samples
278282

279283
* Added support for external flash memory for the ``nrf52840dk/nrf52840`` as the secondary partition for the DFU process.
280284

285+
* :ref:`bluetooth_mesh_sensor_client` sample:
286+
287+
* Updated:
288+
289+
* To demonstrate the Bluetooth :ref:`ug_bt_mesh_nlc` HVAC Integration profile.
290+
* The following Mesh samples to use individual NLC profile configurations instead of the deprecated options:
291+
292+
* :ref:`bluetooth_mesh_light_dim`
293+
* :ref:`bluetooth_mesh_light_lc`
294+
* :ref:`bluetooth_mesh_sensor_server`
295+
* :ref:`bluetooth_mesh_sensor_client`
296+
281297
Bluetooth Fast Pair samples
282298
---------------------------
283299

include/bluetooth/mesh/models.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
#define BT_MESH_NLC_PROFILE_ID_ENERGY_MONITOR 0x1604
8080
/** Occupancy Sensor NLC Profile 1.0 */
8181
#define BT_MESH_NLC_PROFILE_ID_OCCUPANCY_SENSOR 0x1605
82+
/** HVAC Integration NLC Profile 1.0 */
83+
#define BT_MESH_NLC_PROFILE_ID_HVAC_INTEGRATION 0x1606
8284
/**
8385
* @}
8486
*/

samples/bluetooth/mesh/light_ctrl/prj.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ CONFIG_BT_MESH_PROXY_USE_DEVICE_NAME=y
4848
CONFIG_BT_MESH_GATT_PROXY=y
4949
CONFIG_BT_MESH_ADV_EXT_GATT_SEPARATE=y
5050
CONFIG_BT_MESH_DK_PROV=y
51-
CONFIG_BT_MESH_NLC_PERF_CONF=y
5251
CONFIG_BT_MESH_NLC_PERF_LIGHTNESS_CTRL=y
52+
CONFIG_BT_MESH_NLC_PERF_ENERGY_MONITOR=y
5353
CONFIG_BT_MESH_MODEL_EXTENSIONS=y
5454
CONFIG_BT_MESH_MODEL_EXTENSION_LIST_SIZE=18
55-
# Enabling BT_MESH_NLC_PERF_CONF enables support for 3 application keys by
55+
# Enabling NLC Lightness Controller profile enables support for 3 application keys by
5656
# default. Therefore, allow up to 3 application key bindings per model instance.
5757
CONFIG_BT_MESH_MODEL_KEY_COUNT=3
5858

samples/bluetooth/mesh/light_dimmer/prj.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ CONFIG_BT_MESH_PB_GATT=y
4747
CONFIG_BT_MESH_GATT_PROXY=y
4848
CONFIG_BT_MESH_PROXY_USE_DEVICE_NAME=y
4949
CONFIG_BT_MESH_DK_PROV=y
50-
CONFIG_BT_MESH_NLC_PERF_CONF=y
51-
# Enabling BT_MESH_NLC_PERF_CONF enables support for 3 application keys by
50+
CONFIG_BT_MESH_NLC_PERF_DIMMING_CONTROL=y
51+
CONFIG_BT_MESH_NLC_PERF_SCENE_SELECTOR=y
52+
# Enabling NLC Dimming Control profile enables support for 3 application keys by
5253
# default. Therefore, allow up to 3 application key bindings per model instance.
5354
CONFIG_BT_MESH_MODEL_KEY_COUNT=3
5455

samples/bluetooth/mesh/sensor_client/README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ The Bluetooth® Mesh sensor observer sample demonstrates how to set up a basic B
1111
Eight different sensor types are used to showcase different ways for the server to publish data.
1212
In addition, the samples demonstrate usage of both :ref:`single-channel sensor types and sensor series types <bt_mesh_sensor_types_channels>`, as well as how to add and write to a sensor setting.
1313

14+
This sample also demonstrates how to implement the HVAC Integration NLC Profile (see :ref:`ug_bt_mesh_nlc`).
15+
1416
.. note::
1517
This sample must be paired with :ref:`bluetooth_mesh_sensor_server` to show any functionality.
1618
The observer has no sensor data, and is dependent on a mesh sensor to provide it.

samples/bluetooth/mesh/sensor_client/prj.conf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ CONFIG_BT_MESH_PB_GATT=y
5151
CONFIG_BT_MESH_GATT_PROXY=y
5252
CONFIG_BT_MESH_PROXY_USE_DEVICE_NAME=y
5353
CONFIG_BT_MESH_DK_PROV=y
54-
CONFIG_BT_MESH_SUBNET_COUNT=2
55-
CONFIG_BT_MESH_APP_KEY_COUNT=3
54+
CONFIG_BT_MESH_NLC_PERF_HVAC_INTEGRATION=y
55+
# Enabling NLC HVAC Integration profile enables support for 3 application keys by
56+
# default. Therefore, allow up to 3 application key bindings per model instance.
5657
CONFIG_BT_MESH_MODEL_KEY_COUNT=3
57-
CONFIG_BT_MESH_CRPL=32
58-
CONFIG_BT_MESH_MSG_CACHE_SIZE=64
5958
CONFIG_BT_MESH_SHELL=y
6059

6160
# Bluetooth Mesh models

samples/bluetooth/mesh/sensor_client/src/model_handler.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,28 @@ static const struct bt_mesh_sensor_cli_handlers bt_mesh_sensor_cli_handlers = {
142142
static struct bt_mesh_sensor_cli sensor_cli =
143143
BT_MESH_SENSOR_CLI_INIT(&bt_mesh_sensor_cli_handlers);
144144

145+
#if IS_ENABLED(CONFIG_BT_MESH_NLC_PERF_CONF)
146+
/* HVAC Integration NLC Profile composition data page 2 */
147+
static const uint8_t cmp2_elem_offset_hvac[1]; /* Profile uses element 0 */
148+
149+
static const struct bt_mesh_comp2_record comp_rec[1] = {
150+
{/* HVAC Integration NLC Profile 1.0 */
151+
.id = BT_MESH_NLC_PROFILE_ID_HVAC_INTEGRATION,
152+
.version.x = 1,
153+
.version.y = 0,
154+
.version.z = 0,
155+
.elem_offset_cnt = 1,
156+
.elem_offset = cmp2_elem_offset_hvac,
157+
.data_len = 0
158+
}
159+
};
160+
161+
static const struct bt_mesh_comp2 comp_p2 = {
162+
.record_cnt = 1,
163+
.record = comp_rec
164+
};
165+
#endif
166+
145167
static struct k_work_delayable get_data_work;
146168

147169
static void get_data(struct k_work *work)
@@ -358,6 +380,12 @@ static const struct bt_mesh_comp comp = {
358380

359381
const struct bt_mesh_comp *model_handler_init(void)
360382
{
383+
#if IS_ENABLED(CONFIG_BT_MESH_NLC_PERF_CONF)
384+
if (bt_mesh_comp2_register(&comp_p2)) {
385+
printk("Failed to register comp2\n");
386+
}
387+
#endif
388+
361389
k_work_init_delayable(&attention_blink_work, attention_blink);
362390
k_work_init_delayable(&get_data_work, get_data);
363391
k_work_init_delayable(&motion_timeout_work, motion_timeout);

samples/bluetooth/mesh/sensor_server/prj.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ CONFIG_BT_MESH_PB_GATT=y
5353
CONFIG_BT_MESH_GATT_PROXY=y
5454
CONFIG_BT_MESH_PROXY_USE_DEVICE_NAME=y
5555
CONFIG_BT_MESH_DK_PROV=y
56-
CONFIG_BT_MESH_NLC_PERF_CONF=y
56+
CONFIG_BT_MESH_NLC_PERF_AMBIENT_LIGHT_SENSOR=y
57+
CONFIG_BT_MESH_NLC_PERF_OCCUPANCY_SENSOR=y
5758
CONFIG_BT_MESH_MODEL_EXTENSIONS=y
5859
CONFIG_BT_MESH_MODEL_EXTENSION_LIST_SIZE=10
59-
# Enabling BT_MESH_NLC_PERF_CONF enables support for 3 application keys by
60+
# Enabling NLC Ambient Light Sensor profile enables support for 3 application keys by
6061
# default. Therefore, allow up to 3 application key bindings per model instance.
6162
CONFIG_BT_MESH_MODEL_KEY_COUNT=3
6263

subsys/bluetooth/mesh/Kconfig

Lines changed: 68 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ config BT_MESH_MBEDTLS_BACKEND_ENABLE
3535
# thus more HEAP is needed by MEBEDTLS to accommodate minimum number of keys.
3636
config MBEDTLS_HEAP_SIZE
3737
default 2048 if BT_MESH_DFD_SRV
38-
default 1152 if BT_MESH_NLC_PERF_CONF
38+
default 1152 if BT_MESH_NLC_PERF_BASELINE
3939
default 1024
4040

4141
if BT_SETTINGS
@@ -93,68 +93,93 @@ endif # BT_MESH_RELAY
9393

9494
endif
9595

96-
config BT_MESH_NLC_PERF_CONF
97-
bool "Enable NLC performance configurations"
96+
# Provides baseline performance requirements for NLC profiles.
97+
# Automatically enabled when any NLC profile is selected.
98+
config BT_MESH_NLC_PERF_BASELINE
99+
bool
98100
select BT_MESH_COMP_PAGE_2
99101
select BT_MESH_COMP_PAGE_1
100-
help
101-
Enables performance configurations required for NLC profiles.
102-
When implementing the NLC Basic Lightness Controller profile
103-
individually or in conjunction with other NLC profiles, also
104-
enable CONFIG_BT_MESH_NLC_PERF_LIGHTNESS_CTRL.
105102

106-
choice BT_MESH_NLC_PERF_OPTIONS
107-
prompt "NLC configuration options"
108-
depends on BT_MESH_NLC_PERF_CONF
103+
# Provides strict performance requirements needed for some NLC profiles.
104+
# Automatically enabled when relevant NLC profiles are selected.
105+
# Includes all baseline requirements plus additional strict requirements.
106+
config BT_MESH_NLC_PERF_STRICT
107+
bool
108+
select BT_MESH_NLC_PERF_BASELINE
109109

110-
config BT_MESH_NLC_PERF_DEFAULT
111-
bool "Default"
112-
help
113-
Enables performance configurations required for the NLC Basic Scene Selector,
114-
Dimming Control, Energy Monitor, Occupancy Sensor and Ambient Light Sensor profiles.
115-
When implementing the NLC Basic Lightness Controller profile individually or in
116-
conjunction with other NLC profiles, use CONFIG_BT_MESH_NLC_PERF_LIGHTNESS_CTRL instead.
110+
menu "NLC Profile performance configuration"
111+
112+
config BT_MESH_NLC_PERF_SCENE_SELECTOR
113+
bool "Basic Scene Selector NLC profile performance configuration"
114+
select BT_MESH_NLC_PERF_BASELINE
115+
116+
config BT_MESH_NLC_PERF_DIMMING_CONTROL
117+
bool "Dimming Control NLC profile performance configuration"
118+
select BT_MESH_NLC_PERF_BASELINE
119+
120+
config BT_MESH_NLC_PERF_ENERGY_MONITOR
121+
bool "Energy Monitor NLC profile performance configuration"
122+
select BT_MESH_NLC_PERF_BASELINE
123+
124+
config BT_MESH_NLC_PERF_OCCUPANCY_SENSOR
125+
bool "Occupancy Sensor NLC profile performance configuration"
126+
select BT_MESH_NLC_PERF_BASELINE
127+
128+
config BT_MESH_NLC_PERF_AMBIENT_LIGHT_SENSOR
129+
bool "Ambient Light Sensor NLC profile performance configuration"
130+
select BT_MESH_NLC_PERF_BASELINE
117131

118132
config BT_MESH_NLC_PERF_LIGHTNESS_CTRL
119-
bool "Enable strict performance configurations required for the Basic Lightness Controller"
133+
bool "Basic Lightness Controller NLC profile performance configuration"
134+
select BT_MESH_NLC_PERF_STRICT
135+
136+
config BT_MESH_NLC_PERF_HVAC_INTEGRATION
137+
bool "HVAC Integration NLC profile performance configuration"
138+
select BT_MESH_NLC_PERF_STRICT
139+
140+
endmenu
141+
142+
config BT_MESH_NLC_PERF_DEFAULT
143+
bool "Default NLC profile performance configuration [DEPRECATED]"
144+
select DEPRECATED
145+
select BT_MESH_NLC_PERF_BASELINE
120146
help
121-
Enables required performance configurations for the
122-
NLC Basic Lightness Controller. The NLC Basic Lightness Controller
123-
share most performance configurations with the common NLC profiles
124-
(CONFIG_BT_MESH_NLC_PERF_DEFAULT) but with more strict requirements for a
125-
subset of the configurations.
147+
This option is deprecated. Use individual profile options instead.
148+
Enables performance configurations required for the Basic Scene Selector,
149+
Dimming Control, Energy Monitor, Occupancy Sensor, and Ambient Light
150+
Sensor NLC profiles.
126151

127-
endchoice
152+
config BT_MESH_NLC_PERF_CONF
153+
bool "NLC performance configurations [DEPRECATED]"
154+
select DEPRECATED
155+
select BT_MESH_NLC_PERF_BASELINE
128156

157+
# Note: _STRICT configs must have precedence over _BASELINE.
129158
config BT_MESH_CRPL
130-
default 32 if BT_MESH_NLC_PERF_DEFAULT
131-
default 255 if BT_MESH_NLC_PERF_LIGHTNESS_CTRL
132-
range 32 65535 if BT_MESH_NLC_PERF_DEFAULT
133-
range 255 65535 if BT_MESH_NLC_PERF_LIGHTNESS_CTRL
159+
default 255 if BT_MESH_NLC_PERF_STRICT
160+
default 32 if BT_MESH_NLC_PERF_BASELINE
161+
range 255 65535 if BT_MESH_NLC_PERF_STRICT
162+
range 32 65535 if BT_MESH_NLC_PERF_BASELINE
134163

135164
config BT_MESH_MODEL_GROUP_COUNT
136-
default 32 if BT_MESH_NLC_PERF_LIGHTNESS_CTRL
137-
range 32 4096 if BT_MESH_NLC_PERF_LIGHTNESS_CTRL
138-
139-
if BT_MESH_NLC_PERF_CONF
165+
default 32 if BT_MESH_NLC_PERF_STRICT
166+
range 32 4096 if BT_MESH_NLC_PERF_STRICT
140167

141168
config BT_MESH_MSG_CACHE_SIZE
142-
default 64
143-
range 64 65535
169+
default 64 if BT_MESH_NLC_PERF_BASELINE
170+
range 64 65535 if BT_MESH_NLC_PERF_BASELINE
144171

145172
config BT_MESH_APP_KEY_COUNT
146-
default 3
147-
range 3 4096
173+
default 3 if BT_MESH_NLC_PERF_BASELINE
174+
range 3 4096 if BT_MESH_NLC_PERF_BASELINE
148175

149176
config BT_MESH_SUBNET_COUNT
150-
default 2
151-
range 2 4096
177+
default 2 if BT_MESH_NLC_PERF_BASELINE
178+
range 2 4096 if BT_MESH_NLC_PERF_BASELINE
152179

153180
config BT_MESH_PROXY_FILTER_SIZE
154-
default 8
155-
range 8 32767
156-
157-
endif
181+
default 8 if BT_MESH_NLC_PERF_BASELINE
182+
range 8 32767 if BT_MESH_NLC_PERF_BASELINE
158183

159184
config BT_MESH_USES_TFM_PSA
160185
bool

0 commit comments

Comments
 (0)