BLE-Stack APIs  1.00.00
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 
24 #ifndef MULTI_H
25 #define MULTI_H
26 
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31 
32 /*-------------------------------------------------------------------
33  * INCLUDES
34  */
35 #include "gap.h"
36 
37 /*-------------------------------------------------------------------
38  * CONSTANTS
39  */
40 
57 #define GAPROLE_PROFILEROLE 0x300
58 
70 #define GAPROLE_IRK 0x301
71 
83 #define GAPROLE_SRK 0x302
84 
94 #define GAPROLE_SIGNCOUNTER 0x303
95 
108 #define GAPROLE_BD_ADDR 0x304
109 
121 #define GAPROLE_ADVERT_ENABLED 0x305
122 
134 #define GAPROLE_ADVERT_OFF_TIME 0x306
135 
146 #define GAPROLE_ADVERT_DATA 0x307
147 
157 #define GAPROLE_SCAN_RSP_DATA 0x308
158 
168 #define GAPROLE_ADV_EVENT_TYPE 0x309
169 
179 #define GAPROLE_ADV_DIRECT_TYPE 0x30A
180 
190 #define GAPROLE_ADV_DIRECT_ADDR 0x30B
191 
203 #define GAPROLE_ADV_CHANNEL_MAP 0x30C
204 
216 #define GAPROLE_ADV_FILTER_POLICY 0x30D
217 
227 #define GAPROLE_MIN_CONN_INTERVAL 0x311
228 
238 #define GAPROLE_MAX_CONN_INTERVAL 0x312
239 
249 #define GAPROLE_SLAVE_LATENCY 0x313
250 
260 #define GAPROLE_TIMEOUT_MULTIPLIER 0x314
261 
273 #define GAPROLE_ADV_NONCONN_ENABLED 0x31B
274 
284 #define GAPROLE_MAX_SCAN_RES 0x404
285 
292 #define GAPROLE_NO_ACTION 0
293 #define GAPROLE_RESEND_PARAM_UPDATE 1
294 #define GAPROLE_TERMINATE_LINK 2
295 
302 #define GAPROLE_LINK_PARAM_UPDATE_ACCEPT 0
303 #define GAPROLE_LINK_PARAM_UPDATE_REJECT 1
304 #define GAPROLE_LINK_PARAM_UPDATE_APP_DECIDES 2
305 #define GAPROLE_LINK_PARAM_UPDATE_NUM_OPTIONS 3
306 
310 /*-------------------------------------------------------------------
311  * TYPEDEFS
312  */
313 
318 typedef union
320 {
329 
331 typedef struct
332 {
334  uint16_t connHandle;
335  uint16_t minConnInterval;
336  uint16_t maxConnInterval;
337  uint16_t slaveLatency;
338  uint16_t timeoutMultiplier;
342 /*-------------------------------------------------------------------
343  * MACROS
344  */
345 
346 /*-------------------------------------------------------------------
347  * Profile Callbacks
348  */
349 
387 typedef uint8_t (*passThroughToApp_t)
388 (
389  gapMultiRoleEvent_t *pEvent
390 );
391 
401 typedef void (*paramUpdateAppDecision_t)
402 (
405 );
406 
413 typedef struct
414 {
417 } gapRolesCBs_t;
418 
421 /*-------------------------------------------------------------------
422  * API FUNCTIONS
423  */
424 
444 extern bStatus_t GAPRole_SetParameter(uint16_t param, uint8_t len, void *pValue, uint8 connHandle);
445 
462 extern bStatus_t GAPRole_GetParameter(uint16_t param, void *pValue, uint8 connHandle);
463 
479 bStatus_t GAPRole_StartDevice(gapRolesCBs_t *pAppCallbacks, uint8_t* numConns);
480 
490 extern bStatus_t GAPRole_TerminateConnection(uint16_t connHandle);
491 
504 extern bStatus_t GAPRole_StartDiscovery(uint8_t mode, uint8_t activeScan, uint8_t whiteList);
505 
514 
529 extern bStatus_t GAPRole_EstablishLink(uint8_t highDutyCycle, uint8_t whiteList,
530  uint8_t addrTypePeer, uint8_t *peerAddr);
531 
532 
549 extern bStatus_t gapRole_connUpdate(uint8_t handleFailure,
550  gapRole_updateConnParams_t *pConnParams);
551 
553 
554 /*-------------------------------------------------------------------
555  * TASK FUNCTIONS - Don't call these. These are system functions.
556  */
557 
562 extern void GAPRole_createTask(void);
563 
564 extern void gapRole_abort(void);
565 
567 
568 /*-------------------------------------------------------------------
569 -------------------------------------------------------------------*/
570 
571 #ifdef __cplusplus
572 }
573 #endif
574 
575 #endif /* MULTI_H */
576 
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:331
void(* paramUpdateAppDecision_t)(gapUpdateLinkParamReq_t *pReq, gapUpdateLinkParamReqReply_t *pRsp)
Callback for the app to decide on a parameter update request.
Definition: multi.h:402
GAP_DEVICE_INIT_DONE_EVENT message format.
Definition: gap.h:751
GAP event header format.
Definition: gap.h:694
gapEstLinkReqEvent_t linkCmpl
Link complete event structure.
Definition: multi.h:325
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:415
gapDeviceInitDoneEvent_t initDone
GAP initialization done.
Definition: multi.h:322
GAP_DEVICE_INFO_EVENT message format.
Definition: gap.h:786
uint16_t timeoutMultiplier
supervision timeout
Definition: multi.h:338
uint8_t paramUpdateEnable
Parameter Update Options
Definition: multi.h:333
gapEventHdr_t gap
GAP_MSG_EVENT and status.
Definition: multi.h:321
uint8_t(* passThroughToApp_t)(gapMultiRoleEvent_t *pEvent)
Multi Event Callback Function.
Definition: multi.h:388
uint16_t minConnInterval
minimum connection interval
Definition: multi.h:335
bStatus_t GAPRole_CancelDiscovery(void)
Cancel a device discovery scan.
Peripheral GAPRole Callback structure.
Definition: peripheral.h:466
Multi GAPRole Event Structure.
Definition: multi.h:319
GAP layer interface.
uint16_t slaveLatency
slave latency
Definition: multi.h:337
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:225
paramUpdateAppDecision_t pfnParamUpdateAppDecision
When the app should decide on a param update request.
Definition: multi.h:416
GAP_DEVICE_DISCOVERY_EVENT message format.
Definition: gap.h:832
gapDeviceInfoEvent_t deviceInfo
Discovery device information event structure.
Definition: multi.h:323
gapLinkUpdateEvent_t linkUpdate
Link update event structure.
Definition: multi.h:326
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:327
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:334
gapDevDiscEvent_t discCmpl
Discovery complete event structure.
Definition: multi.h:324
uint16_t maxConnInterval
maximum connection interval
Definition: multi.h:336
Copyright 2017, Texas Instruments Incorporated