TI BLE5-Stack API Documentation  1.00.01.04
ugap.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 
24 #ifndef UGAP_H
25 #define UGAP_H
26 
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31 
32 /*-------------------------------------------------------------------
33  * INCLUDES
34  */
35 
36 /*-------------------------------------------------------------------
37  * CONSTANTS
38  */
39 
44 #define UG_DUTY_TIME_UNIT 100L
46 
47 #if defined(FEATURE_BROADCASTER)
48 
52 #define UG_BCAST_STATE_INVALID 0
53 #define UG_BCAST_STATE_INITIALIZED 1
54 #define UG_BCAST_STATE_IDLE 2
55 #define UG_BCAST_STATE_ADVERTISING 3
56 #define UG_BCAST_STATE_WAITING 4
57 #define UG_BCAST_STATE_SUSPENDED 5
58 
63 #define UGB_EVT_STATE_CHANGE 1
64 #define UGB_EVT_ADV_PREPARE 2
65 #define UGB_EVT_ADV_POSTPROCESS 3
66 
67 #endif /* FEATURE_BROADCASTER */
68 
71 /*-------------------------------------------------------------------
72  * TYPEDEFS
73  */
74 
75 #if defined(FEATURE_BROADCASTER)
76 
80 typedef uint8 ugBcastState_t;
81 
93 typedef void (*ugbStateChangeCb_t)(ugBcastState_t state);
94 
100 typedef void (*ugbAdvPrepareCb_t)(void);
101 
107 typedef void (*ugbAdvDoneCb_t)(bStatus_t status);
108 
112 typedef struct
113 {
117 } ugBcastCBs_t;
118 
119 PACKED_TYPEDEF_STRUCT {
120  ugBcastState_t state;
121 } ugbMsgStateChange_t;
122 
123 PACKED_TYPEDEF_STRUCT {
124  bStatus_t status;
125 } ugbMsgAdvPostprocess_t;
126 
129 #endif /* FEATURE_BROADCASTER */
130 
131 /*-------------------------------------------------------------------
132  * MACROS
133  */
134 
135 /*-------------------------------------------------------------------
136  * API FUNCTIONS
137  */
138 
139 #if defined(FEATURE_BROADCASTER)
140 
150 
164 bStatus_t ug_bcastSetDuty(uint16 dutyOnTime, uint16 dutyOffTime);
165 
180 bStatus_t ug_bcastStart(uint16 numAdvEvent);
181 
190 bStatus_t ug_bcastStop(void);
191 #endif /* FEATURE_BROADCASTER */
192 
193 /*-------------------------------------------------------------------
194 -------------------------------------------------------------------*/
195 
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #endif /* UGAP_H */
201  // end of Micro_BLE_Stack
void(* ugbStateChangeCb_t)(ugBcastState_t state)
Callback of when the Broadcaster's state changes.
Definition: ugap.h:93
uint8 ugBcastState_t
Broadcaster state.
Definition: ugap.h:80
ugbAdvPrepareCb_t pfnAdvPrepareCB
Notification for Adv preperation.
Definition: ugap.h:115
bStatus_t ug_bcastInit(ugBcastCBs_t *pCBs)
Initialize Micro Broadcaster.
bStatus_t ug_bcastStop(void)
Stop Broadcaster. Proceed the state from either Advertising or Waiting to IDLE.
void(* ugbAdvPrepareCb_t)(void)
Callback of when the next Adverting Event is about to start.
Definition: ugap.h:100
bStatus_t ug_bcastStart(uint16 numAdvEvent)
Start Broadcaster. Proceed the state from either Initialized or IDLE to Advertising.
ugbAdvDoneCb_t pfnAdvDoneCB
Notification of Adv event done.
Definition: ugap.h:116
void(* ugbAdvDoneCb_t)(bStatus_t status)
Callback of when an Advertising Event has just been done.
Definition: ugap.h:107
ugbStateChangeCb_t pfnStateChangeCB
State change notification.
Definition: ugap.h:114
Set of Broadcaster callbacks - must be setup by the application.
Definition: ugap.h:112
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:225
bStatus_t ug_bcastSetDuty(uint16 dutyOnTime, uint16 dutyOffTime)
Set Broadcaster Duty On/Off time.
Copyright 2017, Texas Instruments Incorporated