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 531f07f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 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.primary_phy_opt = params->primary_phy_opt;
cmd.secondary_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
4 changes: 2 additions & 2 deletions nimble/include/nimble/hci_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1153,8 +1153,8 @@ struct ble_hci_le_subrate_req_cp {
#define BLE_HCI_OCF_LE_SET_EXT_ADV_PARAM_V2 (0x007F)
struct ble_hci_le_set_ext_adv_params_v2_cp {
struct ble_hci_le_set_ext_adv_params_cp cmd;
uint8_t pri_phy_opt;
uint8_t sec_phy_opt;
uint8_t primary_phy_opt;
uint8_t secondary_phy_opt;
} __attribute__((packed));

#define BLE_HCI_OCF_LE_CS_RD_LOC_SUPP_CAP (0x0089)
Expand Down

0 comments on commit 531f07f

Please sign in to comment.