11#ifndef ZEPHYR_INCLUDE_BLUETOOTH_HCI_PKT_H_
12#define ZEPHYR_INCLUDE_BLUETOOTH_HCI_PKT_H_
61#define BT_HCI_PKT_CMD_HDR_SIZE (sizeof(uint8_t) + BT_HCI_CMD_HDR_SIZE)
64#define BT_HCI_PKT_CMD_SIZE(param_len) (BT_HCI_PKT_CMD_HDR_SIZE + (param_len))
67#define Z_BT_HCI_PKT_CMD_DEFINE(_name, _max_param_len, _storage) \
68 _storage uint8_t net_buf_data_##_name[BT_HCI_PKT_CMD_SIZE(_max_param_len)]; \
69 _storage struct net_buf_simple _name = { \
70 .data = net_buf_data_##_name + BT_HCI_PKT_CMD_HDR_SIZE, \
72 .size = BT_HCI_PKT_CMD_SIZE(_max_param_len), \
73 .__buf = net_buf_data_##_name, \
91#define BT_HCI_PKT_CMD_DEFINE(_name, _max_param_len) \
92 Z_BT_HCI_PKT_CMD_DEFINE(_name, _max_param_len,)
101#define BT_HCI_PKT_CMD_DEFINE_STATIC(_name, _max_param_len) \
102 Z_BT_HCI_PKT_CMD_DEFINE(_name, _max_param_len, static)
int bt_hci_pkt_pull_cmd_complete(struct net_buf_simple *buf, struct bt_hci_pkt_cmd_rsp *rsp)
Pull an HCI_Command_Complete event.
int bt_hci_pkt_parse_cmd_rsp(const uint8_t *pkt, size_t len, struct bt_hci_pkt_cmd_rsp *rsp)
Parse an HCI command response from a complete HCI packet.
int bt_hci_pkt_pull_cmd_status(struct net_buf_simple *buf, struct bt_hci_pkt_cmd_rsp *rsp)
Pull an HCI_Command_Status event.
void bt_hci_pkt_reset_cmd(struct net_buf_simple *buf)
Reset a buffer for a new HCI command packet.
int bt_hci_pkt_push_cmd_hdr(struct net_buf_simple *buf, uint16_t opcode)
Push the packet indicator and command header of an HCI command packet.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Decoded HCI command response.
Definition hci_pkt.h:142
uint8_t status
Status code (BT_HCI_ERR_*).
Definition hci_pkt.h:164
const uint8_t * rp
Return parameters of the command.
Definition hci_pkt.h:172
uint16_t opcode
Opcode of the command the event responds to.
Definition hci_pkt.h:148
uint8_t ncmd
Num_HCI_Command_Packets.
Definition hci_pkt.h:153
size_t rp_len
Length of rp in bytes.
Definition hci_pkt.h:174
Simple network buffer representation.
Definition net_buf.h:89