TI BLE5-Stack API Documentation  1.00.01.04
peripheral.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: BSD3 2009 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
24 #ifndef PERIPHERAL_H
25 #define PERIPHERAL_H
26 
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31 
32 /*-------------------------------------------------------------------
33  * INCLUDES
34  */
35 
36 /*-------------------------------------------------------------------
37  * CONSTANTS
38  */
39 
56 #define GAPROLE_PROFILEROLE 0x300
57 
69 #define GAPROLE_IRK 0x301
70 
82 #define GAPROLE_SRK 0x302
83 
93 #define GAPROLE_SIGNCOUNTER 0x303
94 
107 #define GAPROLE_BD_ADDR 0x304
108 
120 #define GAPROLE_ADVERT_ENABLED 0x305
121 
133 #define GAPROLE_ADVERT_OFF_TIME 0x306
134 
145 #define GAPROLE_ADVERT_DATA 0x307
146 
156 #define GAPROLE_SCAN_RSP_DATA 0x308
157 
167 #define GAPROLE_ADV_EVENT_TYPE 0x309
168 
178 #define GAPROLE_ADV_DIRECT_TYPE 0x30A
179 
189 #define GAPROLE_ADV_DIRECT_ADDR 0x30B
190 
202 #define GAPROLE_ADV_CHANNEL_MAP 0x30C
203 
215 #define GAPROLE_ADV_FILTER_POLICY 0x30D
216 
224 #define GAPROLE_CONNHANDLE 0x30E
225 
227 
235 #define GAPROLE_RSSI_READ_RATE 0x30F
236 
247 #define GAPROLE_PARAM_UPDATE_ENABLE 0x310
248 
258 #define GAPROLE_MIN_CONN_INTERVAL 0x311
259 
269 #define GAPROLE_MAX_CONN_INTERVAL 0x312
270 
280 #define GAPROLE_SLAVE_LATENCY 0x313
281 
291 #define GAPROLE_TIMEOUT_MULTIPLIER 0x314
292 
300 #define GAPROLE_CONN_BD_ADDR 0x315
301 
309 #define GAPROLE_CONN_INTERVAL 0x316
310 
318 #define GAPROLE_CONN_LATENCY 0x317
319 
327 #define GAPROLE_CONN_TIMEOUT 0x318
328 
329 
336 #define GAPROLE_PARAM_UPDATE_REQ 0x319
337 
347 #define GAPROLE_STATE 0x31A
348 
360 #define GAPROLE_ADV_NONCONN_ENABLED 0x31B
361 
369 #define GAPROLE_BD_ADDR_TYPE 0x31C
370 
378 #define GAPROLE_CONN_TERM_REASON 0x31D
379 
382 /*-------------------------------------------------------------------
383  * TYPEDEFS
384  */
385 
387 typedef enum
388 {
399 
405 #define GAPROLE_NO_ACTION 0
406 #define GAPROLE_RESEND_PARAM_UPDATE 1
407 #define GAPROLE_TERMINATE_LINK 2
408 
415 #define GAPROLE_LINK_PARAM_UPDATE_WAIT_REMOTE_PARAMS 0
416 #define GAPROLE_LINK_PARAM_UPDATE_INITIATE_BOTH_PARAMS 1
417 #define GAPROLE_LINK_PARAM_UPDATE_INITIATE_APP_PARAMS 2
418 #define GAPROLE_LINK_PARAM_UPDATE_WAIT_APP_PARAMS 3
419 #define GAPROLE_LINK_PARAM_UPDATE_WAIT_BOTH_PARAMS 4
420 #define GAPROLE_LINK_PARAM_UPDATE_REJECT_REQUEST 5
421 #define GAPROLE_LINK_PARAM_UPDATE_NUM_OPTIONS 6
422 
426 /*-------------------------------------------------------------------
427  * MACROS
428  */
429 
430 /*-------------------------------------------------------------------
431  * Profile Callbacks
432  */
433 
447 typedef void (*gapRolesParamUpdateCB_t)(uint16_t connInterval,
448  uint16_t connSlaveLatency,
449  uint16_t connTimeout);
450 
458 typedef void (*gapRolesStateNotify_t)(gaprole_States_t newState);
459 
466 typedef struct
467 {
469 } gapRolesCBs_t;
470 
473 /*-------------------------------------------------------------------
474  * API FUNCTIONS
475  */
476 
498 extern bStatus_t GAPRole_SetParameter(uint16_t param, uint8_t len, void *pValue);
499 
515 extern bStatus_t GAPRole_GetParameter(uint16_t param, void *pValue);
516 
527 extern bStatus_t GAPRole_StartDevice(gapRolesCBs_t *pAppCallbacks);
528 
537 
557 extern bStatus_t GAPRole_SendUpdateParam(uint16_t minConnInterval,
558  uint16_t maxConnInterval,
559  uint16_t latency, uint16_t connTimeout,
560  uint8_t handleFailure);
561 
567 extern void GAPRole_RegisterAppCBs(gapRolesParamUpdateCB_t *pParamUpdateCB);
568 
570 
571 /*-------------------------------------------------------------------
572  * TASK FUNCTIONS - Don't call these. These are system functions.
573  */
574 
579 extern void GAPRole_createTask(void);
580 
582 
583 /*-------------------------------------------------------------------
584 -------------------------------------------------------------------*/
585 
586 #ifdef __cplusplus
587 }
588 #endif
589 
590 #endif /* PERIPHERAL_H */
591 
void GAPRole_RegisterAppCBs(gapRolesParamUpdateCB_t *pParamUpdateCB)
Register application's callbacks.
Waiting to be started.
Definition: peripheral.h:389
In a connection + advertising.
Definition: peripheral.h:396
Error occurred - invalid state.
Definition: peripheral.h:397
bStatus_t GAPRole_StartDevice(gapRolesCBs_t *pAppCallbacks)
Initialize the GAP layer.
In a connection.
Definition: peripheral.h:395
Device just timed out from a connection but is not yet advertising, is in waiting period before adver...
Definition: peripheral.h:394
Device is started but not advertising, is in waiting period before advertising again.
Definition: peripheral.h:393
bStatus_t GAPRole_TerminateConnection(void)
Terminates the existing connection.
bStatus_t GAPRole_SetParameter(uint16_t param, uint8_t len, void *pValue)
Set a GAP Role parameter.
bStatus_t GAPRole_GetParameter(uint16_t param, void *pValue)
Get a GAP Role parameter.
void(* gapRolesParamUpdateCB_t)(uint16_t connInterval, uint16_t connSlaveLatency, uint16_t connTimeout)
Callback when the connection parameters are updated.
Definition: peripheral.h:447
Multi GAPRole Callback structure.
Definition: multi.h:413
bStatus_t GAPRole_SendUpdateParam(uint16_t minConnInterval, uint16_t maxConnInterval, uint16_t latency, uint16_t connTimeout, uint8_t handleFailure)
Update the parameters of an existing connection.
gaprole_States_t
GAP Peripheral Role States.
Definition: peripheral.h:387
Currently Advertising.
Definition: peripheral.h:391
Currently using non-connectable Advertising.
Definition: peripheral.h:392
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:225
Started but not advertising.
Definition: peripheral.h:390
gapRolesStateNotify_t pfnStateChange
Whenever the device changes state.
Definition: peripheral.h:468
void(* gapRolesStateNotify_t)(gaprole_States_t newState)
State Change Callback Type.
Definition: peripheral.h:458
Copyright 2017, Texas Instruments Incorporated