nimble/host: Fix ble_gap_ext_adv_params_tx and rename variables

ble_gap_ext_adv_params_tx should check if PHY options != 0
Also rename variables for consistency.
This commit is contained in:
Piotr Narajowski
2024-09-10 14:44:11 +02:00
committed by Szymon Janc
parent 2fa42c38bc
commit 5effa1d3a1
2 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -1583,11 +1583,11 @@ struct ble_gap_ext_adv_params {
/** Advertising Set ID */ /** Advertising Set ID */
uint8_t sid; uint8_t sid;
/** Primary phy options */ /** Primary PHY options */
uint8_t pri_phy_opt; uint8_t primary_phy_opt;
/** Secondary phy options */ /** Secondary PHY options */
uint8_t sec_phy_opt; uint8_t secondary_phy_opt;
}; };
/** /**
+3 -3
View File
@@ -3258,8 +3258,8 @@ ble_gap_ext_adv_params_tx_v2(uint8_t instance,
return rc; return rc;
} }
cmd.pri_phy_opt = params->pri_phy_opt; cmd.pri_phy_opt = params->primary_phy_opt;
cmd.sec_phy_opt = params->sec_phy_opt; cmd.sec_phy_opt = params->secondary_phy_opt;
rc = ble_hs_hci_cmd_tx(BLE_HCI_OP(BLE_HCI_OGF_LE, rc = ble_hs_hci_cmd_tx(BLE_HCI_OP(BLE_HCI_OGF_LE,
BLE_HCI_OCF_LE_SET_EXT_ADV_PARAM_V2), BLE_HCI_OCF_LE_SET_EXT_ADV_PARAM_V2),
@@ -3288,7 +3288,7 @@ ble_gap_ext_adv_params_tx(uint8_t instance,
/* Return Error if phy is non-zero and controller doesn't support V2 */ /* Return Error if phy is non-zero and controller doesn't support V2 */
if (!((sup_cmd.commands[46] & 0x04) != 0) && if (!((sup_cmd.commands[46] & 0x04) != 0) &&
(params->primary_phy || params->secondary_phy)) { (params->primary_phy_opt || params->secondary_phy_opt)) {
return BLE_HS_EINVAL; return BLE_HS_EINVAL;
} }