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 
57 #define DIRADV_MAX_ACK_LEN 102
58 
62 #define DIRADV_DEFAULT_QUEUE_TIME 250
63 
69 typedef struct
70 {
75  uint8_t ack_length;
79  uint8_t src_endpoint;
83  uint8_t dest_endpoint;
85  void * data;
87  size_t num_bytes;
89 
95 typedef struct
96 {
99  void * data;
102  uint8_t length;
104 
116 typedef bool (*app_llhead_acklistener_f)(const ack_gen_input_t * in,
117  ack_gen_output_t * out);
118 
129 typedef void (*app_lib_advertiser_ackdatacb_f)
131 
160 typedef app_res_e
162 
166 typedef struct
167 {
168  // If true, advertiser will follow the network in order to have valid target
169  // to send data to. If false, advertiser does not follow the network and
170  // should perform scan (service @ref app_lib_state_start_scan_nbors_f
171  // "lib_state->startScanNbors()") before sending data packets.
172  // Default value for this is false.
174 } adv_option_t;
175 
185 typedef app_res_e
187 
192 typedef struct
193 {
198 
199 #endif /* APP_LIB_ADVERTISER_H_ */
ack_gen_input_t::ack_length
uint8_t ack_length
Definition: wms_advertiser.h:75
adv_option_t
Option flags to be used with advertiser.
Definition: wms_advertiser.h:166
app_lib_advertiser_t::setOptions
app_lib_advertiser_set_options_f setOptions
Definition: wms_advertiser.h:196
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:161
wms_app.h
ack_gen_input_t::data
void * data
Definition: wms_advertiser.h:85
ack_gen_input_t::dest_endpoint
uint8_t dest_endpoint
Definition: wms_advertiser.h:83
ack_gen_output_t
Output structure for for callback function set by lib_advertiser->setRouterAckGenCb().
Definition: wms_advertiser.h:95
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:186
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:130
adv_option_t::follow_network
bool follow_network
Definition: wms_advertiser.h:173
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:87
ack_gen_output_t::length
uint8_t length
Definition: wms_advertiser.h:102
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:116
app_lib_advertiser_t
List of library functions.
Definition: wms_advertiser.h:192
ack_gen_input_t
Input data structure for callback function set by lib_advertiser->setRouterAckGenCb().
Definition: wms_advertiser.h:69
app_lib_advertiser_t::setQueuingTimeHp
app_lib_advertiser_set_queuing_time_f setQueuingTimeHp
Definition: wms_advertiser.h:195
app_lib_advertiser_t::setRouterAckGenCb
app_lib_advertiser_ackdatacb_f setRouterAckGenCb
Definition: wms_advertiser.h:194
ack_gen_input_t::sender
app_addr_t sender
Definition: wms_advertiser.h:72
ack_gen_input_t::src_endpoint
uint8_t src_endpoint
Definition: wms_advertiser.h:79