Public Member Functions |
| BTD (Usb *p) |
| Constructor for the BTD class.
|
void | disconnect () |
| Disconnects both the L2CAP Channel and the HCI Connection for all Bluetooth services.
|
int8_t | registerBluetoothService (BluetoothService *pService) |
| Register Bluetooth dongle members/services.
|
void | pairWithWiimote () |
| Call this function to pair with a Wiimote.
|
void | pairWithHID () |
| Call this function to pair with a HID device.
|
uint8_t | readPollInterval () |
| Read the poll interval taken from the endpoint descriptors.
|
|
uint8_t | ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed) |
| Address assignment and basic initialization is done here.
|
uint8_t | Init (uint8_t parent, uint8_t port, bool lowspeed) |
| Initialize the Bluetooth dongle.
|
uint8_t | Release () |
| Release the USB device.
|
uint8_t | Poll () |
| Poll the USB Input endpoints and run the state machines.
|
virtual uint8_t | GetAddress () |
| Get the device address.
|
virtual bool | isReady () |
| Used to check if the dongle has been initialized.
|
virtual bool | DEVCLASSOK (uint8_t klass) |
| Used by the USB core to check what this driver support.
|
virtual bool | VIDPIDOK (uint16_t vid, uint16_t pid) |
| Used by the USB core to check what this driver support.
|
|
void | EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) |
| UsbConfigXtracter implementation, used to extract endpoint information.
|
|
void | HCI_Command (uint8_t *data, uint16_t nbytes) |
| Used to send a HCI Command.
|
void | hci_reset () |
| Reset the Bluetooth dongle.
|
void | hci_read_bdaddr () |
| Read the Bluetooth address of the dongle.
|
void | hci_read_local_version_information () |
| Read the HCI Version of the Bluetooth dongle.
|
void | hci_set_local_name (const char *name) |
| Set the local name of the Bluetooth dongle.
|
void | hci_write_scan_enable () |
| Enable visibility to other Bluetooth devices.
|
void | hci_write_scan_disable () |
| Disable visibility to other Bluetooth devices.
|
void | hci_remote_name () |
| Read the remote devices name.
|
void | hci_accept_connection () |
| Accept the connection with the Bluetooth device.
|
void | hci_disconnect (uint16_t handle) |
| Disconnect the HCI connection.
|
void | hci_pin_code_request_reply () |
| Respond with the pin for the connection.
|
void | hci_pin_code_negative_request_reply () |
| Respons when no pin was set.
|
void | hci_link_key_request_negative_reply () |
| Command is used to reply to a Link Key Request event from the BR/EDR Controller if the Host does not have a stored Link Key for the connection.
|
void | hci_authentication_request () |
| Used to try to authenticate with the remote device.
|
void | hci_inquiry () |
| Start a HCI inquiry.
|
void | hci_inquiry_cancel () |
| Cancel a HCI inquiry.
|
void | hci_connect () |
| Connect to last device communicated with.
|
void | hci_connect (uint8_t *bdaddr) |
| Connect to device.
|
void | hci_write_class_of_device () |
| Used to a set the class of the device.
|
|
void | L2CAP_Command (uint16_t handle, uint8_t *data, uint8_t nbytes, uint8_t channelLow=0x01, uint8_t channelHigh=0x00) |
| Used to send L2CAP Commands.
|
void | l2cap_connection_request (uint16_t handle, uint8_t rxid, uint8_t *scid, uint16_t psm) |
| L2CAP Connection Request.
|
void | l2cap_connection_response (uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid, uint8_t result) |
| L2CAP Connection Response.
|
void | l2cap_config_request (uint16_t handle, uint8_t rxid, uint8_t *dcid) |
| L2CAP Config Request.
|
void | l2cap_config_response (uint16_t handle, uint8_t rxid, uint8_t *scid) |
| L2CAP Config Response.
|
void | l2cap_disconnection_request (uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid) |
| L2CAP Disconnection Request.
|
void | l2cap_disconnection_response (uint16_t handle, uint8_t rxid, uint8_t *dcid, uint8_t *scid) |
| L2CAP Disconnection Response.
|
void | l2cap_information_response (uint16_t handle, uint8_t rxid, uint8_t infoTypeLow, uint8_t infoTypeHigh) |
| L2CAP Information Response.
|
Data Fields |
bool | waitingForConnection |
| Use this to see if it is waiting for a incoming connection.
|
bool | l2capConnectionClaimed |
| This is used by the service to know when to store the device information.
|
bool | sdpConnectionClaimed |
| This is used by the SPP library to claim the current SDP incoming request.
|
bool | rfcommConnectionClaimed |
| This is used by the SPP library to claim the current RFCOMM incoming request.
|
const char * | btdName |
| The name you wish to make the dongle show up as.
|
const char * | btdPin |
| The pin you wish to make the dongle use for authentication.
|
uint8_t | my_bdaddr [6] |
| The bluetooth dongles Bluetooth address.
|
uint16_t | hci_handle |
| HCI handle for the last connection.
|
uint8_t | disc_bdaddr [6] |
| Last incoming devices Bluetooth address.
|
char | remote_name [30] |
| First 30 chars of last remote name.
|
uint8_t | hci_version |
| The supported HCI Version read from the Bluetooth dongle.
|
bool | connectToWii |
| Used to only send the ACL data to the Wiimote.
|
bool | incomingWii |
| True if a Wiimote is connecting.
|
bool | pairWithWii |
| True when it should pair with a Wiimote.
|
bool | motionPlusInside |
| True if it's the new Wiimote with the Motion Plus Inside or a Wii U Pro Controller.
|
bool | wiiUProController |
| True if it's a Wii U Pro Controller.
|
bool | connectToHIDDevice |
| Used to only send the ACL data to the HID device.
|
bool | incomingHIDDevice |
| True if a HID device is connecting.
|
bool | pairWithHIDDevice |
| True when it should pair with a device like a mouse or keyboard.
|
Protected Member Functions |
void | PrintEndpointDescriptor (const USB_ENDPOINT_DESCRIPTOR *ep_ptr) |
| Used to print the USB Endpoint Descriptor.
|
Protected Attributes |
Usb * | pUsb |
| Pointer to USB class instance.
|
uint8_t | bAddress |
| Device address.
|
EpInfo | epInfo [BTD_MAX_ENDPOINTS] |
| Endpoint info structure.
|
uint8_t | bConfNum |
| Configuration number.
|
uint8_t | bNumEP |
| Total number of endpoints in the configuration.
|
uint32_t | qNextPollTime |
| Next poll time based on poll interval taken from the USB descriptor.
|
Static Protected Attributes |
static const uint8_t | BTD_CONTROL_PIPE = 0 |
| Bluetooth dongle control endpoint.
|
static const uint8_t | BTD_EVENT_PIPE = 1 |
| HCI event endpoint index.
|
static const uint8_t | BTD_DATAIN_PIPE = 2 |
| ACL In endpoint index.
|
static const uint8_t | BTD_DATAOUT_PIPE = 3 |
| ACL Out endpoint index.
|