TI BLE5-Stack API Documentation  9.14.00
bleapputil_api.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3 @file bleapputil_api.h
4 
5 @brief This file contains the bleapputil_api for use
6 with the Bluetooth Low Energy Protocol Stack.
7 
8 Group: WCS, BTS
9 $Target Device: DEVICES $
10 
11 ******************************************************************************
12 $License: BSD3 2022 $
13 ******************************************************************************
14 $Release Name: PACKAGE NAME $
15 $Release Date: PACKAGE RELEASE DATE $
16 *****************************************************************************/
27 #ifndef BLEAPPUTIL_API_H
28 #define BLEAPPUTIL_API_H
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34 
35 
36 /*********************************************************************
37  * INCLUDES
38  */
41 #include "ti/ble/stack_util/icall/app/icall_ble_api.h"
42 #include <ti/display/Display.h>
43 
44 /*********************************************************************
45  * MACROS
46  */
47 
49 // Size of string-converted device address ("0xXXXXXXXXXXXX")
50 #define BLEAPPUTIL_ADDR_STR_SIZE 15
51 
53 #define BLEAppUtil_malloc ICall_malloc
54 #define BLEAppUtil_free ICall_free
55 #define BLEAppUtil_freeMsg ICall_freeMsg
56 /*********************************************************************
57  * TYPEDEFS
58  */
59 
66 // no description for ICall_Hdr in the api, so the user won't be able to see ICall_Hdr struct members inside the api.
67 // the definition of the struct is in: icall_ble_apimsg.h
68 typedef ICall_Hdr BLEAppUtil_msgHdr_t;
69 
71 // need to be internal
72 typedef ICall_EntityID BLEAppUtil_entityId_t;
74 
76 typedef uint8_t BLEAppUtil_BDaddr[B_ADDR_LEN];
77 
78 // Handlers types
79 
88 typedef void (*EventHandler_t)(uint32 event, BLEAppUtil_msgHdr_t *pMsgData);
89 
91 // not being used for now
92 typedef void (*ErrorHandler_t)(int32 errorCode , void* pInfo);
94 
103 typedef void (*StackInitDone_t)(gapDeviceInitDoneEvent_t *deviceInitDoneData);
104 
113 typedef void (*InvokeFromBLEAppUtilContext_t)(char *pData);
114 
117 /*********************************************************************
118  * Enumerators
119  */
120 
129 {
150 
153 {
169 
172 {
177 
180 {
190 
191 
194 {
205 
208 {
224 
227 {
236 
239 {
240  BLEAPPUTIL_ATT_ERROR_RSP = (uint32_t)BV(0),
249  BLEAPPUTIL_ATT_READ_REQ = (uint32_t)BV(9),
250  BLEAPPUTIL_ATT_READ_RSP = (uint32_t)BV(10),
257  BLEAPPUTIL_ATT_WRITE_REQ = (uint32_t)BV(17),
258  BLEAPPUTIL_ATT_WRITE_RSP = (uint32_t)BV(18),
267  BLEAPPUTIL_ATT_WRITE_CMD = (uint32_t)BV(27),
273 
276 {
284 
286 
289 {
301 
304 {
308 
311 {
312  BLEAPPUTIL_CS_EVENT_CODE = (uint32_t)BV(0),
315 
318 {
323 
326 {
332 
333 
334 typedef enum
335 {
350 
352 typedef enum
353 {
354  APP_CAP_COMMON = 0x00000000,
355  APP_CAP_CM = 0x00000001,
356  APP_CAP_CENTRAL = 0x00000400,
357  APP_CAP_PERIPHERAL = 0x00000800,
358  APP_CAP_HANDOVER = 0x00001000,
359  APP_CAP_CONNECTION = 0x00002000,
360  APP_CAP_PAIRING = 0x00004000,
361  APP_CAP_L2CAPCOC = 0x00008000,
362  APP_CAP_CS = 0x00010000,
363  APP_CAP_GATT = 0x00020000,
364  APP_CAP_CA_SERVER = 0x00040000,
365  APP_CAP_RREQ = 0x00080000,
366  APP_CAP_RRSP = 0x00100000,
368 
371 /*********************************************************************
372  * Structures
373  */
374 
381 typedef struct {
386  uint8_t evtType;
388  uint8_t addrType;
390  uint8_t addr[B_ADDR_LEN];
392  uint8_t primPhy;
394  uint8_t secPhy;
396  uint8_t advSid;
398  int8_t txPower;
400  int8_t rssi;
402  uint8_t directAddrType;
404  uint8_t directAddr[B_ADDR_LEN];
406  uint16_t periodicAdvInt;
408  uint16_t dataLen;
410  uint8_t *pData;
412 
413 typedef union
414 {
415  uint8_t advHandle;
419 } GapAdv_data_t;
420 
421 // Structures/unions data types declarations
422 typedef union
423 {
427 
433 typedef struct
434 {
435  uint32_t event;
437  uint32_t *arg;
439 
445 typedef struct
446 {
447  uint32_t event;
449  uint32_t *arg;
451 
455 typedef struct
456 {
457  uint16_t connHandle;
458  uint32_t state;
459  uint8_t status;
461 
467 typedef struct
468 {
469  BLEAppUtil_BDaddr deviceAddr;
470  uint16_t connHandle;
471  uint8_t uiInputs;
472  uint8_t uiOutputs;
473 
479  uint32_t numComparison;
481 
488 typedef struct
489 {
490  uint16_t advDataLen;
491  uint8_t *advData;
492  uint16_t scanRespDataLen;
493  uint8_t *scanRespData;
496 
503 typedef struct
504 {
506 
514 
521 typedef struct
522 {
523  uint8_t primPhy;
525  uint16_t scanInterval;
526  uint16_t scanWindow;
527  uint16_t advReportFields;
528  uint8_t scanPhys;
529  uint8_t fltPolicy;
530  uint16_t fltPduType;
531  int8_t fltMinRssi;
532  uint8_t fltDiscMode;
533  uint8_t fltDup;
535 
542 typedef struct
543 {
547  uint16_t scanPeriod;
553  uint16_t scanDuration;
559  uint8_t maxNumReport;
561 
566 typedef struct
567 {
568  uint8_t initPhys;
569  uint16_t scanInterval;
570  uint16_t scanWindow;
571  uint16_t minConnInterval;
572  uint16_t maxConnInterval;
573  uint16_t connLatency;
574  uint16_t supTimeout;
576 
581 typedef struct
582 {
583  uint8_t peerAddrType;
584  BLEAppUtil_BDaddr pPeerAddress;
585  uint8_t phys;
586 
593  uint16_t timeout;
595 
600 typedef struct
601 {
602  uint16 connHandle;
603  uint8 allPhys;
604  uint8 txPhy;
605  uint8 rxPhy;
606  uint16 phyOpts;
608 
615 typedef struct
616 {
617  // Task related parameters - BLEAppUtil task priority. Higher values represent higher priorities
619  size_t taskStackSize;
620 
621  // BLE stack related parameters
622  BLEAppUtil_Profile_Roles_e profileRole;
623 
624  // GAP GATT Server (GGS) Parameters
625  uint8_t *deviceNameAtt;
626  uint16_t appearanceAtt;
628 
629  // Device related parameters
643 
650 typedef struct
651 {
655 
657 // not used for now
661 typedef union
662 {
663  gapEstLinkReqEvent_t estLinkReqEvent;
664  gapTerminateLinkEvent_t termLinkEvent;
665  gapConnCancelledEvent_t gapConnCancelledEvent;
666  gapLinkUpdateEvent_t linkUpdateEvent;
667  gapUpdateLinkParamReqEvent_t paramUpdateReqEvent;
668  gapSignUpdateEvent_t signUpdateEvent;
669  gapAuthCompleteEvent_t authCompleteEvent;
670  gapPasskeyNeededEvent_t passkeyIsNeededEvent;
671  gapPeripheralSecurityReqEvent_t peripheralSecurityReqEvent;
672  gapBondCompleteEvent_t bondCompleteEvent;
673  gapPairingReqEvent_t pairingReqEvent;
674  gapBondLostEvent_t bondLostEvent;
675  Gap_ConnEventRpt_t connEventRpt;
676  gapAuthParams_t authParams;
677  gapPairingReq_t pairingReq;
678  gapUpdateLinkParamReq_t paramUpdateReq;
679  gapUpdateLinkParamReqReply_t paramUpdateReqReplay;
680 } BLEAppUtil_gapConnData_t;
681 
685 typedef struct
686 {
687  union
688  {
689  gapEventHdr_t gapConnData;
690  BLEAppUtil_AdvEventData_t gapAdvData;
691  BLEAppUtil_ScanEventData_t gapScanData;
692  gapEventHdr_t gapPeriodicData;
693  gattMsgEvent_t gattData;
694  BLEAppUtil_PasscodeData_t passcodeData;
695  BLEAppUtil_PairStateData_t pairStateData;
696  l2capDataEvent_t l2capData;
697  l2capSignalEvent_t l2capSignalData;
698  hciDataEvent_t hciData;
699  ICall_HciExtEvt hciGapData;
700  ICall_HciExtEvt hciSMPData;
701  ICall_HciExtEvt hciSMPMetaData;
702  };
703 } BLEAppUtil_msgData_t;
704 
705 /*
706 * @brief Connection Monitor Serving Update event
707 */
708 typedef struct
709 {
710  uint16_t connHandle;
711  cmConnUpdateEvt_t connUpdateEvt;
712 } BLEAppUtil_cmConnUpdateEvt_t;
713 
715 
722 typedef struct
723 {
724  BLEAppUtil_eventHandlerType_e handlerType;
726  uint32_t eventMask;
728 
731 /*********************************************************************
732  * GLOBAL VARIABLES
733  */
734 
735 /*********************************************************************
736  * FUNCTIONS
737  */
738 
758 void BLEAppUtil_init(ErrorHandler_t errorHandler, StackInitDone_t initDoneHandler,
759  BLEAppUtil_GeneralParams_t *initGeneralParams,
760  BLEAppUtil_PeriCentParams_t *initPeriCentParams);
761 
768 BLEAppUtil_entityId_t BLEAppUtil_getSelfEntity(void);
769 
770 // Register function for BLE stack events
771 
780 
789 
790 // Profiles/Services APIs
791 
803 
816 
817 // Adv functions
818 
828 bStatus_t BLEAppUtil_initAdvSet(uint8 *advHandle, const BLEAppUtil_AdvInit_t *advInitInfo);
829 
849 bStatus_t BLEAppUtil_advStart(uint8 handle, const BLEAppUtil_AdvStart_t *advStartInfo);
850 
865 bStatus_t BLEAppUtil_advStop(uint8 handle);
866 
867 // Scan functions
868 
880 
899 
909 
910 // Connection initiation functions
911 
922 
935 
945 
946 // Connection general functions
947 
959 bStatus_t BLEAppUtil_disconnect(uint16 connHandle);
960 
968 
979 
980 // Connection Event notifications
981 
1003 bStatus_t BLEAppUtil_registerConnNotifHandler(uint16_t connHandle, GAP_CB_Event_e eventType);
1004 
1015 
1016 // Connection parameter update related functions
1017 
1033 
1046 
1054 char *BLEAppUtil_convertBdAddr2Str(uint8_t *pAddr);
1055 
1056 /*********************************************************************
1057  * @fn BLEAppUtil_registerSNCB
1058  *
1059  * @brief Register the serving node callback
1060  *
1061  * @param None
1062  *
1063  * @return SUCCESS, FAILURE
1064  */
1066 
1067 /*********************************************************************
1068  * @fn BLEAppUtil_registerCNCB
1069  *
1070  * @brief Register the serving node callback
1071  *
1072  * @param None
1073  *
1074  * @return SUCCESS, FAILURE
1075  */
1077 
1078 /*********************************************************************
1079  * @fn BLEAppUtil_registerCsCB
1080  *
1081  * @brief Register the ChannelSounding callback
1082  *
1083  * @param None
1084  *
1085  * @return SUCCESS, FAILURE
1086  */
1088 
1089 /*********************************************************************
1090  * @fn BLEAppUtil_registerCMSCBs
1091  *
1092  * @brief Register to connection monitor callbacks Connection Monitor
1093  * Serving.
1094  * @param None
1095  *
1096  * @return SUCCESS, FAILURE
1097  */
1099 
1100 /*********************************************************************
1101  * @fn BLEAppUtil_registerCMCBs
1102  *
1103  * @return SUCCESS, FAILURE
1104  */
1106 
1107 /*********************************************************************
1108  * @fn BLEAppUtil_registerCMCBs
1109  *
1110  * @brief Register to connection monitor callbacks Connection Monitor
1111  * Role.
1112  * @param None
1113  *
1114  * @return SUCCESS, FAILURE
1115  */
1117 
1118 /*********************************************************************
1119  * @fn BLEAppUtil_isbufset
1120  *
1121  * @brief Is all of the array elements set to a value
1122  *
1123  * @param buf - buffer to check
1124  * @param val - value to check each array element for
1125  * @param len - length to check
1126  *
1127  * @return TRUE if all "val"
1128  * FALSE otherwise
1129  */
1130 bool BLEAppUtil_isbufset(uint8_t *buf, uint8_t val, uint8_t len);
1131 
1134 /*********************************************************************
1135 *********************************************************************/
1136 
1137 #ifdef __cplusplus
1138 }
1139 #endif
1140 
1141 #endif /* BLEAPPUTIL_API_H */
1142 
bStatus_t BLEAppUtil_registerCsCB(void)
uint32_t event
see BLEAppUtil_GAPScanEventMaskFlags_e
Definition: bleapputil_api.h:447
Definition: bleapputil_api.h:361
GAP Connection type.
Definition: bleapputil_api.h:130
uint32_t * arg
custom application argument that can be return through this callback
Definition: bleapputil_api.h:449
GATT type.
Definition: bleapputil_api.h:135
Definition: bleapputil_api.h:360
ICall_Hdr BLEAppUtil_msgHdr_t
Definition: bleapputil_api.h:68
Passkey needed event.
Definition: bleapputil_api.h:162
ATT_ERROR_RSP
Definition: bleapputil_api.h:240
uint8_t * pData
Pointer to advertising or scan response data.
Definition: bleapputil_api.h:410
BLEAppUtil_HciEventMaskFlags_e
HCI event mask.
Definition: bleapputil_api.h:288
GAP_SCAN_PERIODIC_ADV_REPORT_EVENT
Definition: bleapputil_api.h:222
Channel Sounding Application event code.
Definition: bleapputil_api.h:313
Definition: bleapputil_api.h:364
Definition: bleapputil_api.h:337
BLEAppUtil_CmEventMaskFlags_e
Connectino Monitor event mask.
Definition: bleapputil_api.h:317
GAP_SCAN_CREATE_SYNC_EVENT
Definition: bleapputil_api.h:212
bStatus_t BLEAppUtil_initAdvSet(uint8 *advHandle, const BLEAppUtil_AdvInit_t *advInitInfo)
Initialize and starts advertise set (legacy or extended)
GapAdv_truncData_t pTruncData
Definition: bleapputil_api.h:418
uint8_t * scanRespData
pointer to array containing the scan response data
Definition: bleapputil_api.h:493
ATT_FIND_INFO_RSP
Definition: bleapputil_api.h:244
Definition: bleapputil_api.h:356
Bond complete event.
Definition: bleapputil_api.h:164
ATT_PREPARE_WRITE_REQ
Definition: bleapputil_api.h:259
Definition: gap_initiator.h:192
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 informatio...
BLEAppUtil_HandoverEventMaskFlags_e
Handover event mask.
Definition: bleapputil_api.h:303
Gets GapAdv_setTerm_t using pBuf. pBuf should be cast to GapAdv_setTerm_t. Sent when an advertisement...
Definition: bleapputil_api.h:185
Definition: gap.h:1196
ATT_FIND_INFO_REQ
Definition: bleapputil_api.h:243
GAP_EVT_INSUFFICIENT_MEMORY
Definition: bleapputil_api.h:203
void(* InvokeFromBLEAppUtilContext_t)(char *pData)
Profile/Service Invoke from BLE App Util context type. This callback is used by BLEAppUtil_invokeFunc...
Definition: bleapputil_api.h:113
Definition: bleapputil_api.h:354
Gets advertising handle using pBuf. Sent after advertising stops due to a BLEAppUtil_advStop.
Definition: bleapputil_api.h:182
uint32_t numComparison
Definition: bleapputil_api.h:479
L2CAP_PEER_CREDIT_RECEIVED_EVT
Definition: bleapputil_api.h:283
uint8_t BLEAppUtil_BDaddr[B_ADDR_LEN]
Device Address.
Definition: bleapputil_api.h:76
uint16_t timeout
Definition: bleapputil_api.h:593
uint32_t event
see BLEAppUtil_GAPAdvEventMaskFlags_e
Definition: bleapputil_api.h:435
GapScan_ScanType_t scanType
Scanning type. Passive or Active.
Definition: bleapputil_api.h:524
uint8_t maxNumReport
Definition: bleapputil_api.h:559
uint16_t scanDuration
Definition: bleapputil_api.h:553
HCI Controller To Host type.
Definition: bleapputil_api.h:144
GAP_PROFILE_PERIPHERAL
Definition: bleapputil_api.h:329
Definition: gap.h:1300
Definition: bleapputil_api.h:358
A memory failure has occurred.
Definition: bleapputil_api.h:188
uint32_t eventMask
Events mask.
Definition: bleapputil_api.h:726
ATT_READ_BLOB_RSP
Definition: bleapputil_api.h:252
uint16_t connHandle
Connection handle of the current pairing process.
Definition: bleapputil_api.h:470
ATT_FIND_BY_TYPE_VALUE_REQ
Definition: bleapputil_api.h:245
bStatus_t BLEAppUtil_scanInit(const BLEAppUtil_ScanInit_t *scanInitInfo)
Set initial scan and PHY parameters.
Definition: bleapputil_api.h:365
BLEAppUtil_Profile_Roles_e profileRole
Profile role. roles are defined at BLEAppUtil_Profile_Roles_e.
Definition: bleapputil_api.h:622
Definition: gap.h:1162
L2CAP Signal type.
Definition: bleapputil_api.h:139
Definition: bleapputil_api.h:359
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 t...
Link parameters update request event.
Definition: bleapputil_api.h:158
Definition: gap.h:1001
HCI SMP type.
Definition: bleapputil_api.h:142
Definition: gap.h:1020
BLEAppUtil_Profile_Roles_e
Profile role mask.
Definition: bleapputil_api.h:325
gapBondParams_t * gapBondParams
GAP bond manager parameters structure.
Definition: bleapputil_api.h:652
Definition: gap.h:1273
HCI_LE_EVENT_CODE
Definition: bleapputil_api.h:293
ATT_SIGNED_WRITE_CMD
Definition: bleapputil_api.h:268
L2CAP_NUM_CTRL_DATA_PKT_EVT
Definition: bleapputil_api.h:282
uint8_t fltPolicy
Scanning filter policy regarding White List and Adv type.
Definition: bleapputil_api.h:529
void(* StackInitDone_t)(gapDeviceInitDoneEvent_t *deviceInitDoneData)
A callback which will be called when Device Initialization Done event is raised. Should be sent to BL...
Definition: bleapputil_api.h:103
ATT_EXCHANGE_MTU_RSP
Definition: bleapputil_api.h:242
BLEAppUtil Scan Event Data Structure.
Definition: bleapputil_api.h:445
uint8_t addrType
Public, random, public ID, random ID, or anonymous.
Definition: bleapputil_api.h:388
Authentication complete event.
Definition: bleapputil_api.h:161
GAP event header format.
Definition: gap.h:989
Definition: bleapputil_api.h:348
uint8_t initPhys
connection channel PHY(s). individual PHY values can be OR&#39;ed.
Definition: bleapputil_api.h:568
uint8_t status
pairing status
Definition: bleapputil_api.h:459
uint8_t scanPhys
PHYs on which Advs should be received on the primary Adv channel.
Definition: bleapputil_api.h:528
Definition: gap.h:1231
bStatus_t BLEAppUtil_disconnect(uint16 connHandle)
Terminate a link connection. Corresponding Events: GAP_LINK_TERMINATED_EVENT of type gapTerminateLink...
Gets advertising handle using pBuf. Sent at the beginning of each advertisement (for legacy advertisi...
Definition: bleapputil_api.h:183
GAP_PROFILE_BROADCASTER
Definition: bleapputil_api.h:327
GAP_SCAN_CLEAR_ADV_LIST_EVENT
Definition: bleapputil_api.h:219
GAP Advertise type.
Definition: bleapputil_api.h:132
void BLEAppUtil_init(ErrorHandler_t errorHandler, StackInitDone_t initDoneHandler, BLEAppUtil_GeneralParams_t *initGeneralParams, BLEAppUtil_PeriCentParams_t *initPeriCentParams)
Initiate the application (queue, event, stack)
Data type returned with GAP_EVT_ADV_DATA_TRUNCATED event.
Definition: gap_advertiser.h:582
ATT_READ_BY_GRP_TYPE_REQ
Definition: bleapputil_api.h:255
Definition: bleapputil_api.h:413
ATT_READ_BY_TYPE_RSP
Definition: bleapputil_api.h:248
BLEAppUtil_GAPPeriodicEventMaskFlags_e
GAP Periodic event mask.
Definition: bleapputil_api.h:207
Definition: gap.h:1209
Gets advertising handle using pBuf. Sent after each advertisement (for legacy advertising) or at the ...
Definition: bleapputil_api.h:184
BLEAppUtil_GAPScanEventMaskFlags_e
GAP Scan event mask.
Definition: bleapputil_api.h:193
GAP_SCAN_READ_ADV_LIST_SIZE_EVENT
Definition: bleapputil_api.h:218
GAP_Addr_Modes_t BLEAppUtil_getDevAddrMode(void)
Returns the device address mode.
Definition: gap.h:1262
int taskPriority
Task priority.
Definition: bleapputil_api.h:618
uint16_t supTimeout
see INIT_PHYPARAM_SUP_TIMEOUT
Definition: bleapputil_api.h:574
GAP_EVT_SCAN_INT_ENDED
Definition: bleapputil_api.h:199
GapAdv_enableOptions_t
Enable options for GapAdv_enable.
Definition: gap_advertiser.h:373
ATT_UNSUPPORTED_METHOD
Definition: bleapputil_api.h:266
Connecting cancelled event.
Definition: bleapputil_api.h:156
GAP_CB_CONN_EVENT_ALL
Definition: bleapputil_api.h:175
Connection monitor serving connection update event code; returned event BLEAppUtil_cmConnUpdateEvt_t...
Definition: bleapputil_api.h:319
#define GAP_EVT_SCAN_INT_ENDED
Definition: gap.h:339
BLEAppUtil_BDaddr pPeerAddress
peer device&#39;s address
Definition: bleapputil_api.h:584
GapScan_ScanType_t
GAP Scanner Scan Type.
Definition: gap_scanner.h:448
L2CAP_CHANNEL_ESTABLISHED_EVT
Definition: bleapputil_api.h:277
Start candidate node event code.
Definition: bleapputil_api.h:306
ATT_FLOW_CTRL_VIOLATED_EVENT
Definition: bleapputil_api.h:270
uint16 connHandle
Connection handle.
Definition: bleapputil_api.h:602
size_t taskStackSize
Task stack size.
Definition: bleapputil_api.h:619
Definition: bleapputil_api.h:343
bStatus_t BLEAppUtil_registerCMCBs(void)
void(* EventHandler_t)(uint32 event, BLEAppUtil_msgHdr_t *pMsgData)
Event handler which used in BLEAppUtil_EventHandler_t.
Definition: bleapputil_api.h:88
uint32_t state
BLEAppUtil_PairingEventMaskFlags_e
Definition: bleapputil_api.h:458
ATT_READ_BLOB_REQ
Definition: bleapputil_api.h:251
GAP_SCAN_TERMINATE_SYNC_EVENT
Definition: bleapputil_api.h:214
BLEAppUtil_GapScan_Evt_AdvRpt_t pAdvReport
Definition: bleapputil_api.h:425
ATT_READ_MULTI_REQ
Definition: bleapputil_api.h:253
HCI Data type.
Definition: bleapputil_api.h:140
Definition: bleapputil_api.h:363
Bond lost event.
Definition: bleapputil_api.h:167
Definition: bleapputil_api.h:346
Definition: gap.h:1041
Handover type.
Definition: bleapputil_api.h:145
uint8_t * advData
pointer to array containing the advertise data
Definition: bleapputil_api.h:491
HCI_APTO_EXPIRED_EVENT_CODE
Definition: bleapputil_api.h:297
GapAdv_data_t * pBuf
data potentially accompanying event
Definition: bleapputil_api.h:436
Channel Sounding event code.
Definition: bleapputil_api.h:312
bStatus_t BLEAppUtil_advStop(uint8 handle)
Disable an active advertising set. The set still exists and can be re-enabled with BLEAppUtil_advStar...
ATT_PREPARE_WRITE_RSP
Definition: bleapputil_api.h:260
BLEAppUtil_entityId_t BLEAppUtil_getSelfEntity(void)
Returns the self entity id needed when sending BLE stack commands.
Gets GapAdv_truncData_t using pBuf. pBuf should be cast to GapAdv_truncData_t. Sent when the advertis...
Definition: bleapputil_api.h:187
BLEAppUtil_CsEventMaskFlags_e
Channel Sounding event mask.
Definition: bleapputil_api.h:310
BLEAppUtil Adv Event Data Structure.
Definition: bleapputil_api.h:433
#define GAP_EVT_SCAN_DISABLED
Definition: gap.h:325
Gap_updateDecision_t
Definition: gap.h:708
BLEAppUtil Peripheral Central Params Structure.
Definition: bleapputil_api.h:650
BLEAppUtil Scan Start Structure.
Definition: bleapputil_api.h:542
uint8_t advHandle
Definition: bleapputil_api.h:415
GAP_EVT_SCAN_DUR_ENDED
Definition: bleapputil_api.h:198
uint16_t scanRespDataLen
length (in bytes) of scanRespData
Definition: bleapputil_api.h:492
#define GAP_PROFILE_CENTRAL
Definition: gap.h:700
#define GAP_EVT_SCAN_REQ_RECEIVED
Definition: gap.h:309
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 connec...
GAP_ADV_SET_PERIODIC_ADV_PARAMS_EVENT
Definition: bleapputil_api.h:209
GAP_SCAN_ADD_DEVICE_ADV_LIST_EVENT
Definition: bleapputil_api.h:216
Definition: bleapputil_api.h:381
ATT_TRANSACTION_READY_EVENT
Definition: bleapputil_api.h:269
#define GAP_PROFILE_BROADCASTER
A device that sends advertising events only.
Definition: gap.h:688
BLEAppUtil_AppSpecifier_e
Definition: bleapputil_api.h:334
Generic type.
Definition: bleapputil_api.h:148
#define GAP_EVT_SCAN_PRD_ENDED
Definition: gap.h:331
uint16_t scanPeriod
Definition: bleapputil_api.h:547
L2CAP_SEND_SDU_DONE_EVT
Definition: bleapputil_api.h:281
Connection Event Notification type.
Definition: bleapputil_api.h:131
BLEAppUtil_GATTEventMaskFlags_e
GATT event mask.
Definition: bleapputil_api.h:238
ATT_READ_REQ
Definition: bleapputil_api.h:249
BLEAppUtil Adv Start Structure.
Definition: bleapputil_api.h:503
bStatus_t BLEAppUtil_paramUpdateReq(gapUpdateLinkParamReq_t *pReq)
Update the link parameters to a Central or Peripheral device. As long as LL connection updates are su...
bStatus_t BLEAppUtil_paramUpdateRsp(gapUpdateLinkParamReqEvent_t *pReq, uint8 accept)
This function prepares an answer for connection parameters changing request, according to the decisio...
uint16_t scanWindow
Scanning window.
Definition: bleapputil_api.h:526
uint8_t peerAddrType
peer device&#39;s address type
Definition: bleapputil_api.h:583
uint16_t dataLen
Length of the data.
Definition: bleapputil_api.h:408
#define GAP_PROFILE_PERIPHERAL
Definition: gap.h:695
uint16_t scanInterval
see INIT_PHYPARAM_SCAN_INTERVAL
Definition: bleapputil_api.h:569
GAP_SCAN_PERIODIC_ADV_SYNC_LOST_EVENT
Definition: bleapputil_api.h:221
uint8 txPhy
Bit field of Host preferred Tx PHY.
Definition: bleapputil_api.h:604
GAPBOND_PAIRING_STATE_RPAO_READ
Definition: bleapputil_api.h:233
GAP_ADV_SET_PERIODIC_ADV_DATA_EVENT
Definition: bleapputil_api.h:210
Peripheral requested security event.
Definition: bleapputil_api.h:163
bool BLEAppUtil_isbufset(uint8_t *buf, uint8_t val, uint8_t len)
GAPBOND_PAIRING_STATE_CAR_READ
Definition: bleapputil_api.h:232
#define GAP_EVT_ADV_START_AFTER_ENABLE
Definition: gap.h:276
Link established event.
Definition: bleapputil_api.h:154
Definition: bleapputil_api.h:355
BLEAppUtil_GAPAdvEventMaskFlags_e
GAP ADV event mask.
Definition: bleapputil_api.h:179
uint16_t durationOrMaxEvents
Definition: bleapputil_api.h:512
#define BV(n)
Definition: comdef.h:136
ATT_WRITE_CMD
Definition: bleapputil_api.h:267
uint8_t primPhy
PHY of the primary advertising channel.
Definition: bleapputil_api.h:392
int8_t txPower
-127 dBm <= TX power <= 126 dBm
Definition: bleapputil_api.h:398
Start serving node event code.
Definition: bleapputil_api.h:305
GAP_CB_Event_e
Definition: gap.h:969
Definition: bleapputil_api.h:344
Definition: bleapputil_api.h:339
ATT_FIND_BY_TYPE_VALUE_RSP
Definition: bleapputil_api.h:246
Definition: bleapputil_api.h:422
Passcode type.
Definition: bleapputil_api.h:136
Pairing type.
Definition: bleapputil_api.h:137
Definition: bleapputil_api.h:347
Gap_updateDecision_t connParamUpdateDecision
The param update configuration.
Definition: bleapputil_api.h:653
GAP_SCAN_PERIODIC_RECEIVE_EVENT
Definition: bleapputil_api.h:215
int8_t rssi
-127 dBm <= RSSI <= 20 dBm
Definition: bleapputil_api.h:400
uint8_t uiInputs
if TRUE, the local device should accept a passcode input.
Definition: bleapputil_api.h:471
Definition: bleapputil_api.h:362
Contains part of the GAP Bond Manager Parameters values.
Definition: gapbondmgr.h:830
GAP Scan type.
Definition: bleapputil_api.h:133
#define GAP_EVT_ADV_END
Definition: gap.h:296
uint8_t primPhy
Primary PHY(s). Individual PHY values can be OR&#39;ed.
Definition: bleapputil_api.h:523
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 fro...
HCI_COMMAND_STATUS_EVENT_CODE
Definition: bleapputil_api.h:292
Definition: bleapputil_api.h:357
BLEAppUtil PairState Event Data Structure.
Definition: bleapputil_api.h:455
Type definitions and macros for BLE stack.
bStatus_t BLEAppUtil_registerSNCB(void)
#define GAP_EVT_ADV_DATA_TRUNCATED
Definition: gap.h:316
Connection monitor type.
Definition: bleapputil_api.h:147
HCI_COMMAND_COMPLETE_EVENT_CODE
Definition: bleapputil_api.h:291
ATT_READ_MULTI_RSP
Definition: bleapputil_api.h:254
#define GAP_EVT_SCAN_ENABLED
Scanner has been enabled.
Definition: gap.h:318
uint16 phyOpts
Bit field of Host preferred PHY options.
Definition: bleapputil_api.h:606
Definition: bleapputil_api.h:338
GAP_SCAN_PERIODIC_ADV_SYNC_EST_EVENT
Definition: bleapputil_api.h:220
ATT_HANDLE_VALUE_NOTI
Definition: bleapputil_api.h:263
GapAdv_scanReqReceived_t pScanReqRcv
Definition: bleapputil_api.h:417
ATT_READ_BY_GRP_TYPE_RSP
Definition: bleapputil_api.h:256
uint16_t appearanceAtt
Appearance attribute.
Definition: bleapputil_api.h:626
#define GAP_EVT_ADV_END_AFTER_DISABLE
Definition: gap.h:282
CS type.
Definition: bleapputil_api.h:146
HCI SMP Meta type.
Definition: bleapputil_api.h:143
ATT_EXECUTE_WRITE_RSP
Definition: bleapputil_api.h:262
#define GAP_EVT_SCAN_DUR_ENDED
Scan duration has ended.
Definition: gap.h:333
GAP_Addr_Modes_t addressMode
Definition: bleapputil_api.h:635
Gets GapAdv_scanReqReceived_t using pBuf. pBuf should be cast to GapAdv_scanReqReceived_t. Sent when a scan request is received.
Definition: bleapputil_api.h:186
uint16_t periodicAdvInt
Periodic advertising interval. 0 means no periodic advertising.
Definition: bleapputil_api.h:406
#define GAP_EVT_ADV_START
Definition: gap.h:289
bStatus_t BLEAppUtil_cancelConnect(void)
Cancel the ongoing connection attempt.
ATT_READ_BY_TYPE_REQ
Definition: bleapputil_api.h:247
bStatus_t BLEAppUtil_unRegisterConnNotifHandler(void)
Unregister a connection event callback.
bStatus_t BLEAppUtil_scanStop(void)
Stop currently running scanning operation.
GAPBOND_PAIRING_STATE_BOND_SAVED
Definition: bleapputil_api.h:231
ATT_WRITE_RSP
Definition: bleapputil_api.h:258
GAP_SCAN_SYNC_CANCEL_EVENT
Definition: bleapputil_api.h:213
ATT_MTU_UPDATED_EVENT
Definition: bleapputil_api.h:271
Definition: bleapputil_api.h:342
Event for scanning end.
Definition: gap_scanner.h:501
uint16_t scanInterval
Scanning interval.
Definition: bleapputil_api.h:525
GAPBOND_PAIRING_STATE_COMPLETE
Definition: bleapputil_api.h:229
BLEAppUtil_ConnEventNotiEventMaskFlags_e
Connection event event mask.
Definition: bleapputil_api.h:171
ATT_EXECUTE_WRITE_REQ
Definition: bleapputil_api.h:261
Authentication failure event.
Definition: bleapputil_api.h:166
GAP_PROFILE_CENTRAL
Definition: bleapputil_api.h:330
GapScan_data_t * pBuf
data potentially accompanying event
Definition: bleapputil_api.h:448
int8_t fltMinRssi
Filter by RSSI. Only packets received with the specified RSSI or above will be reported.
Definition: bleapputil_api.h:531
Connection monitor connection status event code; returned event cmStatusEvt_t.
Definition: bleapputil_api.h:321
BLEAppUtil Events handlers Structure.
Definition: bleapputil_api.h:722
Link parameters update reject event.
Definition: bleapputil_api.h:159
ATT_EXCHANGE_MTU_REQ
Definition: bleapputil_api.h:241
Phy Preference on the current connection. Should be created by the application and passed to BLEAppUt...
Definition: bleapputil_api.h:600
BLEAppUtil_AppCapabilities_e
Enumeration for External Application Control Capabilities.
Definition: bleapputil_api.h:352
OSAL L2CAP_SIGNAL_EVENT message format.
Definition: l2cap.h:570
Connection monitor report event code.
Definition: bleapputil_api.h:320
GAPBOND_PAIRING_STATE_ENCRYPTED
Definition: bleapputil_api.h:230
#define GAP_PROFILE_OBSERVER
A device that receives advertising events only.
Definition: gap.h:690
ACL Data Packet.
Definition: bleapputil_api.h:299
Data type returned with GAP_EVT_ADV_SET_TERMINATED event.
Definition: gap_advertiser.h:563
HCI GAP type.
Definition: bleapputil_api.h:141
uint16_t advDataLen
length (in bytes) of advData
Definition: bleapputil_api.h:490
char * BLEAppUtil_convertBdAddr2Str(uint8_t *pAddr)
Convert Bluetooth address to string.
GATT GATT_MSG_EVENT message format.
Definition: gatt.h:216
ICall layer interface.
bStatus_t BLEAppUtil_connect(BLEAppUtil_ConnectParams_t *connParams)
Initiate connection with the specified peer device.
GAP_EVT_SCAN_DISABLED
Definition: bleapputil_api.h:196
Definition: bleapputil_api.h:340
#define B_ADDR_LEN
Default Public and Random Address Length.
Definition: bcomdef.h:73
L2CAP_CHANNEL_TERMINATED_EVT
Definition: bleapputil_api.h:278
BLEAppUtil General Params Structure.
Definition: bleapputil_api.h:615
bStatus_t BLEAppUtil_invokeFunctionNoData(InvokeFromBLEAppUtilContext_t callback)
This function receives a callback and data and switches the context in order to call the callback fro...
Definition: gap.h:1180
GAP_PROFILE_OBSERVER
Definition: bleapputil_api.h:328
Definition: bleapputil_api.h:336
#define GAP_EVT_SCAN_WND_ENDED
Scan window has ended.
Definition: gap.h:341
uint16_t minConnInterval
see INIT_PHYPARAM_CONN_INT_MIN
Definition: bleapputil_api.h:571
GAP_ADV_SET_PERIODIC_ADV_ENABLE_EVENT
Definition: bleapputil_api.h:211
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 un...
GAP_SCAN_REMOVE_DEVICE_ADV_LIST_EVENT
Definition: bleapputil_api.h:217
GAP_EVT_SCAN_ENABLED
Definition: bleapputil_api.h:195
GapScan_Evt_End_t pScanDis
Definition: bleapputil_api.h:424
Definition: gap_advertiser.h:545
uint16_t connHandle
connection handle of current pairing process
Definition: bleapputil_api.h:457
ATT_HANDLE_VALUE_IND
Definition: bleapputil_api.h:264
Event Packet.
Definition: bleapputil_api.h:298
GAP_EVT_ADV_REPORT
Definition: bleapputil_api.h:201
ATT_HANDLE_VALUE_CFM
Definition: bleapputil_api.h:265
BLEAppUtil Conn Params Structure. Should be created by the application and passed to BLEAppUtil_setCo...
Definition: bleapputil_api.h:566
GapAdv_setTerm_t pSetTerm
Definition: bleapputil_api.h:416
GAPBOND_GENERATE_ECC_DONE
Definition: bleapputil_api.h:234
Definition: bleapputil_api.h:366
Link terminated event.
Definition: bleapputil_api.h:155
HCI_BLE_HARDWARE_ERROR_EVENT_CODE
Definition: bleapputil_api.h:295
GapAdv_enableOptions_t enableOptions
whether to advertise for the max possible time, for a user-specified duration, or for a user-specifie...
Definition: bleapputil_api.h:505
gapPeriConnectParams_t periConnParamsAtt
Peripheral Preferred Connection Parameters.
Definition: bleapputil_api.h:627
bStatus_t BLEAppUtil_registerCNCB(void)
L2CAP Data type.
Definition: bleapputil_api.h:138
bStatus_t BLEAppUtil_unRegisterEventHandler(BLEAppUtil_EventHandler_t *eventHandler)
Un-register application event handler.
Definition: bleapputil_api.h:345
uint8_t secPhy
PHY of the secondary advertising channel.
Definition: bleapputil_api.h:394
ATT_WRITE_REQ
Definition: bleapputil_api.h:257
GAP_CB_CONN_ESTABLISHED
Definition: bleapputil_api.h:173
uint16_t scanWindow
see INIT_PHYPARAM_SCAN_WINDOW
Definition: bleapputil_api.h:570
uint16_t advReportFields
Bitmap of adv report fields to keep in the advertising report list.
Definition: bleapputil_api.h:527
L2CAP_PEER_CREDIT_THRESHOLD_EVT
Definition: bleapputil_api.h:280
L2CAP_OUT_OF_CREDIT_EVT
Definition: bleapputil_api.h:279
HCI_VE_EVENT_CODE
Definition: bleapputil_api.h:294
bStatus_t BLEAppUtil_registerCMSCBs(void)
BLEAppUtil_PairingEventMaskFlags_e
GAP Pairing event mask.
Definition: bleapputil_api.h:226
HCI_DISCONNECTION_COMPLETE_EVENT_CODE
Definition: bleapputil_api.h:290
bStatus_t BLEAppUtil_registerEventHandler(BLEAppUtil_EventHandler_t *eventHandler)
Register application event handler.
uint8_t fltDiscMode
Filter by Discovery Mode.
Definition: bleapputil_api.h:532
Definition: gap.h:1242
GAPBOND_PAIRING_STATE_STARTED
Definition: bleapputil_api.h:228
Pairing request event.
Definition: bleapputil_api.h:165
GAP_EVT_SCAN_PRD_ENDED
Definition: bleapputil_api.h:197
uint16_t connLatency
see INIT_PHYPARAM_CONN_LATENCY
Definition: bleapputil_api.h:573
#define GAP_EVT_ADV_REPORT
Definition: gap.h:348
BLEAppUtil Scan Init Structure.
Definition: bleapputil_api.h:521
uint_least8_t ICall_EntityID
Entity id data type.
Definition: icall.h:445
uint8 rxPhy
Bit field of Host preferred Rx PHY.
Definition: bleapputil_api.h:605
uint8_t uiOutputs
if TRUE, the local device should display the passcode.
Definition: bleapputil_api.h:472
BLEAppUtil Adv Init Structure.
Definition: bleapputil_api.h:488
Data type returned with GAP_EVT_SCAN_REQ_RECEIVED event.
Definition: gap_advertiser.h:572
BLEAppUtil Connect Params Structure. Should be created by the application and passed to BLEAppUtil_Co...
Definition: bleapputil_api.h:581
uint8_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:220
BLEAppUtil_eventHandlerType_e
Event Handler Types which can be registered to BLEAppUtil, used by BLEAppUtil_EventHandler_t.
Definition: bleapputil_api.h:128
uint16_t fltPduType
Filter by type of PDU.
Definition: bleapputil_api.h:530
EventHandler_t pEventHandler
The event handler.
Definition: bleapputil_api.h:725
GAP Periodic type.
Definition: bleapputil_api.h:134
uint8_t advSid
SID (0x00-0x0f) of the advertising PDU. 0xFF means no ADI field in the PDU.
Definition: bleapputil_api.h:396
BLEAppUtil_BDaddr deviceAddr
Pointer to 6-byte device address which the current pairing.
Definition: bleapputil_api.h:469
GAP_EVT_ADV_REPORT_FULL
Definition: bleapputil_api.h:202
uint8_t evtType
Definition: bleapputil_api.h:386
Definition: bleapputil_api.h:341
uint16_t maxConnInterval
see INIT_PHYPARAM_CONN_INT_MAX
Definition: bleapputil_api.h:572
#define GAP_EVT_ADV_SET_TERMINATED
Definition: gap.h:303
Link parameters update event.
Definition: bleapputil_api.h:157
#define GAP_EVT_ADV_REPORT_FULL
Definition: gap.h:354
uint8_t directAddrType
Type of TargetA address in the directed advertising PDU.
Definition: bleapputil_api.h:402
BLEAppUtil_L2CAPSignalEventMaskFlags_e
L2CAP Signal event mask.
Definition: bleapputil_api.h:275
uint32_t * arg
custom application argument that can be return through this callback
Definition: bleapputil_api.h:437
uint8_t * pDeviceRandomAddress
Definition: bleapputil_api.h:641
uint8_t phys
PHY(s) to try making connection on. individual PHY values can be OR&#39;ed.
Definition: bleapputil_api.h:585
Gets advertising handle using pBuf. Sent on the first advertisement after a BLEAppUtil_advStart.
Definition: bleapputil_api.h:181
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...
BLEAppUtil Passcode Data Structure.
Definition: bleapputil_api.h:467
GAP_Addr_Modes_t
Address modes to initialize the local device.
Definition: gap.h:720
uint8_t * deviceNameAtt
Device name attribute.
Definition: bleapputil_api.h:625
GAP_EVT_SCAN_WND_ENDED
Definition: bleapputil_api.h:200
GAP_CB_PHY_UPDATE
Definition: bleapputil_api.h:174
HCI_NUM_OF_COMPLETED_PACKETS_EVENT_CODE
Definition: bleapputil_api.h:296
BLEAppUtil_eventHandlerType_e handlerType
Handler type. see BLEAppUtil_eventHandlerType_e.
Definition: bleapputil_api.h:724
GapAdv_params_t * advParam
pointer to structure of advertising parameters
Definition: bleapputil_api.h:494
OSAL L2CAP_DATA_EVENT message format.
Definition: l2cap.h:600
ATT_READ_RSP
Definition: bleapputil_api.h:250
uint8 allPhys
Host preference on how to handle txPhy and rxPhy.
Definition: bleapputil_api.h:603
Signature updated event.
Definition: bleapputil_api.h:160
#define GAP_EVT_INSUFFICIENT_MEMORY
A memory failure has occurred.
Definition: gap.h:379
uint8_t fltDup
Filter out duplicated packets, determining by address and DID.
Definition: bleapputil_api.h:533
BLEAppUtil_GAPConnEventMaskFlags_e
GAP Conn event mask.
Definition: bleapputil_api.h:152
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale