File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
features/FEATURE_BLE/ble/gap Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,11 @@ class AdvertisingParameters {
174
174
*/
175
175
AdvertisingParameters &setType (advertising_type_t newAdvType)
176
176
{
177
+ if (newAdvType == advertising_type_t ::CONNECTABLE_UNDIRECTED ||
178
+ newAdvType == advertising_type_t ::CONNECTABLE_DIRECTED) {
179
+ /* these types can only be used with legacy PDUs */
180
+ MBED_ASSERT (_legacyPDU);
181
+ }
177
182
_advType = newAdvType;
178
183
return *this ;
179
184
}
@@ -461,6 +466,12 @@ class AdvertisingParameters {
461
466
*/
462
467
AdvertisingParameters &setUseLegacyPDU (bool enable = true )
463
468
{
469
+ if (!enable) {
470
+ /* these types can only be used with legacy PDUs */
471
+ MBED_ASSERT ((_advType != advertising_type_t ::CONNECTABLE_UNDIRECTED) &&
472
+ (_advType != advertising_type_t ::CONNECTABLE_DIRECTED));
473
+ }
474
+
464
475
_legacyPDU = enable;
465
476
return *this ;
466
477
}
You can’t perform that action at this time.
0 commit comments