USB Host Shield 2.0
|
#include <BTD.h>
Public Member Functions | |
BTD (USB *p) | |
void | disconnect () |
int8_t | registerServiceClass (BluetoothService *pService) |
void | pairWithWiimote () |
uint8_t | readPollInterval () |
USBDeviceConfig implementation | |
virtual uint8_t | ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed) |
virtual uint8_t | Init (uint8_t parent, uint8_t port, bool lowspeed) |
virtual uint8_t | Release () |
virtual uint8_t | Poll () |
virtual uint8_t | GetAddress () |
virtual bool | isReady () |
virtual boolean | DEVCLASSOK (uint8_t klass) |
virtual boolean | VIDPIDOK (uint16_t vid, uint16_t pid) |
UsbConfigXtracter implementation | |
virtual void | EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) |
HCI Commands | |
void | HCI_Command (uint8_t *data, uint16_t nbytes) |
void | hci_reset () |
void | hci_read_bdaddr () |
void | hci_read_local_version_information () |
void | hci_set_local_name (const char *name) |
void | hci_write_scan_enable () |
void | hci_write_scan_disable () |
void | hci_remote_name () |
void | hci_accept_connection () |
void | hci_disconnect (uint16_t handle) |
void | hci_pin_code_request_reply () |
void | hci_pin_code_negative_request_reply () |
void | hci_link_key_request_negative_reply () |
void | hci_authentication_request () |
void | hci_inquiry () |
void | hci_inquiry_cancel () |
void | hci_connect () |
void | hci_write_class_of_device () |
L2CAP Commands | |
void | L2CAP_Command (uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00) |
void | l2cap_connection_request (uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm) |
void | l2cap_connection_response (uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result) |
void | l2cap_config_request (uint16_t handle, uint8_t rxid, uint8_t *dcid) |
void | l2cap_config_response (uint16_t handle, uint8_t rxid, uint8_t *scid) |
void | l2cap_disconnection_request (uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid) |
void | l2cap_disconnection_response (uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid) |
void | l2cap_information_response (uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh) |
Public Member Functions inherited from USBDeviceConfig | |
virtual void | ResetHubPort (uint8_t port) |
Public Attributes | |
bool | watingForConnection |
bool | l2capConnectionClaimed |
bool | sdpConnectionClaimed |
bool | rfcommConnectionClaimed |
const char * | btdName |
const char * | btdPin |
uint8_t | my_bdaddr [6] |
uint16_t | hci_handle |
uint8_t | disc_bdaddr [6] |
uint8_t | remote_name [30] |
uint8_t | hci_version |
bool | connectToWii |
bool | incomingWii |
bool | pairWithWii |
bool | motionPlusInside |
bool | wiiUProController |
Protected Member Functions | |
void | PrintEndpointDescriptor (const USB_ENDPOINT_DESCRIPTOR *ep_ptr) |
Protected Attributes | |
USB * | pUsb |
uint8_t | bAddress |
EpInfo | epInfo [BTD_MAX_ENDPOINTS] |
uint8_t | bConfNum |
uint8_t | bNumEP |
uint32_t | qNextPollTime |
Static Protected Attributes | |
static const uint8_t | BTD_CONTROL_PIPE = 0 |
static const uint8_t | BTD_EVENT_PIPE = 1 |
static const uint8_t | BTD_DATAIN_PIPE = 2 |
static const uint8_t | BTD_DATAOUT_PIPE = 3 |
The Bluetooth Dongle class will take care of all the USB communication and then pass the data to the BluetoothService classes.
BTD::BTD | ( | USB * | p | ) |
|
virtual |
Address assignment and basic initilization is done here.
parent | Hub number. |
port | Port number on the hub. |
lowspeed | Speed of the device. |
Reimplemented from USBDeviceConfig.
|
virtual |
Initialize the Bluetooth dongle.
parent | Hub number. |
port | Port number on the hub. |
lowspeed | Speed of the device. |
Reimplemented from USBDeviceConfig.
|
virtual |
|
virtual |
Poll the USB Input endpoins and run the state machines.
Reimplemented from USBDeviceConfig.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Used by the USB core to check what this driver support. Used to set the Bluetooth address into the PS3 controllers.
vid | The device's VID. |
pid | The device's PID. |
Reimplemented from USBDeviceConfig.
|
virtual |
UsbConfigXtracter implementation, used to extract endpoint information.
conf | Configuration value. |
iface | Interface number. |
alt | Alternate setting. |
proto | Interface Protocol. |
ep | Endpoint Descriptor. |
Implements UsbConfigXtracter.
|
inline |
|
inline |
Register bluetooth dongle members/services.
pService | Pointer to BluetoothService class instance. |
void BTD::HCI_Command | ( | uint8_t * | data, |
uint16_t | nbytes | ||
) |
void BTD::hci_read_bdaddr | ( | ) |
void BTD::hci_read_local_version_information | ( | ) |
void BTD::hci_set_local_name | ( | const char * | name | ) |
void BTD::hci_write_scan_enable | ( | ) |
void BTD::hci_write_scan_disable | ( | ) |
void BTD::hci_accept_connection | ( | ) |
void BTD::hci_disconnect | ( | uint16_t | handle | ) |
void BTD::hci_pin_code_request_reply | ( | ) |
void BTD::hci_pin_code_negative_request_reply | ( | ) |
void BTD::hci_link_key_request_negative_reply | ( | ) |
void BTD::hci_authentication_request | ( | ) |
void BTD::hci_write_class_of_device | ( | ) |
void BTD::L2CAP_Command | ( | uint16_t | handle, |
uint8_t * | data, | ||
uint8_t | nbytes, | ||
uint8_t | channelLow = 0x01 , |
||
uint8_t | channelHigh = 0x00 |
||
) |
Used to send L2CAP Commands.
handle | HCI Handle. |
data | Data to send. |
nbytes | Number of bytes to send. |
channelLow,channelHigh | Low and high byte of channel to send to. If argument is omitted then the Standard L2CAP header: Channel ID (0x01) for ACL-U will be used. |
void BTD::l2cap_connection_request | ( | uint16_t | handle, |
uint8_t | rxid, | ||
uint8_t * | scid, | ||
uint16_t | psm | ||
) |
L2CAP Connection Request.
handle | HCI handle. |
rxid | Identifier. |
scid | Source Channel Identifier. |
psm | Protocol/Service Multiplexer - see: https://www.bluetooth.org/Technical/AssignedNumbers/logical_link.htm. |
void BTD::l2cap_connection_response | ( | uint16_t | handle, |
uint8_t | rxid, | ||
uint8_t * | dcid, | ||
uint8_t * | scid, | ||
uint8_t | result | ||
) |
L2CAP Connection Response.
handle | HCI handle. |
rxid | Identifier. |
dcid | Destination Channel Identifier. |
scid | Source Channel Identifier. |
result | Result - First send PENDING and then SUCCESSFUL. |
void BTD::l2cap_config_request | ( | uint16_t | handle, |
uint8_t | rxid, | ||
uint8_t * | dcid | ||
) |
void BTD::l2cap_config_response | ( | uint16_t | handle, |
uint8_t | rxid, | ||
uint8_t * | scid | ||
) |
void BTD::l2cap_disconnection_request | ( | uint16_t | handle, |
uint8_t | rxid, | ||
uint8_t * | dcid, | ||
uint8_t * | scid | ||
) |
void BTD::l2cap_disconnection_response | ( | uint16_t | handle, |
uint8_t | rxid, | ||
uint8_t * | dcid, | ||
uint8_t * | scid | ||
) |
void BTD::l2cap_information_response | ( | uint16_t | handle, |
uint8_t | rxid, | ||
uint8_t | infoTypeLow, | ||
uint8_t | infoTypeHigh | ||
) |
|
inline |
|
inline |
|
protected |
bool BTD::watingForConnection |
bool BTD::l2capConnectionClaimed |
bool BTD::sdpConnectionClaimed |
bool BTD::rfcommConnectionClaimed |
const char* BTD::btdName |
const char* BTD::btdPin |
uint8_t BTD::my_bdaddr[6] |
uint8_t BTD::disc_bdaddr[6] |
uint8_t BTD::remote_name[30] |
uint8_t BTD::hci_version |
bool BTD::connectToWii |
bool BTD::pairWithWii |
bool BTD::motionPlusInside |
bool BTD::wiiUProController |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |