How to specific hci event in zephyr based on nrf connect sdk?

Hello,

I want to specific a hci event in zephyr RTOS when using nrf connect sdk. But I don't know how to achieve it.

In Bluetooth Core v5.2, vendor specific events have the same event code, so I should how to distinguish diffirent vs events?

And I notice that there is a stuct named 'bt_hci_evt_vs' in ncs\zephyr\include\bluetooth\hci_vs.h:

struct bt_hci_evt_vs {
	uint8_t  subevent;
} __packed;

Under the code there are some other sturcts, which maybe are vendor specific events:

#define BT_HCI_EVT_VS_FATAL_ERROR              0x02
struct bt_hci_evt_vs_fatal_error {
	uint64_t pc;
	uint8_t  err_info[0];
} __packed;

So if I want to define my event, I have to use bt_hci_evt_vs{} struct and my event sturct, then my event total paramters must be 'sizeof(bt_hci_evt_vs)+sizeof(my event struct)'?

After define my event in header file, do I have other things or codes should to change or add? Should I do something change in ncs\zephyr\subsys\bluetooth\host\hci_core.c?

Thanks for your help!

Parents
  • Hi,

    I am not sure I understand this. Custom HCI commands and events are useful (only) for communicating some non-standard HCI command between the Bluetooth host and the Bluetooth controller. And in turn, that would only be useful if you modify the implementation of the Bluetooth controller (which is not possible for instance if you are using the SoftDevice controller that we provide for the nRF devices).

    May I ask what you want to achieve / why you want to make you own custom HCI event?

Reply
  • Hi,

    I am not sure I understand this. Custom HCI commands and events are useful (only) for communicating some non-standard HCI command between the Bluetooth host and the Bluetooth controller. And in turn, that would only be useful if you modify the implementation of the Bluetooth controller (which is not possible for instance if you are using the SoftDevice controller that we provide for the nRF devices).

    May I ask what you want to achieve / why you want to make you own custom HCI event?

Children
Related