11#ifndef ZEPHYR_INCLUDE_BLUETOOTH_HCI_PKT_H_
12#define ZEPHYR_INCLUDE_BLUETOOTH_HCI_PKT_H_
60#define BT_HCI_PKT_CMD_HDR_SIZE (sizeof(uint8_t) + BT_HCI_CMD_HDR_SIZE)
63#define BT_HCI_PKT_CMD_SIZE(param_len) (BT_HCI_PKT_CMD_HDR_SIZE + (param_len))
66#define Z_BT_HCI_PKT_CMD_DEFINE(_name, _max_param_len, _storage) \
67 _storage uint8_t net_buf_data_##_name[BT_HCI_PKT_CMD_SIZE(_max_param_len)]; \
68 _storage struct net_buf_simple _name = { \
69 .data = net_buf_data_##_name + BT_HCI_PKT_CMD_HDR_SIZE, \
71 .size = BT_HCI_PKT_CMD_SIZE(_max_param_len), \
72 .__buf = net_buf_data_##_name, \
90#define BT_HCI_PKT_CMD_DEFINE(_name, _max_param_len) \
91 Z_BT_HCI_PKT_CMD_DEFINE(_name, _max_param_len,)
100#define BT_HCI_PKT_CMD_DEFINE_STATIC(_name, _max_param_len) \
101 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:141
uint8_t status
Status code (BT_HCI_ERR_*).
Definition hci_pkt.h:163
const uint8_t * rp
Return parameters of the command.
Definition hci_pkt.h:171
uint16_t opcode
Opcode of the command the event responds to.
Definition hci_pkt.h:147
uint8_t ncmd
Num_HCI_Command_Packets.
Definition hci_pkt.h:152
size_t rp_len
Length of rp in bytes.
Definition hci_pkt.h:173
Simple network buffer representation.
Definition net_buf.h:89