TI BLE-Stack for Bluetooth 4.2 API Documentation  3.01.00.07
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 
21 #ifndef PERIPHERAL_H
22 #define PERIPHERAL_H
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
29 /*-------------------------------------------------------------------
30  * INCLUDES
31  */
32 
33 /*-------------------------------------------------------------------
34  * CONSTANTS
35  */
36 
53 #define GAPROLE_PROFILEROLE 0x300
54 
66 #define GAPROLE_IRK 0x301
67 
79 #define GAPROLE_SRK 0x302
80 
90 #define GAPROLE_SIGNCOUNTER 0x303
91 
104 #define GAPROLE_BD_ADDR 0x304
105 
117 #define GAPROLE_ADVERT_ENABLED 0x305
118 
130 #define GAPROLE_ADVERT_OFF_TIME 0x306
131 
142 #define GAPROLE_ADVERT_DATA 0x307
143 
153 #define GAPROLE_SCAN_RSP_DATA 0x308
154 
164 #define GAPROLE_ADV_EVENT_TYPE 0x309
165 
175 #define GAPROLE_ADV_DIRECT_TYPE 0x30A
176 
186 #define GAPROLE_ADV_DIRECT_ADDR 0x30B
187 
199 #define GAPROLE_ADV_CHANNEL_MAP 0x30C
200 
212 #define GAPROLE_ADV_FILTER_POLICY 0x30D
213 
221 #define GAPROLE_CONNHANDLE 0x30E
222 
224 
232 #define GAPROLE_RSSI_READ_RATE 0x30F
233 
244 #define GAPROLE_PARAM_UPDATE_ENABLE 0x310
245 
255 #define GAPROLE_MIN_CONN_INTERVAL 0x311
256 
266 #define GAPROLE_MAX_CONN_INTERVAL 0x312
267 
277 #define GAPROLE_SLAVE_LATENCY 0x313
278 
288 #define GAPROLE_TIMEOUT_MULTIPLIER 0x314
289 
297 #define GAPROLE_CONN_BD_ADDR 0x315
298 
306 #define GAPROLE_CONN_INTERVAL 0x316
307 
315 #define GAPROLE_CONN_LATENCY 0x317
316 
324 #define GAPROLE_CONN_TIMEOUT 0x318
325 
326 
333 #define GAPROLE_PARAM_UPDATE_REQ 0x319
334 
344 #define GAPROLE_STATE 0x31A
345 
357 #define GAPROLE_ADV_NONCONN_ENABLED 0x31B
358 
366 #define GAPROLE_BD_ADDR_TYPE 0x31C
367 
375 #define GAPROLE_CONN_TERM_REASON 0x31D
376 
379 /*-------------------------------------------------------------------
380  * TYPEDEFS
381  */
382 
384 typedef enum
385 {
396 
402 #define GAPROLE_NO_ACTION 0
403 #define GAPROLE_RESEND_PARAM_UPDATE 1
404 #define GAPROLE_TERMINATE_LINK 2
405 
412 #define GAPROLE_LINK_PARAM_UPDATE_WAIT_REMOTE_PARAMS 0
413 #define GAPROLE_LINK_PARAM_UPDATE_INITIATE_BOTH_PARAMS 1
414 #define GAPROLE_LINK_PARAM_UPDATE_INITIATE_APP_PARAMS 2
415 #define GAPROLE_LINK_PARAM_UPDATE_WAIT_APP_PARAMS 3
416 #define GAPROLE_LINK_PARAM_UPDATE_WAIT_BOTH_PARAMS 4
417 #define GAPROLE_LINK_PARAM_UPDATE_REJECT_REQUEST 5
418 #define GAPROLE_LINK_PARAM_UPDATE_NUM_OPTIONS 6
419 
423 /*-------------------------------------------------------------------
424  * MACROS
425  */
426 
427 /*-------------------------------------------------------------------
428  * Profile Callbacks
429  */
430 
444 typedef void (*gapRolesParamUpdateCB_t)(uint16_t connInterval,
445  uint16_t connSlaveLatency,
446  uint16_t connTimeout);
447 
455 typedef void (*gapRolesStateNotify_t)(gaprole_States_t newState);
456 
463 typedef struct
464 {
466 } gapRolesCBs_t;
467 
470 /*-------------------------------------------------------------------
471  * API FUNCTIONS
472  */
473 
495 extern bStatus_t GAPRole_SetParameter(uint16_t param, uint8_t len, void *pValue);
496 
512 extern bStatus_t GAPRole_GetParameter(uint16_t param, void *pValue);
513 
524 extern bStatus_t GAPRole_StartDevice(gapRolesCBs_t *pAppCallbacks);
525 
534 
554 extern bStatus_t GAPRole_SendUpdateParam(uint16_t minConnInterval,
555  uint16_t maxConnInterval,
556  uint16_t latency, uint16_t connTimeout,
557  uint8_t handleFailure);
558 
564 extern void GAPRole_RegisterAppCBs(gapRolesParamUpdateCB_t *pParamUpdateCB);
565 
567 
568 /*-------------------------------------------------------------------
569  * TASK FUNCTIONS - Don't call these. These are system functions.
570  */
571 
576 extern void GAPRole_createTask(void);
577 
579 
580 /*-------------------------------------------------------------------
581 -------------------------------------------------------------------*/
582 
583 #ifdef __cplusplus
584 }
585 #endif
586 
587 #endif /* PERIPHERAL_H */
588 
void GAPRole_RegisterAppCBs(gapRolesParamUpdateCB_t *pParamUpdateCB)
Register application's callbacks.
Waiting to be started.
Definition: peripheral.h:386
In a connection + advertising.
Definition: peripheral.h:393
Error occurred - invalid state.
Definition: peripheral.h:394
bStatus_t GAPRole_StartDevice(gapRolesCBs_t *pAppCallbacks)
Initialize the GAP layer.
In a connection.
Definition: peripheral.h:392
Device just timed out from a connection but is not yet advertising, is in waiting period before adver...
Definition: peripheral.h:391
Device is started but not advertising, is in waiting period before advertising again.
Definition: peripheral.h:390
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:444
Multi GAPRole Callback structure.
Definition: multi.h:410
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:384
Currently Advertising.
Definition: peripheral.h:388
Currently using non-connectable Advertising.
Definition: peripheral.h:389
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:227
Started but not advertising.
Definition: peripheral.h:387
gapRolesStateNotify_t pfnStateChange
Whenever the device changes state.
Definition: peripheral.h:465
void(* gapRolesStateNotify_t)(gaprole_States_t newState)
State Change Callback Type.
Definition: peripheral.h:455
Copyright 2017, Texas Instruments Incorporated