Zephyr API Documentation  3.7.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
HCI RAW channel

HCI RAW channel. More...

Data Structures

struct  bt_hci_raw_cmd_ext
 

Macros

#define BT_HCI_ERR_EXT_HANDLED   0xff
 
#define BT_HCI_RAW_CMD_EXT(_op, _min_len, _func)
 Helper macro to define a command extension.
 

Enumerations

enum  { BT_HCI_RAW_MODE_PASSTHROUGH = 0x00 , BT_HCI_RAW_MODE_H4 = 0x01 }
 

Functions

int bt_send (struct net_buf *buf)
 Send packet to the Bluetooth controller.
 
int bt_hci_raw_set_mode (uint8_t mode)
 Set Bluetooth RAW channel mode.
 
uint8_t bt_hci_raw_get_mode (void)
 Get Bluetooth RAW channel mode.
 
void bt_hci_raw_cmd_ext_register (struct bt_hci_raw_cmd_ext *cmds, size_t size)
 Register Bluetooth RAW command extension table.
 
int bt_enable_raw (struct k_fifo *rx_queue)
 Enable Bluetooth RAW channel:
 

Detailed Description

HCI RAW channel.

Macro Definition Documentation

◆ BT_HCI_ERR_EXT_HANDLED

#define BT_HCI_ERR_EXT_HANDLED   0xff

◆ BT_HCI_RAW_CMD_EXT

#define BT_HCI_RAW_CMD_EXT (   _op,
  _min_len,
  _func 
)

#include <zephyr/bluetooth/hci_raw.h>

Value:
{ \
.op = _op, \
.min_len = _min_len, \
.func = _func, \
}

Helper macro to define a command extension.

Parameters
_opOpcode of the command.
_min_lenMinimal length of the command.
_funcHandler function to be called.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

#include <zephyr/bluetooth/hci_raw.h>

Enumerator
BT_HCI_RAW_MODE_PASSTHROUGH 

Passthrough mode.

    While in this mode the buffers are passed as is between the stack
    and the driver.
BT_HCI_RAW_MODE_H4 

H:4 mode.

    While in this mode H:4 headers will added into the buffers
    according to the buffer type when coming from the stack and will be
    removed and used to set the buffer type.

Function Documentation

◆ bt_enable_raw()

int bt_enable_raw ( struct k_fifo rx_queue)

#include <zephyr/bluetooth/hci_raw.h>

Enable Bluetooth RAW channel:

Enable Bluetooth RAW HCI channel.

Parameters
rx_queuenetbuf queue where HCI packets received from the Bluetooth controller are to be queued. The queue is defined in the caller while the available buffers pools are handled in the stack.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_hci_raw_cmd_ext_register()

void bt_hci_raw_cmd_ext_register ( struct bt_hci_raw_cmd_ext cmds,
size_t  size 
)

#include <zephyr/bluetooth/hci_raw.h>

Register Bluetooth RAW command extension table.

Register Bluetooth RAW channel command extension table, opcodes in this table are intercepted to sent to the handler function.

Parameters
cmdsPointer to the command extension table.
sizeSize of the command extension table.

◆ bt_hci_raw_get_mode()

uint8_t bt_hci_raw_get_mode ( void  )

#include <zephyr/bluetooth/hci_raw.h>

Get Bluetooth RAW channel mode.

Get access mode of Bluetooth RAW channel.

Returns
Access mode.

◆ bt_hci_raw_set_mode()

int bt_hci_raw_set_mode ( uint8_t  mode)

#include <zephyr/bluetooth/hci_raw.h>

Set Bluetooth RAW channel mode.

Set access mode of Bluetooth RAW channel.

Parameters
modeAccess mode.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_send()

int bt_send ( struct net_buf buf)

#include <zephyr/bluetooth/hci_raw.h>

Send packet to the Bluetooth controller.

Send packet to the Bluetooth controller. Caller needs to implement netbuf pool.

Parameters
bufnetbuf packet to be send
Returns
Zero on success or (negative) error code otherwise.