File tree Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -1160,7 +1160,19 @@ struct ble_gap_ext_adv_params {
1160
1160
/** If perform high-duty directed advertising */
1161
1161
unsigned int high_duty_directed :1 ;
1162
1162
1163
- /** If use legacy PDUs for advertising */
1163
+ /** If use legacy PDUs for advertising.
1164
+ *
1165
+ * Valid combinations of the connectable, scannable, directed,
1166
+ * high_duty_directed options with the legcy_pdu flag are:
1167
+ * - IND -> legacy_pdu + connectable + scannable
1168
+ * - LD_DIR -> legacy_pdu + connectable + directed
1169
+ * - HD_DIR -> legacy_pdu + connectable + directed + high_duty_directed
1170
+ * - SCAN -> legacy_pdu + scannable
1171
+ * - NONCONN -> legacy_pdu
1172
+ *
1173
+ * Any other combination of these options combined with the legacy_pdu flag
1174
+ * are invalid.
1175
+ */
1164
1176
unsigned int legacy_pdu :1 ;
1165
1177
1166
1178
/** If perform anonymous advertising */
Original file line number Diff line number Diff line change @@ -2692,15 +2692,28 @@ ble_gap_ext_adv_params_tx(uint8_t instance,
2692
2692
if (params -> high_duty_directed ) {
2693
2693
cmd .props |= BLE_HCI_LE_SET_EXT_ADV_PROP_HD_DIRECTED ;
2694
2694
}
2695
- if (params -> legacy_pdu ) {
2696
- cmd .props |= BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY ;
2697
- }
2698
2695
if (params -> anonymous ) {
2699
2696
cmd .props |= BLE_HCI_LE_SET_EXT_ADV_PROP_ANON_ADV ;
2700
2697
}
2701
2698
if (params -> include_tx_power ) {
2702
2699
cmd .props |= BLE_HCI_LE_SET_EXT_ADV_PROP_INC_TX_PWR ;
2703
2700
}
2701
+ if (params -> legacy_pdu ) {
2702
+ cmd .props |= BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY ;
2703
+
2704
+ /* check right away if the applied configuration is valid before handing
2705
+ * the command to the controller to improve error reporting */
2706
+ switch (cmd .props ) {
2707
+ case BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY_IND :
2708
+ case BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY_LD_DIR :
2709
+ case BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY_HD_DIR :
2710
+ case BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY_SCAN :
2711
+ case BLE_HCI_LE_SET_EXT_ADV_PROP_LEGACY_NONCONN :
2712
+ break ;
2713
+ default :
2714
+ return BLE_HS_EINVAL ;
2715
+ }
2716
+ }
2704
2717
2705
2718
/* Fill optional fields if application did not specify them. */
2706
2719
if (params -> itvl_min == 0 && params -> itvl_max == 0 ) {
You can’t perform that action at this time.
0 commit comments