|
| int | hci_initialize (const char *device) |
| | Initializes the HCI interface.
|
| |
| void | hci_close () |
| | Closes the HCI driver.
|
| |
| int | hci_reset () |
| | Resets the HCI Interface.
|
| |
| int | hci_begin_discovery (uint32_t lap, uint8_t length, uint8_t responses, hci_discovered_device_handler on_discovered, hci_discovery_complete_handler on_complete, void *user_data) |
| | Begins looking for bluetooth devices.
|
| |
| int | hci_cancel_discovery () |
| | Stops a discovery session.
|
| |
| int | hci_get_remote_name (const hci_discovered_device_info_t *device, uint8_t *name) |
| | Returns the remote name of a device.
|
| |
| int | hci_create_connection (const hci_discovered_device_info_t *device, uint16_t *handle) |
| | Creates a connection to a device for you to use.
|
| |
|
hci_acl_packet_t hci_acl_packet_out | ALIGN (32) MEM2 |
| |
| int | hci_send_acl (uint16_t handle, hci_acl_packet_boundary_flag_t pb, hci_acl_packet_broadcast_flag_t bc, uint16_t length) |
| | Sends a ACL Packet.
|
| |
| int | hci_receive_acl_async (hci_acl_packet_t *acl_buffer, uint8_t *ipc_buffer, ipc_async_handler_t handler, void *params) |
| | Receives a ACL Packet Asynchronously.
|
| |
| void | hci_decode_received_acl (uint16_t *handle, hci_acl_packet_boundary_flag_t *pb, hci_acl_packet_broadcast_flag_t *bc, uint16_t *length, const hci_acl_packet_t *acl_buffer) |
| | Decodes a received ACL packet.
|
| |
Bluetooth HCI Driver.
This driver talks to USB HCI devices. Those are "Host Controller Interfaces" for communicating with bluetooth devices over USB
This is done as Wiimotes are connected through the Wii's internal bluetooth dongle.
- Author
- Samuel Fitzsimons (rainbain)
- Date
- 2025
Begins looking for bluetooth devices.
Will begin looking for bluetooth devices.
On emulator, dolphin will report wiimote devices 1 at a time.
Only 1 thing can be running discovery at a time. Calling this while a discovery session is already running will return an error.
You generally need to wait for the inquiry to end before doing anything. ACL packets are fine though.
Handlers called from the HCI Task. Please do not call HCI function from the HCI task.
- Parameters
-
| lap | Access code for what devices to discover. Usually HCI_INQUIRY_MODE_GENERAL_ACCESS |
| length | Time to discover devices for. In units of 1.28 seconds. 0x01 – 0x30, Dolphin always completes instantly |
| responses | Max devices discovered. Or 0 for infinite up until timeout. |
| on_discovered | Called when a device is discovered. May be NOT be NULL |
| on_complete | Called when the discovery session ends. May be NULL |
| user_data | Pointer passed to handlers. May be NULL. |
- Returns
- Negative if Error
| int hci_receive_acl_async |
( |
hci_acl_packet_t * | acl_buffer, |
|
|
uint8_t * | ipc_buffer, |
|
|
ipc_async_handler_t | handler, |
|
|
void * | params ) |
|
extern |
Receives a ACL Packet Asynchronously.
Unlike send, this is done asynchronously, and returns early, so that you can double buffer and make sure to never miss an ACL packet. Multiplexing / Reassembly / Channels are handled by L2CAP that makes these
These parameters will be set into hci_acl_packet_in. Your data and length is available in there.
Also must be provided is a buffer size HCI_ACL_RECEIVE_IPC_BUFFER_SIZE for storing the IPC data. So that it can store the message in the mean time until the callback is called.
- Parameters
-
| buffer | ACL packet buffer to receive into. |
| ipc_buffer | Data buffer for the IPC data. Needs to be kept around until the callback is called. Needs to be 32 byte aligned. |
| handler | Called when data is received |
| params | Pointer passed to handler |
- Returns
- Negative if Error