Wirepas SDK
wms_advertiser.h
Go to the documentation of this file.
1 /* Copyright 2018 Wirepas Ltd. All Rights Reserved.
2  *
3  * See file LICENSE.txt for full license details.
4  *
5  */
6 
18 #ifndef APP_LIB_ADVERTISER_H_
19 #define APP_LIB_ADVERTISER_H_
20 
21 #include <stdint.h>
22 #include <stdbool.h>
23 
24 #include "wms_app.h"
25 
27 #define APP_LIB_ADVERTISER_NAME 0x06cc5e24
28 
29 
30 #define APP_LIB_ADVERTISER_VERSION 0x205
31 
40 #define DIRADV_EP_SRC_ACK 249
41 
49 #define DIRADV_EP_DEST 248
50 
58 #define DIRADV_MAX_ACK_LEN 102
59 
64 #define DIRADV_DEFAULT_QUEUE_TIME 250
65 
71 typedef struct
72 {
77  uint8_t ack_length;
81  uint8_t src_endpoint;
85  uint8_t dest_endpoint;
87  void * data;
89  size_t num_bytes;
91 
97 typedef struct
98 {
101  void * data;
104  uint8_t length;
106 
118 typedef bool (*app_llhead_acklistener_f)(const ack_gen_input_t * in,
119  ack_gen_output_t * out);
120 
132 typedef void (*app_lib_advertiser_ackdatacb_f)
134 
167 typedef app_res_e
169 
173 typedef struct
174 {
175  // If true, advertiser will follow the network in order to have valid target
176  // to send data to. If false, advertiser does not follow the network and
177  // should perform scan (service @ref app_lib_state_start_scan_nbors_f
178  // "lib_state->startScanNbors()") before sending data packets.
179  // Default value for this is false.
181 } adv_option_t;
182 
192 typedef app_res_e
194 
199 typedef struct
200 {
205 
206 #endif /* APP_LIB_ADVERTISER_H_ */
ack_gen_input_t::ack_length
uint8_t ack_length
Definition: wms_advertiser.h:77
adv_option_t
Option flags to be used with advertiser.
Definition: wms_advertiser.h:173
app_lib_advertiser_t::setOptions
app_lib_advertiser_set_options_f setOptions
Definition: wms_advertiser.h:203
app_res_e
app_res_e
Definition: wms_app.h:201
app_lib_advertiser_set_queuing_time_f
app_res_e(* app_lib_advertiser_set_queuing_time_f)(uint16_t time_ms)
Set maximum queueing time for advertiser data packets.
Definition: wms_advertiser.h:168
wms_app.h
ack_gen_input_t::data
void * data
Definition: wms_advertiser.h:87
ack_gen_input_t::dest_endpoint
uint8_t dest_endpoint
Definition: wms_advertiser.h:85
ack_gen_output_t
Output structure for for callback function set by lib_advertiser->setRouterAckGenCb().
Definition: wms_advertiser.h:97
app_lib_advertiser_set_options_f
app_res_e(* app_lib_advertiser_set_options_f)(adv_option_t *option)
Set options for advertiser.
Definition: wms_advertiser.h:193
app_lib_advertiser_ackdatacb_f
void(* app_lib_advertiser_ackdatacb_f)(app_llhead_acklistener_f callback)
Sets callback function to be called when ack is generated as a response for advertiser device transmi...
Definition: wms_advertiser.h:133
adv_option_t::follow_network
bool follow_network
Definition: wms_advertiser.h:180
app_addr_t
uint32_t app_addr_t
Definition: wms_app.h:228
ack_gen_input_t::num_bytes
size_t num_bytes
Definition: wms_advertiser.h:89
ack_gen_output_t::length
uint8_t length
Definition: wms_advertiser.h:104
app_llhead_acklistener_f
bool(* app_llhead_acklistener_f)(const ack_gen_input_t *in, ack_gen_output_t *out)
Callback function type used with lib_advertiser->setRouterAckGenCb().
Definition: wms_advertiser.h:118
app_lib_advertiser_t
List of library functions.
Definition: wms_advertiser.h:199
ack_gen_input_t
Input data structure for callback function set by lib_advertiser->setRouterAckGenCb().
Definition: wms_advertiser.h:71
app_lib_advertiser_t::setQueuingTimeHp
app_lib_advertiser_set_queuing_time_f setQueuingTimeHp
Definition: wms_advertiser.h:202
app_lib_advertiser_t::setRouterAckGenCb
app_lib_advertiser_ackdatacb_f setRouterAckGenCb
Definition: wms_advertiser.h:201
ack_gen_input_t::sender
app_addr_t sender
Definition: wms_advertiser.h:74
ack_gen_input_t::src_endpoint
uint8_t src_endpoint
Definition: wms_advertiser.h:81