#include <BTD.h>
|
| BTD (USB *p) |
|
void | disconnect () |
|
int8_t | registerServiceClass (BluetoothService *pService) |
|
|
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 void | EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) |
|
|
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 | 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) |
|
The Bluetooth Dongle class will take care of all the USB communication and then pass the data to the BluetoothService classes.
Definition at line 153 of file BTD.h.
Constructor for the BTD class.
- Parameters
-
p | Pointer to USB class instance. |
Definition at line 27 of file BTD.cpp.
Disconnects both the L2CAP Channel and the HCI Connection for all Bluetooth services.
Definition at line 205 of file BTD.h.
void BTD::EndpointXtract |
( |
uint8_t |
conf, |
|
|
uint8_t |
iface, |
|
|
uint8_t |
alt, |
|
|
uint8_t |
proto, |
|
|
const USB_ENDPOINT_DESCRIPTOR * |
ep |
|
) |
| |
|
virtual |
UsbConfigXtracter implementation, used to extract endpoint information.
- Parameters
-
conf | Configuration value. |
iface | Interface number. |
alt | Alternate setting. |
proto | Interface Protocol. |
ep | Endpoint Descriptor. |
Implements UsbConfigXtracter.
Definition at line 252 of file BTD.cpp.
virtual uint8_t BTD::GetAddress |
( |
| ) |
|
|
inlinevirtual |
Get the device address.
- Returns
- The device address.
Implements USBDeviceConfig.
Definition at line 184 of file BTD.h.
void BTD::hci_accept_connection |
( |
| ) |
|
Accept the connection with the Bluetooth device.
Definition at line 814 of file BTD.cpp.
void BTD::hci_authentication_request |
( |
| ) |
|
Used to try to authenticate with the remote device.
Definition at line 969 of file BTD.cpp.
void BTD::HCI_Command |
( |
uint8_t * |
data, |
|
|
uint16_t |
nbytes |
|
) |
| |
Used to send a HCI Command.
- Parameters
-
data | Data to send. |
nbytes | Number of bytes to send. |
Definition at line 773 of file BTD.cpp.
void BTD::hci_connect |
( |
| ) |
|
Connect to a device.
Definition at line 878 of file BTD.cpp.
void BTD::hci_disconnect |
( |
uint16_t |
handle | ) |
|
Disconnect the HCI connection.
- Parameters
-
handle | The HCI Handle for the connection. |
Definition at line 978 of file BTD.cpp.
void BTD::hci_inquiry |
( |
| ) |
|
Start a HCI inquiry.
Definition at line 858 of file BTD.cpp.
void BTD::hci_inquiry_cancel |
( |
| ) |
|
Cancel a HCI inquiry.
Definition at line 871 of file BTD.cpp.
void BTD::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.
Definition at line 956 of file BTD.cpp.
void BTD::hci_pin_code_negative_request_reply |
( |
| ) |
|
Respons when no pin was set.
Definition at line 943 of file BTD.cpp.
void BTD::hci_pin_code_request_reply |
( |
| ) |
|
Respond with the pin for the connection. The pin is automatically set for the Wii library, but can be customized for the SPP library.
Definition at line 899 of file BTD.cpp.
void BTD::hci_read_bdaddr |
( |
| ) |
|
Read the Bluetooth address of the dongle.
Definition at line 802 of file BTD.cpp.
void BTD::hci_read_local_version_information |
( |
| ) |
|
Read the HCI Version of the Bluetooth dongle.
Definition at line 808 of file BTD.cpp.
void BTD::hci_remote_name |
( |
| ) |
|
Read the remote devices name.
Definition at line 829 of file BTD.cpp.
Reset the Bluetooth dongle.
Definition at line 777 of file BTD.cpp.
void BTD::hci_set_local_name |
( |
const char * |
name | ) |
|
Set the local name of the Bluetooth dongle.
- Parameters
-
Definition at line 847 of file BTD.cpp.
void BTD::hci_write_scan_disable |
( |
| ) |
|
Disable visibility to other Bluetooth devices.
Definition at line 795 of file BTD.cpp.
void BTD::hci_write_scan_enable |
( |
| ) |
|
Enable visibility to other Bluetooth devices.
Definition at line 784 of file BTD.cpp.
uint8_t BTD::Init |
( |
uint8_t |
parent, |
|
|
uint8_t |
port, |
|
|
bool |
lowspeed |
|
) |
| |
|
virtual |
Initialize the Bluetooth dongle.
- Parameters
-
parent | Hub number. |
port | Port number on the hub. |
lowspeed | Speed of the device. |
- Returns
- 0 on success.
Implements USBDeviceConfig.
Definition at line 45 of file BTD.cpp.
virtual bool BTD::isReady |
( |
| ) |
|
|
inlinevirtual |
Used to check if the dongle has been initialized.
- Returns
- True if it's ready.
Definition at line 189 of file BTD.h.
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.
- Parameters
-
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. |
Definition at line 1014 of file BTD.cpp.
void BTD::l2cap_config_request |
( |
uint16_t |
handle, |
|
|
uint8_t |
rxid, |
|
|
uint8_t * |
dcid |
|
) |
| |
L2CAP Config Request.
- Parameters
-
handle | HCI Handle. |
rxid | Identifier. |
dcid | Destination Channel Identifier. |
Definition at line 1069 of file BTD.cpp.
void BTD::l2cap_config_response |
( |
uint16_t |
handle, |
|
|
uint8_t |
rxid, |
|
|
uint8_t * |
scid |
|
) |
| |
L2CAP Config Response.
- Parameters
-
handle | HCI Handle. |
rxid | Identifier. |
scid | Source Channel Identifier. |
Definition at line 1085 of file BTD.cpp.
void BTD::l2cap_connection_request |
( |
uint16_t |
handle, |
|
|
uint8_t |
rxid, |
|
|
uint8_t * |
scid, |
|
|
uint16_t |
psm |
|
) |
| |
L2CAP Connection Request.
- Parameters
-
Definition at line 1041 of file BTD.cpp.
void BTD::l2cap_connection_response |
( |
uint16_t |
handle, |
|
|
uint8_t |
rxid, |
|
|
uint8_t * |
dcid, |
|
|
uint8_t * |
scid, |
|
|
uint8_t |
result |
|
) |
| |
L2CAP Connection Response.
- Parameters
-
handle | HCI handle. |
rxid | Identifier. |
dcid | Destination Channel Identifier. |
scid | Source Channel Identifier. |
result | Result - First send PENDING and then SUCCESSFUL. |
Definition at line 1053 of file BTD.cpp.
void BTD::l2cap_disconnection_request |
( |
uint16_t |
handle, |
|
|
uint8_t |
rxid, |
|
|
uint8_t * |
dcid, |
|
|
uint8_t * |
scid |
|
) |
| |
L2CAP Disconnection Request.
- Parameters
-
handle | HCI Handle. |
rxid | Identifier. |
dcid | Device Channel Identifier. |
scid | Source Channel Identifier. |
Definition at line 1103 of file BTD.cpp.
void BTD::l2cap_disconnection_response |
( |
uint16_t |
handle, |
|
|
uint8_t |
rxid, |
|
|
uint8_t * |
dcid, |
|
|
uint8_t * |
scid |
|
) |
| |
L2CAP Disconnection Response.
- Parameters
-
handle | HCI Handle. |
rxid | Identifier. |
dcid | Device Channel Identifier. |
scid | Source Channel Identifier. |
Definition at line 1114 of file BTD.cpp.
void BTD::l2cap_information_response |
( |
uint16_t |
handle, |
|
|
uint8_t |
rxid, |
|
|
uint8_t |
infoTypeLow, |
|
|
uint8_t |
infoTypeHigh |
|
) |
| |
L2CAP Information Response.
- Parameters
-
handle | HCI Handle. |
rxid | Identifier. |
infoTypeLow,infoTypeHigh | Infotype. |
Definition at line 1125 of file BTD.cpp.
Poll the USB Input endpoins and run the state machines.
- Returns
- 0 on success.
Implements USBDeviceConfig.
Definition at line 312 of file BTD.cpp.
Used to print the USB Endpoint Descriptor.
- Parameters
-
ep_ptr | Pointer to USB Endpoint Descriptor. |
Definition at line 283 of file BTD.cpp.
Register bluetooth dongle members/services.
- Parameters
-
- Returns
- The serice ID on succes or -1 on fail.
Definition at line 215 of file BTD.h.
Device address.
Definition at line 388 of file BTD.h.
Configuration number.
Definition at line 393 of file BTD.h.
Total number of endpoints in the configuration.
Definition at line 395 of file BTD.h.
const uint8_t BTD::BTD_CONTROL_PIPE = 0 |
|
staticprotected |
Bluetooth dongle control endpoint.
Definition at line 400 of file BTD.h.
const uint8_t BTD::BTD_DATAIN_PIPE = 2 |
|
staticprotected |
ACL In endpoint index.
Definition at line 404 of file BTD.h.
const uint8_t BTD::BTD_DATAOUT_PIPE = 3 |
|
staticprotected |
ACL Out endpoint index.
Definition at line 406 of file BTD.h.
const uint8_t BTD::BTD_EVENT_PIPE = 1 |
|
staticprotected |
HCI event endpoint index.
Definition at line 402 of file BTD.h.
The name you wish to make the dongle show up as. It is set automatically by the SPP library.
Definition at line 355 of file BTD.h.
The pin you wish to make the dongle use for authentication. It is set automatically by the SPP library.
Definition at line 357 of file BTD.h.
Used to only send the ACL data to the wiimote.
Definition at line 374 of file BTD.h.
uint8_t BTD::disc_bdaddr[6] |
Last incoming devices Bluetooth address.
Definition at line 364 of file BTD.h.
Endpoint info structure.
Definition at line 390 of file BTD.h.
HCI handle for the last connection.
Definition at line 362 of file BTD.h.
The supported HCI Version read from the Bluetooth dongle. Used by the PS3BT library to check the HCI Version of the Bluetooth dongle, it should be at least 3 to work properly with the library.
Definition at line 372 of file BTD.h.
True if a Wiimote is connecting.
Definition at line 376 of file BTD.h.
bool BTD::l2capConnectionClaimed |
This is used by the service to know when to store the device information.
Definition at line 348 of file BTD.h.
bool BTD::motionPlusInside |
True if it's the new Wiimote with the Motion Plus Inside or a Wii U Pro Controller.
Definition at line 380 of file BTD.h.
uint8_t BTD::my_bdaddr[6] |
The bluetooth dongles Bluetooth address.
Definition at line 360 of file BTD.h.
True when it should pair with the incoming Wiimote.
Definition at line 378 of file BTD.h.
Pointer to USB class instance.
Definition at line 386 of file BTD.h.
uint32_t BTD::qNextPollTime |
|
protected |
Next poll time based on poll interval taken from the USB descriptor.
Definition at line 397 of file BTD.h.
uint8_t BTD::remote_name[30] |
First 30 chars of last remote name.
Definition at line 366 of file BTD.h.
bool BTD::rfcommConnectionClaimed |
This is used by the SPP library to claim the current RFCOMM incoming request.
Definition at line 352 of file BTD.h.
bool BTD::sdpConnectionClaimed |
This is used by the SPP library to claim the current SDP incoming request.
Definition at line 350 of file BTD.h.
bool BTD::watingForConnection |
Use this to see if it is waiting for a incoming connection.
Definition at line 346 of file BTD.h.
bool BTD::wiiUProController |
True if it's a Wii U Pro Controller.
Definition at line 382 of file BTD.h.
The documentation for this class was generated from the following files: