diff --git a/nimble/include/nimble/hci_common.h b/nimble/include/nimble/hci_common.h index e4830833b..32d06b60f 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 0e87c0647..2d2d32927 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'"