TI BLE-Stack for Bluetooth 4.2 API Documentation  3.01.00.07
multi.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 MULTI_H
22 #define MULTI_H
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
29 /*-------------------------------------------------------------------
30  * INCLUDES
31  */
32 #include "gap.h"
33 
34 /*-------------------------------------------------------------------
35  * CONSTANTS
36  */
37 
54 #define GAPROLE_PROFILEROLE 0x300
55 
67 #define GAPROLE_IRK 0x301
68 
80 #define GAPROLE_SRK 0x302
81 
91 #define GAPROLE_SIGNCOUNTER 0x303
92 
105 #define GAPROLE_BD_ADDR 0x304
106 
118 #define GAPROLE_ADVERT_ENABLED 0x305
119 
131 #define GAPROLE_ADVERT_OFF_TIME 0x306
132 
143 #define GAPROLE_ADVERT_DATA 0x307
144 
154 #define GAPROLE_SCAN_RSP_DATA 0x308
155 
165 #define GAPROLE_ADV_EVENT_TYPE 0x309
166 
176 #define GAPROLE_ADV_DIRECT_TYPE 0x30A
177 
187 #define GAPROLE_ADV_DIRECT_ADDR 0x30B
188 
200 #define GAPROLE_ADV_CHANNEL_MAP 0x30C
201 
213 #define GAPROLE_ADV_FILTER_POLICY 0x30D
214 
224 #define GAPROLE_MIN_CONN_INTERVAL 0x311
225 
235 #define GAPROLE_MAX_CONN_INTERVAL 0x312
236 
246 #define GAPROLE_SLAVE_LATENCY 0x313
247 
257 #define GAPROLE_TIMEOUT_MULTIPLIER 0x314
258 
270 #define GAPROLE_ADV_NONCONN_ENABLED 0x31B
271 
281 #define GAPROLE_MAX_SCAN_RES 0x404
282 
289 #define GAPROLE_NO_ACTION 0
290 #define GAPROLE_RESEND_PARAM_UPDATE 1
291 #define GAPROLE_TERMINATE_LINK 2
292 
299 #define GAPROLE_LINK_PARAM_UPDATE_ACCEPT 0
300 #define GAPROLE_LINK_PARAM_UPDATE_REJECT 1
301 #define GAPROLE_LINK_PARAM_UPDATE_APP_DECIDES 2
302 #define GAPROLE_LINK_PARAM_UPDATE_NUM_OPTIONS 3
303 
307 /*-------------------------------------------------------------------
308  * TYPEDEFS
309  */
310 
315 typedef union
317 {
326 
328 typedef struct
329 {
331  uint16_t connHandle;
332  uint16_t minConnInterval;
333  uint16_t maxConnInterval;
334  uint16_t slaveLatency;
335  uint16_t timeoutMultiplier;
339 /*-------------------------------------------------------------------
340  * MACROS
341  */
342 
343 /*-------------------------------------------------------------------
344  * Profile Callbacks
345  */
346 
384 typedef uint8_t (*passThroughToApp_t)
385 (
386  gapMultiRoleEvent_t *pEvent
387 );
388 
398 typedef void (*paramUpdateAppDecision_t)
399 (
402 );
403 
410 typedef struct
411 {
414 } gapRolesCBs_t;
415 
418 /*-------------------------------------------------------------------
419  * API FUNCTIONS
420  */
421 
441 extern bStatus_t GAPRole_SetParameter(uint16_t param, uint8_t len, void *pValue, uint8 connHandle);
442 
459 extern bStatus_t GAPRole_GetParameter(uint16_t param, void *pValue, uint8 connHandle);
460 
476 bStatus_t GAPRole_StartDevice(gapRolesCBs_t *pAppCallbacks, uint8_t* numConns);
477 
487 extern bStatus_t GAPRole_TerminateConnection(uint16_t connHandle);
488 
501 extern bStatus_t GAPRole_StartDiscovery(uint8_t mode, uint8_t activeScan, uint8_t whiteList);
502 
511 
526 extern bStatus_t GAPRole_EstablishLink(uint8_t highDutyCycle, uint8_t whiteList,
527  uint8_t addrTypePeer, uint8_t *peerAddr);
528 
529 
546 extern bStatus_t gapRole_connUpdate(uint8_t handleFailure,
547  gapRole_updateConnParams_t *pConnParams);
548 
550 
551 /*-------------------------------------------------------------------
552  * TASK FUNCTIONS - Don't call these. These are system functions.
553  */
554 
559 extern void GAPRole_createTask(void);
560 
561 extern void gapRole_abort(void);
562 
564 
565 /*-------------------------------------------------------------------
566 -------------------------------------------------------------------*/
567 
568 #ifdef __cplusplus
569 }
570 #endif
571 
572 #endif /* MULTI_H */
573 
bStatus_t GAPRole_GetParameter(uint16_t param, void *pValue, uint8 connHandle)
Get a GAP Role parameter.
bStatus_t GAPRole_StartDevice(gapRolesCBs_t *pAppCallbacks, uint8_t *numConns)
Initialize the GAP layer.
Multi GAPRole Parameter Update Structure.
Definition: multi.h:328
void(* paramUpdateAppDecision_t)(gapUpdateLinkParamReq_t *pReq, gapUpdateLinkParamReqReply_t *pRsp)
Callback for the app to decide on a parameter update request.
Definition: multi.h:399
GAP_DEVICE_INIT_DONE_EVENT message format.
Definition: gap.h:818
GAP event header format.
Definition: gap.h:761
gapEstLinkReqEvent_t linkCmpl
Link complete event structure.
Definition: multi.h:322
bStatus_t GAPRole_TerminateConnection(uint16_t connHandle)
Terminates the existing connection.
bStatus_t gapRole_connUpdate(uint8_t handleFailure, gapRole_updateConnParams_t *pConnParams)
Send a connection parameter update to a connected device.
bStatus_t GAPRole_StartDiscovery(uint8_t mode, uint8_t activeScan, uint8_t whiteList)
Start a device discovery scan.
passThroughToApp_t pfnPassThrough
When the event should be processed by the app instead of the GAP Role.
Definition: multi.h:412
gapDeviceInitDoneEvent_t initDone
GAP initialization done.
Definition: multi.h:319
GAP_DEVICE_INFO_EVENT message format.
Definition: gap.h:853
uint16_t timeoutMultiplier
supervision timeout
Definition: multi.h:335
uint8_t paramUpdateEnable
Parameter Update Options
Definition: multi.h:330
gapEventHdr_t gap
GAP_MSG_EVENT and status.
Definition: multi.h:318
uint8_t(* passThroughToApp_t)(gapMultiRoleEvent_t *pEvent)
Multi Event Callback Function.
Definition: multi.h:385
uint16_t minConnInterval
minimum connection interval
Definition: multi.h:332
bStatus_t GAPRole_CancelDiscovery(void)
Cancel a device discovery scan.
Multi GAPRole Callback structure.
Definition: multi.h:410
Multi GAPRole Event Structure.
Definition: multi.h:316
GAP layer interface.
uint16_t slaveLatency
slave latency
Definition: multi.h:334
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:227
paramUpdateAppDecision_t pfnParamUpdateAppDecision
When the app should decide on a param update request.
Definition: multi.h:413
GAP_DEVICE_DISCOVERY_EVENT message format.
Definition: gap.h:899
gapDeviceInfoEvent_t deviceInfo
Discovery device information event structure.
Definition: multi.h:320
gapLinkUpdateEvent_t linkUpdate
Link update event structure.
Definition: multi.h:323
bStatus_t GAPRole_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: multi.h:324
bStatus_t GAPRole_SetParameter(uint16_t param, uint8_t len, void *pValue, uint8 connHandle)
Set a GAP Role parameter.
uint16_t connHandle
connection handle
Definition: multi.h:331
gapDevDiscEvent_t discCmpl
Discovery complete event structure.
Definition: multi.h:321
uint16_t maxConnInterval
maximum connection interval
Definition: multi.h:333
Copyright 2017, Texas Instruments Incorporated