44 #define UGAP_DUTY_TIME_UNIT 100L 47 #if defined(FEATURE_BROADCASTER) 52 #define UGAP_BCAST_STATE_INVALID 0 53 #define UGAP_BCAST_STATE_INITIALIZED 1 54 #define UGAP_BCAST_STATE_IDLE 2 55 #define UGAP_BCAST_STATE_ADVERTISING 3 56 #define UGAP_BCAST_STATE_WAITING 4 57 #define UGAP_BCAST_STATE_SUSPENDED 5 63 #define UGB_EVT_STATE_CHANGE 1 64 #define UGB_EVT_ADV_PREPARE 2 65 #define UGB_EVT_ADV_POSTPROCESS 3 69 #if defined(FEATURE_OBSERVER) 74 #define UGAP_SCAN_STATE_INVALID 0 75 #define UGAP_SCAN_STATE_INITIALIZED 1 76 #define UGAP_SCAN_STATE_IDLE 2 77 #define UGAP_SCAN_STATE_SCANNING 3 78 #define UGAP_SCAN_STATE_WAITING 4 79 #define UGAP_SCAN_STATE_SUSPENDED 5 85 #define UGAP_OBSERVER_EVT_STATE_CHANGE 4 86 #define UGAP_OBSERVER_EVT_SCAN_INDICATION 5 87 #define UGAP_OBSERVER_EVT_SCAN_WINDOW_COMPLETE 6 91 #if defined(FEATURE_MONITOR) 96 #define UGAP_MONITOR_STATE_INVALID 0 97 #define UGAP_MONITOR_STATE_INITIALIZED 1 98 #define UGAP_MONITOR_STATE_IDLE 2 99 #define UGAP_MONITOR_STATE_MONITORING 3 105 #define UGAP_MONITOR_EVT_STATE_CHANGE 7 106 #define UGAP_MONITOR_EVT_MONITOR_INDICATION 8 107 #define UGAP_MONITOR_EVT_MONITOR_COMPLETE 9 117 #if defined(FEATURE_BROADCASTER) 161 PACKED_TYPEDEF_STRUCT {
162 ugapBcastState_t state;
163 } ugapBcastMsgStateChange_t;
165 PACKED_TYPEDEF_STRUCT {
167 } ugapBcastMsgAdvPostprocess_t;
173 #if defined(FEATURE_OBSERVER) 178 typedef uint8 ugapObserverScan_State_t;
191 typedef void (*ugapObserverStateChangeCb_t)(ugapObserverScan_State_t state);
200 typedef void (*ugapObserverScanIndicationCb_t)(
bStatus_t status, uint8_t len, uint8_t *pPayload);
207 typedef void (*ugapObserverScanWindowCompleteCb_t)(
bStatus_t status);
214 ugapObserverStateChangeCb_t pfnStateChangeCB;
215 ugapObserverScanIndicationCb_t pfnScanIndicationCB;
216 ugapObserverScanWindowCompleteCb_t pfnScanWindowCompleteCB;
217 } ugapObserverScanCBs_t;
219 PACKED_TYPEDEF_STRUCT {
220 ugapObserverScan_State_t state;
221 } ugapObserverMsgStateChange_t;
223 PACKED_TYPEDEF_STRUCT {
227 } ugapObserverMsgScanIndication_t;
229 PACKED_TYPEDEF_STRUCT {
231 } ugapObserverMsgScanWindowComplete_t;
237 #if defined(FEATURE_MONITOR) 285 PACKED_TYPEDEF_STRUCT {
286 ugapMonitorState_t state;
287 } ugapMsgStateChange_t;
289 PACKED_TYPEDEF_STRUCT {
294 } ugapMsgMonitorIndication_t;
296 PACKED_TYPEDEF_STRUCT {
299 } ugapMsgMonitorComplete_t;
313 #if defined(FEATURE_BROADCASTER) 367 #if defined(FEATURE_OBSERVER) 377 bStatus_t ugap_scanInit(ugapObserverScanCBs_t* pCBs);
432 bStatus_t ugap_scanRequest(uint8_t scanChanMap, uint16_t scanWindow, uint16_t scanInterval);
436 #if defined(FEATURE_MONITOR) ugapMonitorCompleteCb_t pfnMonitorCompleteCB
Notification of monitoring scan complete.
Definition: ugap.h:282
bStatus_t ugap_bcastInit(ugapBcastCBs_t *pCBs)
Initialize Micro Broadcaster.
bStatus_t ugap_bcastStop(void)
Stop Broadcaster. Proceed the state from either Advertising or Waiting to IDLE.
void(* ugapBcastAdvPrepareCb_t)(void)
Callback of when the next Advertising Event is about to start.
Definition: ugap.h:142
ugapMonitorStateChangeCb_t pfnStateChangeCB
State change notification.
Definition: ugap.h:280
ugapBcastAdvPrepareCb_t pfnAdvPrepareCB
Notification for Adv preperation.
Definition: ugap.h:157
uint8 ugapMonitorState_t
Monitor state.
Definition: ugap.h:242
bStatus_t ugap_bcastSetDuty(uint16 dutyOnTime, uint16 dutyOffTime)
Set Broadcaster Duty On/Off time.
bStatus_t ugap_monitorRequest(uint8_t channel, uint32_t accessAddr, uint32_t startTime, uint16_t duration)
uGAP monitor request
Set of Observer callbacks - must be setup by the application.
Definition: ugap.h:278
uint8 ugapBcastState_t
Broadcaster state.
Definition: ugap.h:122
bStatus_t ugap_monitorInit(ugapMonitorCBs_t *pCBs)
Initialize Micro Monitor.
void(* ugapMonitorCompleteCb_t)(bStatus_t status, uint8_t sessionId)
Callback of when a scan monitoring has just been done.
Definition: ugap.h:273
ugapMonitorIndicationCb_t pfnMonitorIndicationCB
Scan monitor indication with payload.
Definition: ugap.h:281
bStatus_t ugap_monitorStop(void)
Stop Monitor scanning. Proceed the state from Monitoring to Idle.
void(* ugapMonitorIndicationCb_t)(bStatus_t status, uint8_t sessionId, uint8_t len, uint8_t *pPayload)
Callback of when a packet is received.
Definition: ugap.h:265
Set of Broadcaster callbacks - must be setup by the application.
Definition: ugap.h:154
void(* ugapBcastAdvDoneCb_t)(bStatus_t status)
Callback of when an Advertising Event has just been done.
Definition: ugap.h:149
void(* ugapBcastStateChangeCb_t)(ugapBcastState_t state)
Callback of when the Broadcaster's state changes.
Definition: ugap.h:135
void(* ugapMonitorStateChangeCb_t)(ugapMonitorState_t state)
Callback of when the Monitor's state changes.
Definition: ugap.h:255
bStatus_t ugap_monitorStart(void)
Start Monitor scanning. Proceed the state from either Initialized or Idle to Monitoring.
ugapBcastStateChangeCb_t pfnStateChangeCB
State change notification.
Definition: ugap.h:156
Status_t bStatus_t
BLE Generic Status return.
Definition: bcomdef.h:227
ugapBcastAdvDoneCb_t pfnAdvDoneCB
Notification of Adv event done.
Definition: ugap.h:158
bStatus_t ugap_bcastStart(uint16 numAdvEvent)
Start Broadcaster. Proceed the state from either Initialized or IDLE to Advertising.