|
KindleBT
Bluetooth functionality for Kindle 11th gen and up
|
KindleBT-specific data structures.
Data Structures | |
| struct | bleCallbackVars_t |
| Internal struct for certain Bluetooth conditions. More... | |
| struct | device_context_t |
| Internal struct for certain Bluetooth conditions during a BLE connection. More... | |
| struct | device_context_array_t |
| Internal dynamic array struct for devices context during a BLE connection. More... | |
Variables | |
| device_context_array_t | devices_context |
| Internal device_context_array_t. | |
| bleCallbackVars_t | callback_vars |
| Internal bleCallbackVars_t. | |
| uint32_t | gNo_svc |
| Internal number of GATT services, often paired with pGgatt_service. | |
| bleGattsService_t * | pGgatt_service |
| Internal reference to a GATT service. | |
| bleConnHandle | ble_conn_handle |
| Internal BLE connection handle. | |
| struct bleCallbackVars_t |
Internal struct for certain Bluetooth conditions.
Most of the Bluetooth operations are asynchronous, even if the API call returns immediately. This is because the API call return just indicates whether the request was made successfully or not. To know whether the Bluetooth hardware completed your request (or failed to), you'll need to sign up for different callbacks.
For some of these operations, KindleBT will set up its own callbacks and wait for the condition, this way we can provide a synchronous behaviour to a few of the API calls.
Definition at line 235 of file kindlebt_defines.h.
| Data Fields | ||
|---|---|---|
| bool | ble_registered | |
| bool | bt_enabled | |
| bool | gattc_connected | |
| bool | gattc_disconnected | |
| bool | gattc_discovered | |
| bool | got_gatt_db | |
| bool | mtu_set | |
| struct device_context_t |
Internal struct for certain Bluetooth conditions during a BLE connection.
Most of the Bluetooth operations are asynchronous, even if the API call returns immediately. This is because the API call return just indicates whether the request was made successfully or not. To know whether the Bluetooth hardware completed your request (or failed to), you'll need to sign up for the different callbacks.
For some of these operations, KindleBT will set up its own callbacks and wait for the condition, this way we can provide a synchronous behaviour to a few of the API calls.
Additionally, when we need to share data between a callback and the public API, we'll use this common context to pass the data around.
Definition at line 259 of file kindlebt_defines.h.
| Data Fields | ||
|---|---|---|
| uint8_t | address[MAC_ADDR_LEN] |
BLE connection address, used for context retrieval before a BLE connection |
| pthread_cond_t | cond |
Internal condition flag |
| bool | gattc_connected |
BLE connection has GATT Client has been established |
| bool | gattc_disconnected |
BLE connection has been disconnected |
| bool | gattc_discovered |
Services for the BLE connection have been discovered |
| uint32_t * | gattdb_count_out |
Paired with gattdb_out, the count for services will be written out |
| bleGattsService_t ** | gattdb_out |
Paired with gattdb_count_out, the services will be written out |
| bool | gattdb_retrieved |
GATT Services (DB) for the BLE connection have been retrieved. Paired with gattdb_count and gattdb_count_out. |
| bleConnHandle | handle |
BLE connection handle, used for context retrieval after a BLE connection |
| pthread_mutex_t | lock |
Internal lock |
| struct device_context_array_t |
Internal dynamic array struct for devices context during a BLE connection.
Since we may have multiple connections at once, we'll use this dynamic array to keep track of all connections, and remove them once the connection is closed.
Definition at line 292 of file kindlebt_defines.h.
| Data Fields | ||
|---|---|---|
| size_t | capacity | |
| size_t | count | |
| device_context_t * | items | |
|
extern |
Internal BLE connection handle.
Definition at line 18 of file kindlebt_callbacks.c.
|
extern |
Internal bleCallbackVars_t.
Definition at line 17 of file kindlebt_callbacks.c.
|
extern |
Internal device_context_array_t.
Definition at line 23 of file kindlebt_callbacks.c.
|
extern |
Internal number of GATT services, often paired with pGgatt_service.
Definition at line 20 of file kindlebt_callbacks.c.
|
extern |
Internal reference to a GATT service.
Definition at line 21 of file kindlebt_callbacks.c.