TI BLE-Stack for Bluetooth 4.2 API Documentation  3.01.00.07
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 
21 #ifndef CENTRAL_H
22 #define CENTRAL_H
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
29 /*********************************************************************
30  * INCLUDES
31  */
32 #include "bcomdef.h"
33 #include "osal.h"
34 #include "gap.h"
35 
36 /*********************************************************************
37  * CONSTANTS
38  */
39 
60 #define GAPCENTRALROLE_IRK 0x400
61 
62 
73 #define GAPCENTRALROLE_SRK 0x401
74 
75 
84 #define GAPCENTRALROLE_SIGNCOUNTER 0x402
85 
98 #define GAPCENTRALROLE_BD_ADDR 0x403
99 
109 #define GAPCENTRALROLE_MAX_SCAN_RES 0x404
110 
120 #define GAPCENTRALROLE_LINK_PARAM_UPDATE_REQ_REPLY 0x405
121 
126 #define GAPCENTRALROLE_PARAM_UPDATE_REQ_AUTO_REJECT 0x00
127 #define GAPCENTRALROLE_PARAM_UPDATE_REQ_AUTO_ACCEPT 0x01
128 #define GAPCENTRALROLE_PARAM_UPDATE_REQ_SEND_TO_APP 0x02
129 
133 /*********************************************************************
134  * VARIABLES
135  */
136 
137 /*********************************************************************
138  * MACROS
139  */
140 
141 /*********************************************************************
142  * TYPEDEFS
143  */
144 
149 typedef union
151 {
161 
202 typedef uint8_t (*pfnGapCentralRoleEventCB_t)
203 (
204  gapCentralRoleEvent_t *pEvent
205 );
206 
215 typedef struct
216 {
221 /*********************************************************************
222  * VARIABLES
223  */
224 
225 /*********************************************************************
226  * API FUNCTIONS
227  */
228 
229 /*-------------------------------------------------------------------
230  * Central Profile Public APIs
231  */
232 
243 
257 extern bStatus_t GAPCentralRole_SetParameter(uint16_t param, uint8_t len, void *pValue);
258 
268 extern bStatus_t GAPCentralRole_GetParameter(uint16_t param, void *pValue);
269 
280 extern bStatus_t GAPCentralRole_TerminateLink(uint16_t connHandle);
281 
296 extern bStatus_t GAPCentralRole_EstablishLink(uint8_t highDutyCycle, uint8_t whiteList,
297  uint8_t addrTypePeer, uint8_t *peerAddr);
298 
322 extern bStatus_t GAPCentralRole_UpdateLink(uint16_t connHandle, uint16_t connIntervalMin,
323  uint16_t connIntervalMax, uint16_t connLatency,
324  uint16_t connTimeout);
337 extern bStatus_t GAPCentralRole_StartDiscovery(uint8_t mode, uint8_t activeScan, uint8_t whiteList);
338 
347 
349 
350 /*-------------------------------------------------------------------
351  * TASK FUNCTIONS - Don't call these. These are system functions.
352  */
353 
358 extern void GAPCentralRole_createTask(void);
359 
361 
362 /*********************************************************************
363 *********************************************************************/
364 
365 #ifdef __cplusplus
366 }
367 #endif
368 
369 #endif /* CENTRAL_H */
370 
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:215
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:154
GAP_DEVICE_INIT_DONE_EVENT message format.
Definition: gap.h:818
gapDeviceInitDoneEvent_t initDone
GAP initialization done.
Definition: central.h:153
GAP event header format.
Definition: gap.h:761
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:155
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:159
gapLinkUpdateEvent_t linkUpdate
Link update event structure.
Definition: central.h:157
GAP_DEVICE_INFO_EVENT message format.
Definition: gap.h:853
gapEstLinkReqEvent_t linkCmpl
Link complete event structure.
Definition: central.h:156
Central Event Structure.
Definition: central.h:150
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:217
gapUpdateLinkParamReqEvent_t linkUpdateReply
Link update request reply structure.
Definition: central.h:158
uint8_t(* pfnGapCentralRoleEventCB_t)(gapCentralRoleEvent_t *pEvent)
Central Event Callback Function.
Definition: central.h:203
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:227
GAP_DEVICE_DISCOVERY_EVENT message format.
Definition: gap.h:899
gapEventHdr_t gap
GAP_MSG_EVENT and status.
Definition: central.h:152
bStatus_t GAPCentralRole_TerminateLink(uint16_t connHandle)
Terminate a link.
Copyright 2017, Texas Instruments Incorporated