PowerBlocks SDK
Loading...
Searching...
No Matches
bltootls.h
1
12
13
#pragma once
14
15
#include "FreeRTOS.h"
16
17
#include <stdbool.h>
18
19
#include "
powerblocks/core/bluetooth/hci.h
"
20
21
// Known Driver IDs part of PowerBlocks
22
#define BLUETOOTH_DRIVER_ID_INVALID 0
23
#define BLUETOOTH_DRIVER_ID_WIIMOTE 1
24
25
typedef
struct
{
26
uint16_t driver_id;
// Unique ID to the driver, that can be used to find it.
27
28
// Covered when a device appears to be discoverable,
29
// This can be used to filter out discovered devices
30
// Return true if the device applys to this driver
31
bool (*filter_device)(
const
hci_discovered_device_info_t
* device,
const
char
* device_name);
32
33
// Called once the filter passes, will attempt to add the device
34
// Return a non-null reference to the device if successful
35
void
* (*initialize_device)(
const
hci_discovered_device_info_t
* device);
36
37
// Called when the device is disconnected. Free up the driver
38
void (*free_device)(
void
* instance);
39
}
bluetooth_driver_t
;
40
41
typedef
struct
{
42
uint16_t driver_id;
43
void
* instance;
44
}
bluetooth_driver_instance_t
;
45
52
int
bltools_initialize();
53
62
extern
void
bltools_register_driver(
bluetooth_driver_t
driver);
63
69
extern
bluetooth_driver_t
* bltoots_find_driver_by_id(uint16_t driver_id);
70
80
extern
bluetooth_driver_t
* bltools_find_compatable_driver(
const
hci_discovered_device_info_t
* device,
const
char
* device_name);
81
93
extern
int
bltools_load_driver(
const
bluetooth_driver_t
* driver,
const
hci_discovered_device_info_t
* device);
94
105
extern
int
bltools_load_compatable_driver(
const
hci_discovered_device_info_t
* device,
const
char
* device_name);
106
124
extern
int
bltools_begin_automatic_discovery(TickType_t duration);
hci.h
Bluetooth HCI Driver.
bluetooth_driver_instance_t
Definition
bltootls.h:41
bluetooth_driver_t
Definition
bltootls.h:25
hci_discovered_device_info_t
Definition
hci.h:27
powerblocks
core
bluetooth
bltootls.h
Generated by
1.13.2