From c79ffd112f4e9f39bcbc859275f4f6e1ba3316a5 Mon Sep 17 00:00:00 2001 From: paul-szczepanek-arm <33840200+paul-szczepanek-arm@users.noreply.github.com> Date: Mon, 12 Aug 2019 16:38:42 +0100 Subject: [PATCH 1/2] add nonscannable connectable type --- features/FEATURE_BLE/ble/gap/Types.h | 8 +++++++- features/FEATURE_BLE/ble/pal/GapTypes.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/features/FEATURE_BLE/ble/gap/Types.h b/features/FEATURE_BLE/ble/gap/Types.h index 9cd255e34b..8b0e00b68b 100644 --- a/features/FEATURE_BLE/ble/gap/Types.h +++ b/features/FEATURE_BLE/ble/gap/Types.h @@ -183,13 +183,19 @@ struct advertising_type_t : SafeEnum { */ CONNECTABLE_DIRECTED_LOW_DUTY = 0x04, + /** + * Device is connectable, but not scannable and doesn't expect connection from a specific peer. + */ + CONNECTABLE_NON_SCANNABLE_UNDIRECTED = 0x05, + #if !defined(DOXYGEN_ONLY) // used by the PAL; naming in line with the the spec. ADV_IND = 0x00, ADV_DIRECT_IND = 0x01, ADV_SCAN_IND = 0x02, ADV_NONCONN_IND = 0x03, - ADV_DIRECT_IND_LOW_DUTY_CYCLE = 0x04 + ADV_DIRECT_IND_LOW_DUTY_CYCLE = 0x04, + ADV_NONSCAN_IND = 0x05 #endif }; diff --git a/features/FEATURE_BLE/ble/pal/GapTypes.h b/features/FEATURE_BLE/ble/pal/GapTypes.h index 688a09cc71..e53ea8d8ef 100644 --- a/features/FEATURE_BLE/ble/pal/GapTypes.h +++ b/features/FEATURE_BLE/ble/pal/GapTypes.h @@ -446,6 +446,9 @@ struct advertising_event_properties_t { break; case advertising_type_t::ADV_NONCONN_IND: break; + case advertising_type_t::ADV_NONSCAN_IND: + connectable = true; + break; } } From 71f59eaf6cbb2fdb0eac20a1911664645d94dba3 Mon Sep 17 00:00:00 2001 From: Paul Szczepanek Date: Wed, 14 Aug 2019 17:11:52 +0100 Subject: [PATCH 2/2] add comments --- features/FEATURE_BLE/ble/gap/Types.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/features/FEATURE_BLE/ble/gap/Types.h b/features/FEATURE_BLE/ble/gap/Types.h index 8b0e00b68b..230bcd0009 100644 --- a/features/FEATURE_BLE/ble/gap/Types.h +++ b/features/FEATURE_BLE/ble/gap/Types.h @@ -152,6 +152,8 @@ struct advertising_type_t : SafeEnum { /** * Device is connectable, scannable and doesn't expect connection from a * specific peer. + * @note Cannot carry extended advertising payload, only legacy PDUs. + * Use CONNECTABLE_NON_SCANNABLE_UNDIRECTED for non-legacy payload. * * @see Vol 3, Part C, Section 9.3.4 and Vol 6, Part B, Section 2.3.1.1. */ @@ -185,6 +187,8 @@ struct advertising_type_t : SafeEnum { /** * Device is connectable, but not scannable and doesn't expect connection from a specific peer. + * @note Only for use with extended advertising payload, will not allow legacy PDUs + * (use CONNECTABLE_UNDIRECTED for legacy PDU). */ CONNECTABLE_NON_SCANNABLE_UNDIRECTED = 0x05,