TI BLE5-Stack API Documentation  1.01.14.00
gap_advertiser.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  Group: WCS, BTS
4  $Target Device: DEVICES $
5 
6  ******************************************************************************
7  $License: TISD 2009 $
8  ******************************************************************************
9  $Release Name: PACKAGE NAME $
10  $Release Date: PACKAGE RELEASE DATE $
11  *****************************************************************************/
12 
22 #ifndef GAP_ADVERTISER_H
23 #define GAP_ADVERTISER_H
24 
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29 
30 /*-------------------------------------------------------------------
31  * INCLUDES
32  */
33 #include "bcomdef.h"
34 #include "osal.h"
35 #include "gap.h"
36 
37 /*-------------------------------------------------------------------
38  * MACROS
39  */
40 
47 #define GAPADV_PARAMS_LEGACY_SCANN_CONN { \
49  .eventProps = GAP_ADV_PROP_CONNECTABLE | GAP_ADV_PROP_SCANNABLE | \
50  GAP_ADV_PROP_LEGACY, \
51  .primIntMin = 160, \
52  .primIntMax = 160, \
53  .primChanMap = GAP_ADV_CHAN_ALL, \
54  .peerAddrType = PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID, \
55  .peerAddr = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa }, \
56  .filterPolicy = GAP_ADV_WL_POLICY_ANY_REQ, \
57  .txPower = GAP_ADV_TX_POWER_NO_PREFERENCE, \
58  .primPhy = GAP_ADV_PRIM_PHY_1_MBPS, \
59  .secPhy = GAP_ADV_SEC_PHY_1_MBPS, \
60  .sid = 0 \
61 }
62 
64 #define GAPADV_PARAMS_AE_LONG_RANGE_CONN { \
65  .eventProps = GAP_ADV_PROP_CONNECTABLE, \
66  .primIntMin = 160, \
67  .primIntMax = 160, \
68  .primChanMap = GAP_ADV_CHAN_ALL, \
69  .peerAddrType = PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID, \
70  .peerAddr = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa }, \
71  .filterPolicy = GAP_ADV_WL_POLICY_ANY_REQ, \
72  .txPower = GAP_ADV_TX_POWER_NO_PREFERENCE, \
73  .primPhy = GAP_ADV_PRIM_PHY_CODED_S2, \
74  .secPhy = GAP_ADV_SEC_PHY_CODED_S2, \
75  .sid = 0 \
76 }
77 
80 /*-------------------------------------------------------------------
81  * CONSTANTS
82  */
83 
137 typedef enum
138 {
147 
158 
172 
184 
193 
202 
211 
229 
241 
253 
267 
269  GAP_ADV_PARAM_COUNT
279 #define GAP_ADV_INVALID_HANDLE 0xFF
281 
284 {
292 };
294 
296 typedef enum
297 {
301 
303 typedef enum
304 {
308 
313 
315 typedef enum
316 {
331 
333 typedef enum
334 {
335  GAP_ADV_CHAN_37 = BV(0),
336  GAP_ADV_CHAN_38 = BV(1),
337  GAP_ADV_CHAN_39 = BV(2),
342 
344 typedef enum
345 {
366 
368 #define GAP_ADV_TX_POWER_NO_PREFERENCE 127
369 
371 typedef enum
372 {
377 
379 typedef enum
380 {
386 
394 typedef enum
395 {
399  GAP_ADV_EVT_MASK_SCAN_REQ_NOTI = AE_NOTIFY_ENABLE_SCAN_REQUEST,
407  GAP_ADV_EVT_MASK_START_AFTER_ENABLE = AE_NOTIFY_ENABLE_ADV_SET_START,
411  GAP_ADV_EVT_MASK_START = AE_NOTIFY_ENABLE_ADV_START,
415  GAP_ADV_EVT_MASK_END = AE_NOTIFY_ENABLE_ADV_END,
419  GAP_ADV_EVT_MASK_END_AFTER_DISABLE = AE_NOTIFY_ENABLE_ADV_SET_END,
430 
433  GAP_ADV_EVT_MASK_RESERVED = BV(15)
436 
439 /*-------------------------------------------------------------------
440  * Structures
441  */
442 
455 typedef struct
456 {
457  uint16_t eventProps;
458  uint32_t primIntMin;
459  uint32_t primIntMax;
462  uint8_t peerAddr[B_ADDR_LEN];
463  GapAdv_filterPolicy_t filterPolicy;
464  int8_t txPower;
467  uint8_t sid;
469 
470 
472 typedef struct
473 {
474  uint8 handle;
475  uint8 status;
476  uint16 connHandle;
479 
481 typedef struct
482 {
483  uint8 handle;
484  uint8 scanAddrType;
485  uint8 scanAddr[B_ADDR_LEN];
486  uint8 channel;
487  int8 rssi;
489 
491 typedef struct
492 {
493  uint8 handle;
495 
498  uint16 advDataLen;
500 
503 /*-------------------------------------------------------------------
504  * FUNCTIONS - Advertising
505  */
506 
533 extern bStatus_t GapAdv_create(pfnGapCB_t *cb, GapAdv_params_t *advParam,
534  uint8 *advHandle);
535 
556 extern bStatus_t GapAdv_destroy(uint8 handle,
557  GapAdv_freeBufferOptions_t freeOptions);
558 
593 extern bStatus_t GapAdv_enable(uint8 handle,
594  GapAdv_enableOptions_t enableOptions,
595  uint16 durationOrMaxEvents);
596 
614 extern bStatus_t GapAdv_disable(uint8 handle);
615 
632 extern bStatus_t GapAdv_setEventMask(uint8 handle, GapAdv_eventMaskFlags_t mask);
633 
652 extern bStatus_t GapAdv_setParam(uint8 handle, GapAdv_ParamId_t paramID,
653  void *pValue);
654 
674 extern bStatus_t GapAdv_getParam(uint8 handle, GapAdv_ParamId_t paramID,
675  void *pValue, uint8_t *pLen);
676 
694 extern bStatus_t GapAdv_getBuffer(uint8 handle, GapAdv_dataTypes_t dataType,
695  uint16 *pLen, uint8 **ppBuf);
696 
756  GapAdv_freeBufferOptions_t freeOptions);
757 
802 bStatus_t GapAdv_loadByHandle(uint8 handle, GapAdv_dataTypes_t dataType,
803  uint16 len, uint8 *pBuf);
804 
843 extern bStatus_t GapAdv_prepareLoadByBuffer(uint8 *pBuf, bool freeOldData);
844 
875 extern bStatus_t GapAdv_loadByBuffer(uint16 len, uint8 *pBuf);
876 
885 extern bStatus_t GapAdv_abortLoad(void);
886 
887 /*-------------------------------------------------------------------
888 -------------------------------------------------------------------*/
889 
890 #ifdef __cplusplus
891 }
892 #endif
893 
894 #endif /* GAP_ADVERTISER_H */
895 
Omit advertiser's address from PDU's.
Definition: gap_advertiser.h:290
uint32_t primIntMax
GAP_ADV_PARAM_PRIMARY_INTERVAL_MAX
Definition: gap_advertiser.h:459
This API allows the software components in the Z-Stack to be written independently of the specifics o...
All Channels.
Definition: gap_advertiser.h:338
GAP_Peer_Addr_Types_t
Address types used for specifying peer address type.
Definition: gap.h:588
coded-s2
Definition: gap_advertiser.h:375
bStatus_t GapAdv_setParam(uint8 handle, GapAdv_ParamId_t paramID, void *pValue)
bStatus_t GapAdv_getParam(uint8 handle, GapAdv_ParamId_t paramID, void *pValue, uint8_t *pLen)
Definition: gap_advertiser.h:266
uint32_t primIntMin
GAP_ADV_PARAM_PRIMARY_INTERVAL_MIN
Definition: gap_advertiser.h:458
bStatus_t GapAdv_prepareLoadByHandle(uint8 handle, GapAdv_freeBufferOptions_t freeOptions)
GapAdv_freeBufferOptions_t
Possible free options for Gap Advertiser API's.
Definition: gap_advertiser.h:303
Definition: gap_advertiser.h:423
1 mbps
Definition: gap_advertiser.h:373
Definition: gap_advertiser.h:201
bStatus_t GapAdv_loadByHandle(uint8 handle, GapAdv_dataTypes_t dataType, uint16 len, uint8 *pBuf)
Definition: gap_advertiser.h:291
Directed advertising.
Definition: gap_advertiser.h:287
bStatus_t GapAdv_abortLoad(void)
Definition: gap_advertiser.h:411
bStatus_t GapAdv_enable(uint8 handle, GapAdv_enableOptions_t enableOptions, uint16 durationOrMaxEvents)
Data type returned with GAP_EVT_ADV_DATA_TRUNCATED event.
Definition: gap_advertiser.h:491
int8 rssi
RSSI of the scan req.
Definition: gap_advertiser.h:487
Scannable advertising.
Definition: gap_advertiser.h:286
uint16_t eventProps
GAP_ADV_PARAM_PROPS
Definition: gap_advertiser.h:457
Free the scan response data.
Definition: gap_advertiser.h:307
uint8 channel
Channel when the scan req was received.
Definition: gap_advertiser.h:486
GapAdv_enableOptions_t
Enable options for GapAdv_enable.
Definition: gap_advertiser.h:315
Definition: gap_advertiser.h:399
GapAdv_ParamId_t
Definition: gap_advertiser.h:137
Definition: gap_advertiser.h:350
1 mbps
Definition: gap_advertiser.h:381
uint8 handle
Advertising handle.
Definition: gap_advertiser.h:474
Don't free anything, NOTE: do NOT use this flag - It has a known issue while using it...
Definition: gap_advertiser.h:305
Definition: gap_advertiser.h:252
bStatus_t GapAdv_disable(uint8 handle)
Disable an active advertising set.
void(* pfnGapCB_t)(uint32_t event, void *pBuf, uintptr_t arg)
Definition: gap.h:1174
uint8 handle
Advertising handle.
Definition: gap_advertiser.h:493
Definition: gap_advertiser.h:210
GapAdv_secondaryPHY_t secPhy
GAP_ADV_PARAM_SECONDARY_PHY
Definition: gap_advertiser.h:466
2 mbps
Definition: gap_advertiser.h:382
Scan response data.
Definition: gap_advertiser.h:299
bStatus_t GapAdv_setEventMask(uint8 handle, GapAdv_eventMaskFlags_t mask)
GapAdv_secondaryPHY_t
Gap Advertiser Options for advertising on the secondary PHY.
Definition: gap_advertiser.h:379
bStatus_t GapAdv_create(pfnGapCB_t *cb, GapAdv_params_t *advParam, uint8 *advHandle)
Definition: gap_advertiser.h:419
Definition: gap_advertiser.h:311
Definition: gap_advertiser.h:228
GapAdv_advChannels_t
GAP Advertiser Defines for Advertiser Channels.
Definition: gap_advertiser.h:333
Definition: gap_advertiser.h:171
GAP_Peer_Addr_Types_t peerAddrType
GAP_ADV_PARAM_PEER_ADDRESS_TYPE
Definition: gap_advertiser.h:461
GapAdv_eventMaskFlags_t
Definition: gap_advertiser.h:394
Advertising data.
Definition: gap_advertiser.h:298
GapAdv_primaryPHY_t
Gap Advertiser Options for advertising on the primary PHY.
Definition: gap_advertiser.h:371
Definition: gap_advertiser.h:329
Type definitions and macros for BLE stack.
Channel 37.
Definition: gap_advertiser.h:335
Definition: gap_advertiser.h:157
Connectable advertising.
Definition: gap_advertiser.h:285
Free the advertising data.
Definition: gap_advertiser.h:306
Definition: gap_advertiser.h:325
bStatus_t GapAdv_getBuffer(uint8 handle, GapAdv_dataTypes_t dataType, uint16 *pLen, uint8 **ppBuf)
coded-s2
Definition: gap_advertiser.h:384
Definition: gap_advertiser.h:240
Definition: gap_advertiser.h:360
Definition: gap_advertiser.h:407
uint16 connHandle
Connection handle that ended advertising.
Definition: gap_advertiser.h:476
GAP layer interface.
uint32_t len
Image length in bytes.
Definition: oad_image_header.h:529
Definition: gap_advertiser.h:403
coded-s8
Definition: gap_advertiser.h:383
GapAdv_filterPolicy_t filterPolicy
GAP_ADV_PARAM_FILTER_POLICY
Definition: gap_advertiser.h:463
GapAdv_advChannels_t primChanMap
GAP_ADV_PARAM_PRIMARY_CHANNEL_MAP
Definition: gap_advertiser.h:460
Use legacy advertising PDU's.
Definition: gap_advertiser.h:289
GapAdv_dataTypes_t
Gap Advertising Data Types.
Definition: gap_advertiser.h:296
Definition: gap_advertiser.h:321
uint8 scanAddrType
Address type of scanning device.
Definition: gap_advertiser.h:484
uint16 advDataLen
Definition: gap_advertiser.h:498
int8_t txPower
NOT CURRENTLY IMPLEMENTED.
Definition: gap_advertiser.h:464
Data type returned with GAP_EVT_ADV_SET_TERMINATED event.
Definition: gap_advertiser.h:472
#define B_ADDR_LEN
Default Public and Random Address Length.
Definition: bcomdef.h:115
Definition: gap_advertiser.h:146
Definition: gap_advertiser.h:455
Definition: gap_advertiser.h:415
High Duty Cycle Directed Advertising.
Definition: gap_advertiser.h:288
Definition: gap_advertiser.h:355
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:249
Definition: gap_advertiser.h:364
Definition: gap_advertiser.h:192
GapAdv_filterPolicy_t
GAP Advertiser White List Policy.
Definition: gap_advertiser.h:344
bStatus_t GapAdv_prepareLoadByBuffer(uint8 *pBuf, bool freeOldData)
bStatus_t GapAdv_loadByBuffer(uint16 len, uint8 *pBuf)
Channel 39.
Definition: gap_advertiser.h:337
bStatus_t GapAdv_destroy(uint8 handle, GapAdv_freeBufferOptions_t freeOptions)
uint8 handle
Advertising handle.
Definition: gap_advertiser.h:483
GapAdv_eventProps_t
GAP Advertising Event Param Properties.
Definition: gap_advertiser.h:283
coded-s8
Definition: gap_advertiser.h:374
Data type returned with GAP_EVT_SCAN_REQ_RECEIVED event.
Definition: gap_advertiser.h:481
Channel 38.
Definition: gap_advertiser.h:336
GapAdv_primaryPHY_t primPhy
GAP_ADV_PARAM_PRIMARY_PHY
Definition: gap_advertiser.h:465
uint8_t sid
GAP_ADV_PARAM_SID
Definition: gap_advertiser.h:467
uint8 status
TODO.
Definition: gap_advertiser.h:475
uint8 numCompAdvEvts
Number of completed advertising events.
Definition: gap_advertiser.h:477
Definition: gap_advertiser.h:183
uint8 availAdvDataLen
How many bytes of the advertising data were sent.
Definition: gap_advertiser.h:494
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale