Bluetooth: host: Add hardware error event handling
Add handling of the HCI_Hardware_Error event to log the hardware code. This event was unmasked in set_event_mask. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
parent
1d026703c4
commit
7ab35145fb
2 changed files with 16 additions and 0 deletions
|
@ -1363,6 +1363,11 @@ struct bt_hci_evt_cmd_status {
|
||||||
uint16_t opcode;
|
uint16_t opcode;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
|
#define BT_HCI_EVT_HARDWARE_ERROR 0x10
|
||||||
|
struct bt_hci_evt_hardware_error {
|
||||||
|
uint8_t hardware_code;
|
||||||
|
} __packed;
|
||||||
|
|
||||||
#define BT_HCI_EVT_ROLE_CHANGE 0x12
|
#define BT_HCI_EVT_ROLE_CHANGE 0x12
|
||||||
struct bt_hci_evt_role_change {
|
struct bt_hci_evt_role_change {
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
|
@ -3875,6 +3875,15 @@ static void bt_hci_evt_read_remote_version_complete(struct net_buf *buf)
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_BT_REMOTE_VERSION */
|
#endif /* CONFIG_BT_REMOTE_VERSION */
|
||||||
|
|
||||||
|
static void hci_hardware_error(struct net_buf *buf)
|
||||||
|
{
|
||||||
|
struct bt_hci_evt_hardware_error *evt;
|
||||||
|
|
||||||
|
evt = net_buf_pull_mem(buf, sizeof(*evt));
|
||||||
|
|
||||||
|
BT_ERR("Hardware error, hardware code: %d", evt->hardware_code);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_BT_SMP)
|
#if defined(CONFIG_BT_SMP)
|
||||||
static void le_ltk_neg_reply(uint16_t handle)
|
static void le_ltk_neg_reply(uint16_t handle)
|
||||||
{
|
{
|
||||||
|
@ -5047,6 +5056,8 @@ static const struct event_handler normal_events[] = {
|
||||||
bt_hci_evt_read_remote_version_complete,
|
bt_hci_evt_read_remote_version_complete,
|
||||||
sizeof(struct bt_hci_evt_remote_version_info)),
|
sizeof(struct bt_hci_evt_remote_version_info)),
|
||||||
#endif /* CONFIG_BT_REMOTE_VERSION */
|
#endif /* CONFIG_BT_REMOTE_VERSION */
|
||||||
|
EVENT_HANDLER(BT_HCI_EVT_HARDWARE_ERROR, hci_hardware_error,
|
||||||
|
sizeof(struct bt_hci_evt_hardware_error)),
|
||||||
};
|
};
|
||||||
|
|
||||||
static void hci_event(struct net_buf *buf)
|
static void hci_event(struct net_buf *buf)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue