![]() |
![]() |
|
TI BLE5-Stack API Documentation
9.14.00
|
This module implements BLEAppUtil functions. More...
Functions | |
| bStatus_t | BLEAppUtil_advStart (uint8 handle, const BLEAppUtil_AdvStart_t *advStartInfo) |
| Enable Advertising. This will attempt to enable advertising for a set identified by the handle. The advertising set must first be created with GapAdv_create. More... | |
| bStatus_t | BLEAppUtil_advStop (uint8 handle) |
| Disable an active advertising set. The set still exists and can be re-enabled with BLEAppUtil_advStart. More... | |
| bStatus_t | BLEAppUtil_cancelConnect (void) |
| Cancel the ongoing connection attempt. More... | |
| bStatus_t | BLEAppUtil_connect (BLEAppUtil_ConnectParams_t *connParams) |
| Initiate connection with the specified peer device. More... | |
| char * | BLEAppUtil_convertBdAddr2Str (uint8_t *pAddr) |
| Convert Bluetooth address to string. More... | |
| bStatus_t | BLEAppUtil_disconnect (uint16 connHandle) |
| Terminate a link connection. Corresponding Events: GAP_LINK_TERMINATED_EVENT of type gapTerminateLinkEvent_t. More... | |
| GAP_Addr_Modes_t | BLEAppUtil_getDevAddrMode (void) |
| Returns the device address mode. More... | |
| BLEAppUtil_entityId_t | BLEAppUtil_getSelfEntity (void) |
| Returns the self entity id needed when sending BLE stack commands. More... | |
| void | BLEAppUtil_init (ErrorHandler_t errorHandler, StackInitDone_t initDoneHandler, BLEAppUtil_GeneralParams_t *initGeneralParams, BLEAppUtil_PeriCentParams_t *initPeriCentParams) |
| Initiate the application (queue, event, stack) More... | |
| bStatus_t | BLEAppUtil_initAdvSet (uint8 *advHandle, const BLEAppUtil_AdvInit_t *advInitInfo) |
| Initialize and starts advertise set (legacy or extended) More... | |
| bStatus_t | BLEAppUtil_invokeFunction (InvokeFromBLEAppUtilContext_t callback, char *pData) |
| This function receives a callback and data and switches the context in order to call the callback from the BLE App Util module context. More... | |
| bStatus_t | BLEAppUtil_invokeFunctionNoData (InvokeFromBLEAppUtilContext_t callback) |
| This function receives a callback and data and switches the context in order to call the callback from the BLE App Util module context. More... | |
| bool | BLEAppUtil_isbufset (uint8_t *buf, uint8_t val, uint8_t len) |
| bStatus_t | BLEAppUtil_paramUpdateReq (gapUpdateLinkParamReq_t *pReq) |
| Update the link parameters to a Central or Peripheral device. As long as LL connection updates are supported on the own device (which is the case by default), an LL Connection Update procedure will be attempted. If this fails, the stack will automatically attempt an L2CAP parameter update request. More... | |
| bStatus_t | BLEAppUtil_paramUpdateRsp (gapUpdateLinkParamReqEvent_t *pReq, uint8 accept) |
| This function prepares an answer for connection parameters changing request, according to the decision made by the application, And then call for gap function with the response. More... | |
| bStatus_t | BLEAppUtil_registerCMCBs (void) |
| bStatus_t | BLEAppUtil_registerCMSCBs (void) |
| bStatus_t | BLEAppUtil_registerCNCB (void) |
| bStatus_t | BLEAppUtil_registerConnNotifHandler (uint16_t connHandle, GAP_CB_Event_e eventType) |
| Register to receive a connection events notifications. It is only possible to register for one connection handle or for all connection handles. It it possible to register to certain type of connection event. More... | |
| bStatus_t | BLEAppUtil_registerCsCB (void) |
| bStatus_t | BLEAppUtil_registerEventHandler (BLEAppUtil_EventHandler_t *eventHandler) |
| Register application event handler. More... | |
| bStatus_t | BLEAppUtil_registerSNCB (void) |
| bStatus_t | BLEAppUtil_scanInit (const BLEAppUtil_ScanInit_t *scanInitInfo) |
| Set initial scan and PHY parameters. More... | |
| bStatus_t | BLEAppUtil_scanStart (const BLEAppUtil_ScanStart_t *scanStartInfo) |
| Start scanning. If duration is zero period shall be ignored and the scanner will continue scanning until BLEAppUtil_scanStop is called. If both period is zero and duration is non-zero, the scanner will scan once until duration has expired or BLEAppUtil_scanStop is called. If both the duration and period are non-zero, the scanner will continue canning periodically until BLEAppUtil_scanStop is called. More... | |
| bStatus_t | BLEAppUtil_scanStop (void) |
| Stop currently running scanning operation. More... | |
| bStatus_t | BLEAppUtil_setConnParams (const BLEAppUtil_ConnParams_t *connParams) |
| Set parameters dependent on PHY. Note that if phy contains more than one PHY, the same parameter of those PHYs will be set with the same value. More... | |
| bStatus_t | BLEAppUtil_setConnPhy (BLEAppUtil_ConnPhyParams_t *phyParams) |
| Set Phy Preference on the current connection. Apply the same value for RX and TX. For more information, see the LE 2M PHY section in the User's Guide: All the documentation and collateral applicable can be found on TI Developer Zone - https://dev.ti.com/. More... | |
| bStatus_t | BLEAppUtil_unRegisterConnNotifHandler (void) |
| Unregister a connection event callback. More... | |
| bStatus_t | BLEAppUtil_unRegisterEventHandler (BLEAppUtil_EventHandler_t *eventHandler) |
| Un-register application event handler. More... | |
This module implements BLEAppUtil functions.
| bStatus_t BLEAppUtil_advStart | ( | uint8 | handle, |
| const BLEAppUtil_AdvStart_t * | advStartInfo | ||
| ) |
Enable Advertising. This will attempt to enable advertising for a set identified by the handle. The advertising set must first be created with GapAdv_create.
Corresponding Events: BLEAPPUTIL_ADV_START_AFTER_ENABLE after advertising is enabled BLEAPPUTIL_ADV_START after each advertising set starts BLEAPPUTIL_ADV_END after each advertising set ends BLEAPPUTIL_SCAN_REQ_RECEIVED after received scan requests
| handle | - Handle of advertising set to enable |
| advInitInfo | - Initial advertising parameters according to BLEAppUtil_AdvStart_t |
| bStatus_t BLEAppUtil_advStop | ( | uint8 | handle | ) |
Disable an active advertising set. The set still exists and can be re-enabled with BLEAppUtil_advStart.
Corresponding Events: BLEAPPUTIL_ADV_END_AFTER_DISABLE after advertising is disabled
| handle | - Handle of advertising set to disable |
| bStatus_t BLEAppUtil_cancelConnect | ( | void | ) |
| bStatus_t BLEAppUtil_connect | ( | BLEAppUtil_ConnectParams_t * | connParams | ) |
Initiate connection with the specified peer device.
| connParams | - Peer device parameters |
| char* BLEAppUtil_convertBdAddr2Str | ( | uint8_t * | pAddr | ) |
Convert Bluetooth address to string.
| pAddr | - BD address |
| bStatus_t BLEAppUtil_disconnect | ( | uint16 | connHandle | ) |
Terminate a link connection. Corresponding Events: GAP_LINK_TERMINATED_EVENT of type gapTerminateLinkEvent_t.
| connHandle | - connection handle of link to terminate or LINKDB_CONNHANDLE_ALL |
| GAP_Addr_Modes_t BLEAppUtil_getDevAddrMode | ( | void | ) |
Returns the device address mode.
| BLEAppUtil_entityId_t BLEAppUtil_getSelfEntity | ( | void | ) |
Returns the self entity id needed when sending BLE stack commands.
| void BLEAppUtil_init | ( | ErrorHandler_t | errorHandler, |
| StackInitDone_t | initDoneHandler, | ||
| BLEAppUtil_GeneralParams_t * | initGeneralParams, | ||
| BLEAppUtil_PeriCentParams_t * | initPeriCentParams | ||
| ) |
Initiate the application (queue, event, stack)
| errorHandler | - Error handler to register |
| initDoneHandler | - This handler will be called when the device initialization is done |
| initGeneralParams | - General parameters needed to initialize the BLE stack |
| initPeriCentParams | - Connection related parameters needed to initialize the BLE stack |
| bStatus_t BLEAppUtil_initAdvSet | ( | uint8 * | advHandle, |
| const BLEAppUtil_AdvInit_t * | advInitInfo | ||
| ) |
Initialize and starts advertise set (legacy or extended)
| advHandle | - Return the created advertising handle |
| advInitInfo | - Advertise set (legacy or extended) Initialization parameters |
| bStatus_t BLEAppUtil_invokeFunction | ( | InvokeFromBLEAppUtilContext_t | callback, |
| char * | pData | ||
| ) |
This function receives a callback and data and switches the context in order to call the callback from the BLE App Util module context.
| callback | - The callback to invoke from the BLE App Util module context |
| pData | - The data to provide the callback |
| bStatus_t BLEAppUtil_invokeFunctionNoData | ( | InvokeFromBLEAppUtilContext_t | callback | ) |
This function receives a callback and data and switches the context in order to call the callback from the BLE App Util module context.
| callback | - The callback to invoke from the BLE App Util module context |
| bool BLEAppUtil_isbufset | ( | uint8_t * | buf, |
| uint8_t | val, | ||
| uint8_t | len | ||
| ) |
| bStatus_t BLEAppUtil_paramUpdateReq | ( | gapUpdateLinkParamReq_t * | pReq | ) |
Update the link parameters to a Central or Peripheral device. As long as LL connection updates are supported on the own device (which is the case by default), an LL Connection Update procedure will be attempted. If this fails, the stack will automatically attempt an L2CAP parameter update request.
| pReq | - Pointer to Link Request parameters |
| bStatus_t BLEAppUtil_paramUpdateRsp | ( | gapUpdateLinkParamReqEvent_t * | pReq, |
| uint8 | accept | ||
| ) |
This function prepares an answer for connection parameters changing request, according to the decision made by the application, And then call for gap function with the response.
| pReq | - Pointer to central request |
| accept | - Application decision. |
| bStatus_t BLEAppUtil_registerCMCBs | ( | void | ) |
| bStatus_t BLEAppUtil_registerCMSCBs | ( | void | ) |
| bStatus_t BLEAppUtil_registerCNCB | ( | void | ) |
| bStatus_t BLEAppUtil_registerConnNotifHandler | ( | uint16_t | connHandle, |
| GAP_CB_Event_e | eventType | ||
| ) |
Register to receive a connection events notifications. It is only possible to register for one connection handle or for all connection handles. It it possible to register to certain type of connection event.
If a specific connection handle is registered using this function, the function should be called to register for each reconnection. It is not retained across a disconnect / reconnect.
| connHandle | - if LINKDB_CONNHANDLE_ALL, apply to all connections. else, apply only for a specific connection. |
| eventType | - what type of event need to be received. |
| bStatus_t BLEAppUtil_registerCsCB | ( | void | ) |
| bStatus_t BLEAppUtil_registerEventHandler | ( | BLEAppUtil_EventHandler_t * | eventHandler | ) |
Register application event handler.
| eventHandler | - The handler to register |
| bStatus_t BLEAppUtil_registerSNCB | ( | void | ) |
| bStatus_t BLEAppUtil_scanInit | ( | const BLEAppUtil_ScanInit_t * | scanInitInfo | ) |
Set initial scan and PHY parameters.
| scanInitInfo | - The parameters to set |
| bStatus_t BLEAppUtil_scanStart | ( | const BLEAppUtil_ScanStart_t * | scanStartInfo | ) |
Start scanning. If duration is zero period shall be ignored and the scanner will continue scanning until BLEAppUtil_scanStop is called. If both period is zero and duration is non-zero, the scanner will scan once until duration has expired or BLEAppUtil_scanStop is called. If both the duration and period are non-zero, the scanner will continue canning periodically until BLEAppUtil_scanStop is called.
| bStatus_t BLEAppUtil_scanStop | ( | void | ) |
| bStatus_t BLEAppUtil_setConnParams | ( | const BLEAppUtil_ConnParams_t * | connParams | ) |
Set parameters dependent on PHY. Note that if phy contains more than one PHY, the same parameter of those PHYs will be set with the same value.
| connParams | - connection parameters to set |
| bStatus_t BLEAppUtil_setConnPhy | ( | BLEAppUtil_ConnPhyParams_t * | phyParams | ) |
Set Phy Preference on the current connection. Apply the same value for RX and TX. For more information, see the LE 2M PHY section in the User's Guide: All the documentation and collateral applicable can be found on TI Developer Zone - https://dev.ti.com/.
| phyParams | - Phy Preference on the current connection. |
| bStatus_t BLEAppUtil_unRegisterConnNotifHandler | ( | void | ) |
Unregister a connection event callback.
| bStatus_t BLEAppUtil_unRegisterEventHandler | ( | BLEAppUtil_EventHandler_t * | eventHandler | ) |
Un-register application event handler.
| eventHandler | - The handler to un-register |