AIROC™ BTSDK v4.9 - Documentation | ||||
Bluetooth LE Controller Manager functions. More...
Functions | |
void | blecm_init (void) |
BLECM Initialization. More... | |
void | blecm_start (void) |
BLECM Start. More... | |
void | blecm_setFilterEnable (UINT8 enable) |
Enable/Disable CFA filter. More... | |
UINT8 | blecm_getFilterEnable (void) |
Reading current CFA filter value. More... | |
void | blecm_regAppEvtHandler (BLECM_APP_EVT_ENUM, BLECM_NO_PARAM_FUNC func) |
Register Event Handler. More... | |
void | blecm_regAclRxHandler (void *) |
Register for ACL Data receive. More... | |
void | blecm_regEncryptionChangedHandler (void *) |
Register for Encryption Changed event. More... | |
void | blecm_startTimerSource (INT32 id, BLECM_FUNC_WITH_PARAM appCb, UINT32 ticks) |
Starts a software timer. More... | |
void | blecm_stopTimerSource (INT32 id) |
Stopps a software timer. More... | |
void | blecm_refreshConnIdletimer (void) |
Restarts the connection idle timer. More... | |
void | blecm_startConnIdleTimer (BLEAPP_TIMER_CB cb) |
Starts the connection idle timer. More... | |
void | blecm_stopConnIdleTimer (void) |
Stops the connection idle timer. More... | |
void | blecm_enableRandomAddressResolution (void) |
Enable address resolution. More... | |
void | blecm_disableRandomAddressResolution (void) |
Disable address resolution. More... | |
void | blecm_storeRPA (UINT8 *rpa, INT32 idx) |
Stores random public address. More... | |
int | blecm_lookupAddress (INT32 type, UINT32 *rpa) |
Looks up the given random public address in the key store. More... | |
int | blecm_resolveRPA (INT32 type, UINT32 *rpa) |
Lookup and resolve address. More... | |
void | blecm_startScan (INT32 scanType, INT32 scanInterval, INT32 scanWindow, INT32 scanAdrType, INT32 scanFilterPolicy, INT32 filterDuplicates) |
Configure LE scan parameters and start LE scan. More... | |
void | blecm_setScanEnable (INT32 enableFlag, INT32 filterDuplicates) |
Configure controller for LE scan. More... | |
void | blecm_CreateConnection (INT32 scanInterval, INT32 scanWindow, INT32 initiatorFilterPolicy, INT32 peerAddressType, char *peerAddress, INT32 ownAddressType, INT32 connMinInterval, INT32 connMaxInterval, INT32 connLatency, INT32 supervisionTimeout, INT32 connMinEventLen, INT32 connMaxEventLen) |
Create a Link Layer connection to a connectable advertiser. More... | |
void | blecm_CreateConnectionCancel (void) |
Cancel attempt to create a Link Layer connection. More... | |
void | blecm_ConnectionUpdate (INT32 connHandle, INT32 connMinInterval, INT32 connMaxInterval, INT32 connLatency, INT32 supervisionTimeout, INT32 connMinEventLen, INT32 connMaxEventLen) |
Connection update request. More... | |
void | blecm_RegleAdvReportCb (BLECM_FUNC_WITH_PARAM cb) |
Register to receive advertisement report. More... | |
Bluetooth LE Controller Manager functions.
void blecm_ConnectionUpdate | ( | INT32 | connHandle, |
INT32 | connMinInterval, | ||
INT32 | connMaxInterval, | ||
INT32 | connLatency, | ||
INT32 | supervisionTimeout, | ||
INT32 | connMinEventLen, | ||
INT32 | connMaxEventLen | ||
) |
Connection update request.
This function issues HCI LE Connection Update Command. This command may be used in the client application if it needs to update connection parameters when connection is already established and required parameters are different than ones requested by the peripheral. When peripheral device requests some parameters using L2CAP message, stack automatically replies and sets controller appropriately and there is no need to use this function call.
connHandle | HCI handle of established connection |
connMinInterval | Minimum value for the connection event interval |
connMaxInterval | Maximum value for the connection event interval |
connLatency | Peripheral latency for the connection in number of connection events |
supervisionTimeout | Supervision timeout for the LE Link |
connMinEventLen | Minimum length of connection needed for this LE connection |
connMaxEventLen | Maximum length of connection needed for this LE connection |
void blecm_CreateConnection | ( | INT32 | scanInterval, |
INT32 | scanWindow, | ||
INT32 | initiatorFilterPolicy, | ||
INT32 | peerAddressType, | ||
char * | peerAddress, | ||
INT32 | ownAddressType, | ||
INT32 | connMinInterval, | ||
INT32 | connMaxInterval, | ||
INT32 | connLatency, | ||
INT32 | supervisionTimeout, | ||
INT32 | connMinEventLen, | ||
INT32 | connMaxEventLen | ||
) |
Create a Link Layer connection to a connectable advertiser.
This function issues HCI LE Create Connection Command. Typically this command will be used after client application receives advertisement from a peripheral device
LE_Scan_Interval | Time interval from when the Controller started its last LE scan until it begins the subsequent LE scan. |
LE_Scan_Window | The duration of the LE scan. |
Initiator_Filter_Policy | |
scanFilterPolicy |
|
Peer_Address_Type |
|
ownAddressType |
|
PeerAddress | Public Device Address or Random Device Address of the device to be connected |
connMinInterval | Minimum value for the connection event interval |
connMaxInterval | Maximum value for the connection event interval |
connLatency | Peripheral latency for the connection in number of connection events |
supervisionTimeout | Supervision timeout for the LE Link |
connMinEventLen | Minimum length of connection needed for this LE connection |
connMaxEventLen | Maximum length of connection needed for this LE connection |
void blecm_CreateConnectionCancel | ( | void | ) |
Cancel attempt to create a Link Layer connection.
This function may be issued by the client application to send HCI LE Create Connection Cancel Command.
void blecm_disableRandomAddressResolution | ( | void | ) |
Disable address resolution.
Disable peripheral address resolution.
void blecm_enableRandomAddressResolution | ( | void | ) |
Enable address resolution.
Enables peripheral address resolution.
UINT8 blecm_getFilterEnable | ( | void | ) |
Reading current CFA filter value.
This function returns current CFA filter state. When CFA filter is set, all HCI commands, events and data are passed to the CFA/profile/application. When CFA filter is not set, all HCI commands, events and data are passed to the transport (UART).
void blecm_init | ( | void | ) |
BLECM Initialization.
This function performs BLECM variables initialization. The function is called once during booting up. Application typically does not need to call this function.
int blecm_lookupAddress | ( | INT32 | type, |
UINT32 * | rpa | ||
) |
Looks up the given random public address in the key store.
Looks up the given random public address in the key store.
type | The type of the address. |
rpa | The Bluetooth address to look up for. |
void blecm_refreshConnIdletimer | ( | void | ) |
Restarts the connection idle timer.
When a connection is idle (withou data in either direction), the app may choose to disconnect after while of inactivity. This restarts the idle timer if enabled.
void blecm_regAclRxHandler | ( | void * | ) |
Register for ACL Data receive.
This function will register a ACL Rx data handler.
function | Callback function that is called whenever Rx data packet is received |
void blecm_regAppEvtHandler | ( | BLECM_APP_EVT_ENUM | , |
BLECM_NO_PARAM_FUNC | func | ||
) |
Register Event Handler.
This function should be used before blecm_start is called. This function register the start up function for app. Registered callback functions are called whenever related event happens.
event_number | BLECM_APP_EVT_ENUM
|
function | Callback function that is called whenever event happens |
void blecm_regEncryptionChangedHandler | ( | void * | ) |
Register for Encryption Changed event.
This function will register a callback handler for Encryption changed Event. Application can use this indication if it needs to send a packet over encrypted link.
function | Callback function that is called whenever encryption is changed. |
void blecm_RegleAdvReportCb | ( | BLECM_FUNC_WITH_PARAM | cb | ) |
Register to receive advertisement report.
Client application may use this function to receive notification when controller receives advertisement from the peripheral device.
function | Callback function that is called whenever advertisement is received. HCIULP_ADV_PACKET_REPORT_WDATA structure with advertisement data is passed as a parameter to this function. |
int blecm_resolveRPA | ( | INT32 | type, |
UINT32 * | rpa | ||
) |
Lookup and resolve address.
Looks up the given random public address in the key store and if not found, resolves it and adds to the key store.
type | The type of the address. |
rpa | The Bluetooth address to look up for. |
void blecm_setFilterEnable | ( | UINT8 | enable | ) |
Enable/Disable CFA filter.
This function enables/disables CFA filter. When CFA filter is set, all HCI commands, events and data are passed to the CFA/profile/application. When CFA filter is not set, all HCI commands, events and data are passed to the transport (UART).
enable | If 0, CFA filter is not set. if 1, CFA filter is set. |
void blecm_setScanEnable | ( | INT32 | enableFlag, |
INT32 | filterDuplicates | ||
) |
Configure controller for LE scan.
This function issues HCI LE Set Scan Enable Command. This command may be used to start and configure, or stop LE scans.
LE_Scan_Enable |
|
Filter | Duplicates
|
void blecm_start | ( | void | ) |
BLECM Start.
This function starts BLECM. The function is called once during booting up. Application typically does not need to call this function.
void blecm_startConnIdleTimer | ( | BLEAPP_TIMER_CB | cb | ) |
Starts the connection idle timer.
When a connection is idle (withou data in either direction), the app may choose to disconnect after while of inactivity. This starts the idle timer if enabled.
cb | The callback function that will be invoked when the timer expires. |
void blecm_startScan | ( | INT32 | scanType, |
INT32 | scanInterval, | ||
INT32 | scanWindow, | ||
INT32 | scanAdrType, | ||
INT32 | scanFilterPolicy, | ||
INT32 | filterDuplicates | ||
) |
Configure LE scan parameters and start LE scan.
This function will start LE Scan with the given parameters. The Scan will start shortly after but not immediately after this function call returns.
LE_Scan_Type |
|
LE_Scan_Interval | Time interval from when the Controller started its last LE scan until it begins the subsequent LE scan. |
LE_Scan_Window | The duration of the LE scan. |
Own_Address_Type |
|
scanFilterPolicy |
|
Filter | Duplicates
|
void blecm_startTimerSource | ( | INT32 | id, |
BLECM_FUNC_WITH_PARAM | appCb, | ||
UINT32 | ticks | ||
) |
Starts a software timer.
Starts a low level software timer.
id | ID of the software timer. |
appCb | Application callback function. |
ticks | The interval of the timer in OS ticks (12.5mS units). |
void blecm_stopConnIdleTimer | ( | void | ) |
Stops the connection idle timer.
When a connection is idle (withou data in either direction), the app may choose to disconnect after while of inactivity. This Stops the idle timer if enabled.
void blecm_stopTimerSource | ( | INT32 | id | ) |
Stopps a software timer.
Stops a low level software timer.
id | ID of the software timer. |
void blecm_storeRPA | ( | UINT8 * | rpa, |
INT32 | idx | ||
) |
Stores random public address.
Allows the app to provide a random public address for storage in internal IRK.
rpa | The random public address to store. |
idx | The index at which to store. |