Skip to content

Commit 920c472

Browse files
andrei-menzopolmarius-alex-tache
authored andcommitted
[nxp][examples][k32w1][lock-app] Multiple ble connections changes
* Add extra gatt headers to include demo gatt service * Add build changes * Update readme Signed-off-by: Andrei Menzopol <andrei.menzopol@nxp.com>
1 parent 4e8381b commit 920c472

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

examples/lock-app/nxp/k32w1/BUILD.gn

+19
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ mcxw71_k32w1_sdk("sdk") {
9292
"${example_platform_dir}/board/peripherals.h",
9393
]
9494
}
95+
96+
if (nxp_multiple_ble_connections)
97+
{
98+
include_dirs += [ "${example_platform_dir}/app_ble/include" ]
99+
defines += [
100+
"EXTRA_GATT_DB_HEADER=\"extra_gatt_db.h\"",
101+
"EXTRA_GATT_UUID_HEADER=\"extra_gatt_uuid128.h\"",
102+
]
103+
}
95104
}
96105

97106
mcxw71_k32w1_executable("lock_app") {
@@ -140,6 +149,7 @@ mcxw71_k32w1_executable("lock_app") {
140149
"${common_example_dir}/low_power/include",
141150
"${common_example_dir}/operational_keystore/include",
142151
"${common_example_dir}/ui_feedback/include",
152+
"${common_example_dir}/app_ble/include",
143153
]
144154

145155
sources += [
@@ -189,6 +199,15 @@ mcxw71_k32w1_executable("lock_app") {
189199
deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ]
190200
}
191201

202+
if (nxp_multiple_ble_connections)
203+
{
204+
sources += [ "${example_platform_dir}/app_ble/source/BLEApplicationManager.cpp", ]
205+
}
206+
else
207+
{
208+
sources += [ "${common_example_dir}/app_ble/source/BLEApplicationManagerEmpty.cpp", ]
209+
}
210+
192211
if (chip_with_diag_logs_demo) {
193212
sources += [
194213
"${common_example_dir}/diagnostic_logs/source/DiagnosticLogsDemo.cpp",

examples/lock-app/nxp/k32w1/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ For generic information related to door lock application, please see the
1212
- [Flashing the host image](#flashing-the-host-image)
1313
- [Debugging](#debugging)
1414
- [OTA](#ota)
15+
- [Multiple BLE connections](#multiple-ble-connections)
1516

1617
## Introduction
1718

@@ -163,3 +164,12 @@ Run -> Debug Configurations... -> C/C++ Application
163164
164165
Please see
165166
[k32w1 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md).
167+
168+
## Multiple BLE connections
169+
170+
To compile with the Multiple BLE connections support demo example add the gn argument
171+
`nxp_multiple_ble_connections=true`.
172+
173+
The application will accept multiple BLE connections after commissioning, by pressing the BLE advertise button again. Once discovered by a BLE central, a custom GATT service will be visible on the device.
174+
175+
The user can change the default behavior by implementing the class defined in [BLEApplicationManager.h](../../../platform/nxp/common/app_ble/include/BLEApplicationManager.h)

0 commit comments

Comments
 (0)