This is an automated email from the ASF dual-hosted git repository. janc pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit a82be4f1570a8eee42e04b243dd861286b24dc5f Author: Szymon Janc <[email protected]> AuthorDate: Tue Feb 8 12:44:41 2022 +0100 nimble: Allow to define offset for HCI VS commands This allows to tune starting offset for NimBLE VS HCI commands. --- nimble/include/nimble/hci_common.h | 4 ++-- nimble/syscfg.yml | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/nimble/include/nimble/hci_common.h b/nimble/include/nimble/hci_common.h index e483083..32d06b6 100644 --- a/nimble/include/nimble/hci_common.h +++ b/nimble/include/nimble/hci_common.h @@ -1063,7 +1063,7 @@ struct ble_hci_le_set_host_feat_cp { /* --- Vendor specific commands (OGF 0x003F) */ /* Read Random Static Address */ -#define BLE_HCI_OCF_VS_RD_STATIC_ADDR (0x0001) +#define BLE_HCI_OCF_VS_RD_STATIC_ADDR (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0001)) struct ble_hci_vs_rd_static_addr_rp { uint8_t addr[6]; } __attribute__((packed)); @@ -1071,7 +1071,7 @@ struct ble_hci_vs_rd_static_addr_rp { /* Set default transmit power. Actual selected TX power is returned * in reply. Setting 0xff restores controller reset default. */ -#define BLE_HCI_OCF_VS_SET_TX_PWR (0x0002) +#define BLE_HCI_OCF_VS_SET_TX_PWR (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0002)) struct ble_hci_vs_set_tx_pwr_cp { int8_t tx_power; } __attribute__((packed)); diff --git a/nimble/syscfg.yml b/nimble/syscfg.yml index 0e87c06..2d2d329 100644 --- a/nimble/syscfg.yml +++ b/nimble/syscfg.yml @@ -101,6 +101,13 @@ syscfg.defs: Enables support for NimBLE specific vendor HCI commands value: 0 + BLE_HCI_VS_OCF_OFFSET: + description: > + This defines starting offset for NimBLE specific vendor HCI commands. + Purpose of this is to improve compatibility with other custom + implementations. + value: 0 + # Allow periodic sync transfer only if 5.1 or higher syscfg.restrictions: - "'BLE_PERIODIC_ADV_SYNC_TRANSFER == 0' || 'BLE_VERSION >= 51'"
