USBIP C library 0.7.0
Virtual USB devices & host drivers over USB/IP
Loading...
Searching...
No Matches
Bluetooth - HCI transport
+ Collaboration diagram for Bluetooth - HCI transport:

Files

file  bluetooth.h
 USB Bluetooth (class 0xE0/0x01/0x01) DEVICE class.
 

Data Structures

struct  bt_opts
 Options passed to bluetooth_add(). More...
 

Typedefs

typedef struct bt_hci bt_hci
 One Bluetooth HCI transport: a single instance of the class on a device.
 

Functions

bt_hcibluetooth_add (usbip_device *dev, const bt_opts *opts)
 Add a Bluetooth dongle (HCI transport) to a device.
 
int bt_send_event (bt_hci *iface, const void *evt, int len)
 Send an HCI event to the host on the interrupt-IN endpoint (controller -> host).
 
int bt_send_acl (bt_hci *iface, const void *pdu, int len)
 Send an ACL data PDU to the host on the bulk-IN endpoint (controller -> host).
 
void * bluetooth_user (bt_hci *iface)
 Retrieve the opaque application pointer passed as bt_opts::user.
 

Variables

const usbip_device_class usbip_device_bluetooth
 The Bluetooth class, for usbip_device_add_class()
 

Detailed Description

Typedef Documentation

◆ bt_hci

typedef struct bt_hci bt_hci

One Bluetooth HCI transport: a single instance of the class on a device.

Opaque - create one with bluetooth_add() and use the functions below. Distinct from the other classes' handles, so mixing them up is a compile error rather than a misread state block.

Function Documentation

◆ bluetooth_add()

bt_hci * bluetooth_add ( usbip_device dev,
const bt_opts opts 
)

Add a Bluetooth dongle (HCI transport) to a device.

Sets the device class to USB_CLASS_WIRELESS / 0x01 / 0x01 (Wireless Controller / RF / Bluetooth).

Parameters
devthe device.
optshost->controller callbacks + options (see bt_opts).
Returns
the new function (use it with bt_send_event() / bt_send_acl()), or NULL.

◆ bt_send_event()

int bt_send_event ( bt_hci iface,
const void *  evt,
int  len 
)

Send an HCI event to the host on the interrupt-IN endpoint (controller -> host).

Parameters
ifacethe interface from bluetooth_add().
evtthe HCI event packet.
lenevent length in bytes.
Returns
bytes sent (>= 0), or a negative USB_ERROR code.

◆ bt_send_acl()

int bt_send_acl ( bt_hci iface,
const void *  pdu,
int  len 
)

Send an ACL data PDU to the host on the bulk-IN endpoint (controller -> host).

Parameters
ifacethe interface from bluetooth_add().
pduthe ACL PDU (4-byte header + payload).
lenPDU length in bytes.
Returns
bytes sent (>= 0), or a negative USB_ERROR code.

◆ bluetooth_user()

void * bluetooth_user ( bt_hci iface)

Retrieve the opaque application pointer passed as bt_opts::user.

Parameters
ifacethe interface from bluetooth_add().
Returns
the stored user pointer.

Variable Documentation

◆ usbip_device_bluetooth

const usbip_device_class usbip_device_bluetooth
extern

The Bluetooth class, for usbip_device_add_class()