From 71b73710706c44678112ca30fb76d6726cd73009 Mon Sep 17 00:00:00 2001 From: Piotr Narajowski Date: Tue, 10 Sep 2024 10:56:56 +0200 Subject: [PATCH] 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. --- nimble/host/include/host/ble_gap.h | 8 ++++---- nimble/host/src/ble_gap.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nimble/host/include/host/ble_gap.h b/nimble/host/include/host/ble_gap.h index 33c56d76d..9a1ead004 100644 --- a/nimble/host/include/host/ble_gap.h +++ b/nimble/host/include/host/ble_gap.h @@ -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; }; /** diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c index 39b6ace79..0beb39ee3 100644 --- a/nimble/host/src/ble_gap.c +++ b/nimble/host/src/ble_gap.c @@ -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), @@ -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; }