Dear Nordic support team,
I cannot enable the Nordic specific HCI command to enable the HCI survey, I always get the following error with NCS v2.6.1:
[ 0.019409] <inf> bt_sdc_hci_driver: SoftDevice Controller build revision: 36 f0 e5 0e 87 68 48 fb 02 fd 9f 82 cc 32 e5 7b |6....hH. .....2.{ 91 b1 5c ed |..\. [ 0.022369] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002) [ 0.022399] <inf> bt_hci_core: HW Variant: nRF52x (0x0002) [ 0.022460] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 54.58864 Build 1214809870 [ 0.023620] <inf> bt_hci_core: Identity: F3:05:51:37:EA:16 (random) [ 0.023651] <inf> bt_hci_core: HCI: version 5.4 (0x0d) revision 0x118f, manufacturer 0x0059 [ 0.023681] <inf> bt_hci_core: LMP: version 5.4 (0x0d) subver 0x118f [ 0.025085] <wrn> bt_hci_core: opcode 0xfd0e status 0x01 [ 0.025115] <err> BLE: Failed to enable HCI survey : -5
For information in the prj.conf file are enabled :
CONFIG_BT_CTLR=y CONFIG_BT_CTLR_CONN_RSSI=y CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y # Request a TX power in dBm. The power level set will be equal to or less than the one requested, based on the values supported by the hardware used. # See https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.3.0/kconfig/index.html#CONFIG_BT_CTLR_TX_PWR_ANTENNA CONFIG_BT_CTLR_TX_PWR_ANTENNA=18 CONFIG_BT_CTLR_SDC_QOS_CHANNEL_SURVEY=y # Enable the Vendor Specific HCI event reporting to the user # This is needed to know the BLE Quality of Service CONFIG_BT_HCI_VS_EVT_USER=y CONFIG_BT_HCI_VS_EVT=y
And the piece of code to enable the survey:
void BLE_QOS_enableChannelSurvey(BLE_CONNECT_QOS_CB cb) { struct net_buf *buf = NULL; int err = bt_hci_register_vnd_evt_cb(cb); if (err) { LOG_ERR("Failed to register HCI VS callback"); return; } sdc_hci_cmd_vs_qos_channel_survey_enable_t *cmd_enable = NULL; buf = bt_hci_cmd_create(SDC_HCI_OPCODE_CMD_VS_QOS_CHANNEL_SURVEY_ENABLE, sizeof(sdc_hci_cmd_vs_qos_channel_survey_enable_t)); if (!buf) { LOG_ERR("Failed to create HCI survey registration"); return; } cmd_enable = (sdc_hci_cmd_vs_qos_channel_survey_enable_t *)(net_buf_add( buf, sizeof(sdc_hci_cmd_vs_qos_channel_survey_enable_t))); cmd_enable->enable = 1; cmd_enable->interval_us = 3000000; err = bt_hci_cmd_send_sync(SDC_HCI_OPCODE_CMD_VS_QOS_CHANNEL_SURVEY_ENABLE, buf, NULL); if (err) { LOG_ERR("Failed to enable HCI survey : %d", err); return; } }
called right after the BLE is enabled:
int err = bt_enable(bt_ready); BLE_QOS_enableChannelSurvey(cb);
I don't understand why the HCI raises an error BT_HCI_ERR_UNKNOWN_CMD (0x01) from hci_types.h since the survey is experimental but added in NCS v2.5.0 and I'm using NCS v2.6.1.
Could you tell me what's wrong in this simple piece of code ?