@@ -104,7 +104,7 @@ ble_error_t PalGap::set_random_address(const address_t &address)
104
104
return BLE_ERROR_NONE;
105
105
}
106
106
107
-
107
+ # if BLE_ROLE_BROADCASTER
108
108
ble_error_t PalGap::set_advertising_parameters (
109
109
uint16_t advertising_interval_min,
110
110
uint16_t advertising_interval_max,
@@ -233,8 +233,9 @@ ble_error_t PalGap::advertising_enable(bool enable)
233
233
234
234
return BLE_ERROR_NONE;
235
235
}
236
+ #endif // BLE_ROLE_BROADCASTER
236
237
237
-
238
+ # if BLE_ROLE_OBSERVER
238
239
ble_error_t PalGap::set_scan_parameters (
239
240
bool active_scanning,
240
241
uint16_t scan_interval,
@@ -276,8 +277,9 @@ ble_error_t PalGap::scan_enable(
276
277
}
277
278
return BLE_ERROR_NONE;
278
279
}
280
+ #endif // BLE_ROLE_OBSERVER
279
281
280
-
282
+ # if BLE_ROLE_CENTRAL
281
283
ble_error_t PalGap::create_connection (
282
284
uint16_t scan_interval,
283
285
uint16_t scan_window,
@@ -342,8 +344,9 @@ ble_error_t PalGap::cancel_connection_creation()
342
344
343
345
return error;
344
346
}
347
+ #endif // BLE_ROLE_CENTRAL
345
348
346
-
349
+ # if BLE_FEATURE_WHITELIST
347
350
uint8_t PalGap::read_white_list_capacity ()
348
351
{
349
352
return HciGetWhiteListSize ();
@@ -381,8 +384,9 @@ ble_error_t PalGap::remove_device_from_whitelist(
381
384
);
382
385
return BLE_ERROR_NONE;
383
386
}
387
+ #endif // BLE_FEATURE_WHITELIST
384
388
385
-
389
+ # if BLE_FEATURE_CONNECTABLE
386
390
ble_error_t PalGap::connection_parameters_update (
387
391
connection_handle_t connection,
388
392
uint16_t connection_interval_min,
@@ -463,6 +467,9 @@ ble_error_t PalGap::disconnect(
463
467
return BLE_ERROR_NONE;
464
468
}
465
469
470
+ #endif // BLE_FEATURE_CONNECTABLE
471
+
472
+ #if BLE_FEATURE_PHY_MANAGEMENT
466
473
ble_error_t PalGap::read_phy (connection_handle_t connection)
467
474
{
468
475
if (is_feature_supported (controller_supported_features_t ::LE_2M_PHY)
@@ -514,6 +521,7 @@ ble_error_t PalGap::set_phy(
514
521
515
522
return BLE_ERROR_NONE;
516
523
}
524
+ #endif // BLE_FEATURE_PHY_MANAGEMENT
517
525
518
526
// singleton of the ARM Cordio client
519
527
@@ -766,6 +774,7 @@ void PalGap::gap_handler(const wsfMsgHdr_t *msg)
766
774
}
767
775
break ;
768
776
777
+ #if BLE_ROLE_PERIPHERAL
769
778
case DM_CONN_CLOSE_IND: {
770
779
// Intercept connection close indication received when direct advertising timeout.
771
780
// Leave the rest of the processing to the event handlers bellow.
@@ -775,16 +784,21 @@ void PalGap::gap_handler(const wsfMsgHdr_t *msg)
775
784
get_gap ().get_running_conn_direct_adv_cb (evt->hdr .param );
776
785
if (adv_cb) {
777
786
adv_cb->state = direct_adv_cb_t ::free;
778
- #if BLE_ROLE_BROADCASTER
779
787
if (handler) {
780
- handler->on_advertising_set_terminated (
781
- hci_error_code_t (evt->status ),
782
- adv_cb->advertising_handle ,
783
- DM_CONN_ID_NONE,
784
- 0
785
- );
788
+ #if BLE_FEATURE_EXTENDED_ADVERTISING
789
+ if (get_gap ().is_feature_supported (controller_supported_features_t ::LE_EXTENDED_ADVERTISING)) {
790
+ handler->on_advertising_set_terminated (
791
+ hci_error_code_t (evt->status ),
792
+ adv_cb->advertising_handle ,
793
+ DM_CONN_ID_NONE,
794
+ 0
795
+ );
796
+ } else
797
+ #endif
798
+ {
799
+ handler->on_legacy_advertising_stopped ();
800
+ }
786
801
}
787
- #endif // BLE_ROLE_BROADCASTER
788
802
}
789
803
}
790
804
}
@@ -801,6 +815,7 @@ void PalGap::gap_handler(const wsfMsgHdr_t *msg)
801
815
}
802
816
}
803
817
break ;
818
+ #endif // BLE_ROLE_PERIPHERAL
804
819
#endif // BLE_FEATURE_CONNECTABLE
805
820
}
806
821
@@ -843,7 +858,8 @@ bool PalGap::event_handler(const wsfMsgHdr_t *msg)
843
858
return false ;
844
859
}
845
860
846
-
861
+ #if BLE_ROLE_BROADCASTER
862
+ #if BLE_FEATURE_EXTENDED_ADVERTISING
847
863
ble_error_t PalGap::set_advertising_set_random_address (
848
864
advertising_handle_t advertising_handle,
849
865
const address_t &address
@@ -853,7 +869,6 @@ ble_error_t PalGap::set_advertising_set_random_address(
853
869
return BLE_ERROR_NONE;
854
870
}
855
871
856
- #if BLE_FEATURE_EXTENDED_ADVERTISING
857
872
ble_error_t PalGap::set_extended_advertising_parameters (
858
873
advertising_handle_t advertising_handle,
859
874
advertising_event_properties_t event_properties,
@@ -995,6 +1010,7 @@ ble_error_t PalGap::set_extended_advertising_parameters(
995
1010
}
996
1011
#endif // BLE_FEATURE_EXTENDED_ADVERTISING
997
1012
1013
+ #if BLE_FEATURE_PERIODIC_ADVERTISING
998
1014
ble_error_t PalGap::set_periodic_advertising_parameters (
999
1015
advertising_handle_t advertising_handle,
1000
1016
periodic_advertising_interval_t periodic_advertising_min,
@@ -1012,8 +1028,9 @@ ble_error_t PalGap::set_periodic_advertising_parameters(
1012
1028
1013
1029
return BLE_ERROR_NONE;
1014
1030
}
1031
+ #endif // BLE_FEATURE_PERIODIC_ADVERTISING
1015
1032
1016
-
1033
+ # if BLE_FEATURE_EXTENDED_ADVERTISING
1017
1034
ble_error_t PalGap::set_extended_advertising_data (
1018
1035
advertising_handle_t advertising_handle,
1019
1036
advertising_fragment_description_t operation,
@@ -1037,8 +1054,9 @@ ble_error_t PalGap::set_extended_advertising_data(
1037
1054
);
1038
1055
return BLE_ERROR_NONE;
1039
1056
}
1057
+ #endif // #if BLE_FEATURE_EXTENDED_ADVERTISING
1040
1058
1041
-
1059
+ # if BLE_FEATURE_PERIODIC_ADVERTISING
1042
1060
ble_error_t PalGap::set_periodic_advertising_data (
1043
1061
advertising_handle_t advertising_handle,
1044
1062
advertising_fragment_description_t fragment_description,
@@ -1054,8 +1072,9 @@ ble_error_t PalGap::set_periodic_advertising_data(
1054
1072
);
1055
1073
return BLE_ERROR_NONE;
1056
1074
}
1075
+ #endif // BLE_FEATURE_PERIODIC_ADVERTISING
1057
1076
1058
-
1077
+ # if BLE_FEATURE_EXTENDED_ADVERTISING
1059
1078
ble_error_t PalGap::set_extended_scan_response_data (
1060
1079
advertising_handle_t advertising_handle,
1061
1080
advertising_fragment_description_t operation,
@@ -1170,8 +1189,9 @@ ble_error_t PalGap::extended_advertising_enable(
1170
1189
1171
1190
return BLE_ERROR_NONE;
1172
1191
}
1192
+ #endif // BLE_FEATURE_EXTENDED_ADVERTISING
1173
1193
1174
-
1194
+ # if BLE_FEATURE_PERIODIC_ADVERTISING
1175
1195
ble_error_t PalGap::periodic_advertising_enable (
1176
1196
bool enable,
1177
1197
advertising_handle_t advertising_handle
@@ -1185,7 +1205,7 @@ ble_error_t PalGap::periodic_advertising_enable(
1185
1205
1186
1206
return BLE_ERROR_NONE;
1187
1207
}
1188
-
1208
+ # endif
1189
1209
1190
1210
uint16_t PalGap::get_maximum_advertising_data_length ()
1191
1211
{
@@ -1210,7 +1230,7 @@ uint8_t PalGap::get_max_number_of_advertising_sets()
1210
1230
return std::min (HciGetNumSupAdvSets (), (uint8_t ) DM_NUM_ADV_SETS);
1211
1231
}
1212
1232
1213
-
1233
+ # if BLE_FEATURE_EXTENDED_ADVERTISING
1214
1234
ble_error_t PalGap::remove_advertising_set (advertising_handle_t advertising_handle)
1215
1235
{
1216
1236
DmAdvRemoveAdvSet (advertising_handle);
@@ -1223,8 +1243,11 @@ ble_error_t PalGap::clear_advertising_sets()
1223
1243
DmAdvClearAdvSets ();
1224
1244
return BLE_ERROR_NONE;
1225
1245
}
1246
+ #endif // BLE_FEATURE_EXTENDED_ADVERTISING
1247
+ #endif // BLE_ROLE_BROADCASTER
1226
1248
1227
-
1249
+ #if BLE_ROLE_OBSERVER
1250
+ #if BLE_FEATURE_EXTENDED_ADVERTISING
1228
1251
ble_error_t PalGap::set_extended_scan_parameters (
1229
1252
own_address_type_t own_address_type,
1230
1253
scanning_filter_policy_t filter_policy,
@@ -1287,8 +1310,9 @@ ble_error_t PalGap::extended_scan_enable(
1287
1310
1288
1311
return BLE_ERROR_NONE;
1289
1312
}
1313
+ #endif // BLE_FEATURE_EXTENDED_ADVERTISING
1290
1314
1291
-
1315
+ # if BLE_FEATURE_PERIODIC_ADVERTISING
1292
1316
ble_error_t PalGap::periodic_advertising_create_sync (
1293
1317
bool use_periodic_advertiser_list,
1294
1318
uint8_t advertising_sid,
@@ -1376,8 +1400,10 @@ uint8_t PalGap::read_periodic_advertiser_list_size()
1376
1400
{
1377
1401
return HciGetPerAdvListSize ();
1378
1402
}
1403
+ #endif // BLE_FEATURE_PERIODIC_ADVERTISING
1404
+ #endif // BLE_ROLE_OBSERVER
1379
1405
1380
-
1406
+ # if BLE_ROLE_CENTRAL && BLE_FEATURE_EXTENDED_ADVERTISING
1381
1407
ble_error_t PalGap::extended_create_connection (
1382
1408
initiator_policy_t initiator_policy,
1383
1409
own_address_type_t own_address_type,
@@ -1430,6 +1456,7 @@ ble_error_t PalGap::extended_create_connection(
1430
1456
1431
1457
return BLE_ERROR_NONE;
1432
1458
}
1459
+ #endif // BLE_ROLE_CENTRAL && BLE_FEATURE_EXTENDED_ADVERTISING
1433
1460
1434
1461
1435
1462
ble_error_t PalGap::update_direct_advertising_parameters (
0 commit comments