TI BLE5-Stack API Documentation  1.00.01.04
central.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: BSD3 2011 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
24 #ifndef CENTRAL_H
25 #define CENTRAL_H
26 
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31 
32 /*********************************************************************
33  * INCLUDES
34  */
35 #include "bcomdef.h"
36 #include "osal.h"
37 #include "gap.h"
38 
39 /*********************************************************************
40  * CONSTANTS
41  */
42 
63 #define GAPCENTRALROLE_IRK 0x400
64 
65 
76 #define GAPCENTRALROLE_SRK 0x401
77 
78 
87 #define GAPCENTRALROLE_SIGNCOUNTER 0x402
88 
101 #define GAPCENTRALROLE_BD_ADDR 0x403
102 
112 #define GAPCENTRALROLE_MAX_SCAN_RES 0x404
113 
123 #define GAPCENTRALROLE_LINK_PARAM_UPDATE_REQ_REPLY 0x405
124 
129 #define GAPCENTRALROLE_PARAM_UPDATE_REQ_AUTO_REJECT 0x00
130 #define GAPCENTRALROLE_PARAM_UPDATE_REQ_AUTO_ACCEPT 0x01
131 #define GAPCENTRALROLE_PARAM_UPDATE_REQ_SEND_TO_APP 0x02
132 
136 /*********************************************************************
137  * VARIABLES
138  */
139 
140 /*********************************************************************
141  * MACROS
142  */
143 
144 /*********************************************************************
145  * TYPEDEFS
146  */
147 
152 typedef union
154 {
164 
205 typedef uint8_t (*pfnGapCentralRoleEventCB_t)
206 (
207  gapCentralRoleEvent_t *pEvent
208 );
209 
218 typedef struct
219 {
224 /*********************************************************************
225  * VARIABLES
226  */
227 
228 /*********************************************************************
229  * API FUNCTIONS
230  */
231 
232 /*-------------------------------------------------------------------
233  * Central Profile Public APIs
234  */
235 
246 
260 extern bStatus_t GAPCentralRole_SetParameter(uint16_t param, uint8_t len, void *pValue);
261 
271 extern bStatus_t GAPCentralRole_GetParameter(uint16_t param, void *pValue);
272 
283 extern bStatus_t GAPCentralRole_TerminateLink(uint16_t connHandle);
284 
299 extern bStatus_t GAPCentralRole_EstablishLink(uint8_t highDutyCycle, uint8_t whiteList,
300  uint8_t addrTypePeer, uint8_t *peerAddr);
301 
325 extern bStatus_t GAPCentralRole_UpdateLink(uint16_t connHandle, uint16_t connIntervalMin,
326  uint16_t connIntervalMax, uint16_t connLatency,
327  uint16_t connTimeout);
340 extern bStatus_t GAPCentralRole_StartDiscovery(uint8_t mode, uint8_t activeScan, uint8_t whiteList);
341 
350 
352 
353 /*-------------------------------------------------------------------
354  * TASK FUNCTIONS - Don't call these. These are system functions.
355  */
356 
361 extern void GAPCentralRole_createTask(void);
362 
364 
365 /*********************************************************************
366 *********************************************************************/
367 
368 #ifdef __cplusplus
369 }
370 #endif
371 
372 #endif /* CENTRAL_H */
373 
This API allows the software components in the Z-Stack to be written independently of the specifics o...
bStatus_t GAPCentralRole_StartDiscovery(uint8_t mode, uint8_t activeScan, uint8_t whiteList)
Start a device discovery scan.
Central GAPRole Callback Structure.
Definition: central.h:218
bStatus_t GAPCentralRole_StartDevice(gapCentralRoleCB_t *pAppCallbacks)
Start the device in Central role. This function is typically called once during system startup...
gapDeviceInfoEvent_t deviceInfo
Discovery device information event structure.
Definition: central.h:157
GAP_DEVICE_INIT_DONE_EVENT message format.
Definition: gap.h:826
gapDeviceInitDoneEvent_t initDone
GAP initialization done.
Definition: central.h:156
GAP event header format.
Definition: gap.h:769
bStatus_t GAPCentralRole_UpdateLink(uint16_t connHandle, uint16_t connIntervalMin, uint16_t connIntervalMax, uint16_t connLatency, uint16_t connTimeout)
Update the link connection parameters.
bStatus_t GAPCentralRole_CancelDiscovery(void)
Cancel a device discovery scan.
gapDevDiscEvent_t discCmpl
Discovery complete event structure.
Definition: central.h:158
bStatus_t GAPCentralRole_EstablishLink(uint8_t highDutyCycle, uint8_t whiteList, uint8_t addrTypePeer, uint8_t *peerAddr)
Establish a link to a peer device.
gapTerminateLinkEvent_t linkTerminate
Link terminated event structure.
Definition: central.h:162
gapLinkUpdateEvent_t linkUpdate
Link update event structure.
Definition: central.h:160
GAP_DEVICE_INFO_EVENT message format.
Definition: gap.h:861
gapEstLinkReqEvent_t linkCmpl
Link complete event structure.
Definition: central.h:159
Central Event Structure.
Definition: central.h:153
bStatus_t GAPCentralRole_GetParameter(uint16_t param, void *pValue)
Get a parameter in the Central Profile.
Type definitions and macros for BLE stack.
GAP layer interface.
pfnGapCentralRoleEventCB_t eventCB
event callback
Definition: central.h:220
gapUpdateLinkParamReqEvent_t linkUpdateReply
Link update request reply structure.
Definition: central.h:161
uint8_t(* pfnGapCentralRoleEventCB_t)(gapCentralRoleEvent_t *pEvent)
Central Event Callback Function.
Definition: central.h:206
bStatus_t GAPCentralRole_SetParameter(uint16_t param, uint8_t len, void *pValue)
Set a parameter in the Central Profile.
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:225
GAP_DEVICE_DISCOVERY_EVENT message format.
Definition: gap.h:907
gapEventHdr_t gap
GAP_MSG_EVENT and status.
Definition: central.h:155
bStatus_t GAPCentralRole_TerminateLink(uint16_t connHandle)
Terminate a link.
Copyright 2017, Texas Instruments Incorporated