Skip to content

Commit

Permalink
nimble/host: Fix ble_gap_ext_adv_params_tx and rename variables
Browse files Browse the repository at this point in the history
ble_gap_ext_adv_params_tx should check if PHY options != 0
Also rename variables for consistency.
  • Loading branch information
piotrnarajowski committed Sep 10, 2024
1 parent dd1d28b commit 71b7371
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions nimble/host/include/host/ble_gap.h
Original file line number Diff line number Diff line change
Expand Up @@ -1583,11 +1583,11 @@ struct ble_gap_ext_adv_params {
/** Advertising Set ID */
uint8_t sid;

/** Primary phy options */
uint8_t pri_phy_opt;
/** Primary PHY options */
uint8_t primary_phy_opt;

/** Secondary phy options */
uint8_t sec_phy_opt;
/** Secondary PHY options */
uint8_t secondary_phy_opt;
};

/**
Expand Down
6 changes: 3 additions & 3 deletions nimble/host/src/ble_gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3258,8 +3258,8 @@ ble_gap_ext_adv_params_tx_v2(uint8_t instance,
return rc;
}

cmd.pri_phy_opt = params->pri_phy_opt;
cmd.sec_phy_opt = params->sec_phy_opt;
cmd.pri_phy_opt = params->primary_phy_opt;
cmd.sec_phy_opt = params->secondary_phy_opt;

rc = ble_hs_hci_cmd_tx(BLE_HCI_OP(BLE_HCI_OGF_LE,
BLE_HCI_OCF_LE_SET_EXT_ADV_PARAM_V2),
Expand Down Expand Up @@ -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 */
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;
}

Expand Down

0 comments on commit 71b7371

Please sign in to comment.