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
30#define APP_LIB_ADVERTISER_VERSION 0x205
31
40#define DIRADV_EP_SRC_ACK 249
49#define DIRADV_EP_DEST 248
50
57#define DIRADV_MAX_ACK_LEN 102
58
62#define DIRADV_DEFAULT_QUEUE_TIME 250
63
69typedef struct
70{
75 uint8_t ack_length;
79 uint8_t src_endpoint;
85 void * data;
87 size_t num_bytes;
89
95typedef struct
96{
99 void * data;
102 uint8_t length;
104
116typedef bool (*app_llhead_acklistener_f)(const ack_gen_input_t * in,
117 ack_gen_output_t * out);
118
130 (app_llhead_acklistener_f callback);
131
161 (*app_lib_advertiser_set_queuing_time_f)(uint16_t time_ms);
162
166typedef 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.
175
187
198
199#endif /* APP_LIB_ADVERTISER_H_ */
bool(* app_llhead_acklistener_f)(const ack_gen_input_t *in, ack_gen_output_t *out)
Callback function type used with lib_advertiser->setRouterAckGenCb().
app_res_e(* app_lib_advertiser_set_options_f)(adv_option_t *option)
Set options for advertiser.
app_lib_advertiser_set_options_f setOptions
app_lib_advertiser_set_queuing_time_f setQueuingTimeHp
app_res_e(* app_lib_advertiser_set_queuing_time_f)(uint16_t time_ms)
Set maximum queueing time for advertiser data packets.
app_lib_advertiser_ackdatacb_f setRouterAckGenCb
app_addr_t sender
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...
Option flags to be used with advertiser.
List of library functions.
Input data structure for callback function set by lib_advertiser->setRouterAckGenCb().
Output structure for for callback function set by lib_advertiser->setRouterAckGenCb().
app_res_e
Definition wms_app.h:202
uint32_t app_addr_t
Definition wms_app.h:228