7#ifndef ZEPHYR_INCLUDE_LORAWAN_LORAWAN_H_
8#define ZEPHYR_INCLUDE_LORAWAN_LORAWAN_H_
163#define LW_RECV_PORT_ANY UINT16_MAX
375#ifdef CONFIG_LORAWAN_APP_CLOCK_SYNC
389int lorawan_clock_sync_run(
void);
403int lorawan_clock_sync_get(
uint32_t *gps_time);
407#ifdef CONFIG_LORAWAN_FRAG_TRANSPORT
421int lorawan_frag_transport_run(
void (*transport_finished_cb)(
void));
lorawan_channels_mask_size
LoRaWAN channels mask sizes.
Definition lorawan.h:47
int lorawan_set_conf_msg_tries(uint8_t tries)
Set the number of tries used for transmissions.
uint8_t(* lorawan_battery_level_cb_t)(void)
Defines the battery level callback handler function signature.
Definition lorawan.h:204
int lorawan_send(uint8_t port, uint8_t *data, uint8_t len, enum lorawan_message_type type)
Send data to the LoRaWAN network.
int lorawan_set_channels_mask(uint16_t *channels_mask, size_t channels_mask_size)
Set the channels mask.
lorawan_datarate
LoRaWAN datarate types.
Definition lorawan.h:63
lorawan_act_type
LoRaWAN activation types.
Definition lorawan.h:39
void lorawan_enable_adr(bool enable)
Enable Adaptive Data Rate (ADR)
void lorawan_register_dr_changed_callback(lorawan_dr_changed_cb_t cb)
Register a callback to be called when the datarate changes.
int lorawan_join(const struct lorawan_join_config *config)
Join the LoRaWAN network.
lorawan_message_type
LoRaWAN message types.
Definition lorawan.h:101
int lorawan_start(void)
Start the LoRaWAN stack.
enum lorawan_datarate lorawan_get_min_datarate(void)
Get the minimum possible datarate.
void(* lorawan_dr_changed_cb_t)(enum lorawan_datarate dr)
Defines the datarate changed callback handler function signature.
Definition lorawan.h:211
lorawan_class
LoRaWAN class types.
Definition lorawan.h:30
void lorawan_get_payload_sizes(uint8_t *max_next_payload_size, uint8_t *max_payload_size)
Get the current payload sizes.
void lorawan_register_battery_level_callback(lorawan_battery_level_cb_t cb)
Register a battery level callback function.
int lorawan_set_datarate(enum lorawan_datarate dr)
Set the default data rate.
int lorawan_set_region(enum lorawan_region region)
Set the region and frequency to be used.
void lorawan_register_downlink_callback(struct lorawan_downlink_cb *cb)
Register a callback to be run on downlink packets.
int lorawan_set_class(enum lorawan_class dev_class)
Set the current device class.
lorawan_region
LoRaWAN region types.
Definition lorawan.h:85
@ LORAWAN_CHANNELS_MASK_SIZE_US915
Region US915 mask size.
Definition lorawan.h:56
@ LORAWAN_CHANNELS_MASK_SIZE_AU915
Region AU915 mask size.
Definition lorawan.h:49
@ LORAWAN_CHANNELS_MASK_SIZE_CN470
Region CN470 mask size.
Definition lorawan.h:50
@ LORAWAN_CHANNELS_MASK_SIZE_EU433
Region EU433 mask size.
Definition lorawan.h:52
@ LORAWAN_CHANNELS_MASK_SIZE_EU868
Region EU868 mask size.
Definition lorawan.h:53
@ LORAWAN_CHANNELS_MASK_SIZE_AS923
Region AS923 mask size.
Definition lorawan.h:48
@ LORAWAN_CHANNELS_MASK_SIZE_KR920
Region KR920 mask size.
Definition lorawan.h:54
@ LORAWAN_CHANNELS_MASK_SIZE_CN779
Region CN779 mask size.
Definition lorawan.h:51
@ LORAWAN_CHANNELS_MASK_SIZE_IN865
Region IN865 mask size.
Definition lorawan.h:55
@ LORAWAN_CHANNELS_MASK_SIZE_RU864
Region RU864 mask size.
Definition lorawan.h:57
@ LORAWAN_DR_8
DR8 data rate.
Definition lorawan.h:72
@ LORAWAN_DR_5
DR5 data rate.
Definition lorawan.h:69
@ LORAWAN_DR_10
DR10 data rate.
Definition lorawan.h:74
@ LORAWAN_DR_12
DR12 data rate.
Definition lorawan.h:76
@ LORAWAN_DR_13
DR13 data rate.
Definition lorawan.h:77
@ LORAWAN_DR_14
DR14 data rate.
Definition lorawan.h:78
@ LORAWAN_DR_11
DR11 data rate.
Definition lorawan.h:75
@ LORAWAN_DR_15
DR15 data rate.
Definition lorawan.h:79
@ LORAWAN_DR_3
DR3 data rate.
Definition lorawan.h:67
@ LORAWAN_DR_0
DR0 data rate.
Definition lorawan.h:64
@ LORAWAN_DR_4
DR4 data rate.
Definition lorawan.h:68
@ LORAWAN_DR_2
DR2 data rate.
Definition lorawan.h:66
@ LORAWAN_DR_7
DR7 data rate.
Definition lorawan.h:71
@ LORAWAN_DR_6
DR6 data rate.
Definition lorawan.h:70
@ LORAWAN_DR_1
DR1 data rate.
Definition lorawan.h:65
@ LORAWAN_DR_9
DR9 data rate.
Definition lorawan.h:73
@ LORAWAN_ACT_ABP
Activation by Personalization (ABP)
Definition lorawan.h:41
@ LORAWAN_ACT_OTAA
Over-the-Air Activation (OTAA)
Definition lorawan.h:40
@ LORAWAN_MSG_CONFIRMED
Confirmed message.
Definition lorawan.h:103
@ LORAWAN_MSG_UNCONFIRMED
Unconfirmed message.
Definition lorawan.h:102
@ LORAWAN_CLASS_A
Class A device.
Definition lorawan.h:31
@ LORAWAN_CLASS_B
Class B device.
Definition lorawan.h:32
@ LORAWAN_CLASS_C
Class C device.
Definition lorawan.h:33
@ LORAWAN_REGION_AU915
Australia 915 MHz frequency band.
Definition lorawan.h:87
@ LORAWAN_REGION_EU868
Europe 868 MHz frequency band.
Definition lorawan.h:91
@ LORAWAN_REGION_CN470
China 470 MHz frequency band.
Definition lorawan.h:88
@ LORAWAN_REGION_AS923
Asia 923 MHz frequency band.
Definition lorawan.h:86
@ LORAWAN_REGION_US915
United States 915 MHz frequency band.
Definition lorawan.h:94
@ LORAWAN_REGION_IN865
India 865 MHz frequency band.
Definition lorawan.h:93
@ LORAWAN_REGION_EU433
Europe 433 MHz frequency band.
Definition lorawan.h:90
@ LORAWAN_REGION_RU864
Russia 864 MHz frequency band.
Definition lorawan.h:95
@ LORAWAN_REGION_CN779
China 779 MHz frequency band.
Definition lorawan.h:89
@ LORAWAN_REGION_KR920
South Korea 920 MHz frequency band.
Definition lorawan.h:92
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT8_TYPE__ int8_t
Definition stdint.h:72
__INT16_TYPE__ int16_t
Definition stdint.h:73
LoRaWAN downlink callback parameters.
Definition lorawan.h:168
uint16_t port
Port to handle messages for.
Definition lorawan.h:176
sys_snode_t node
Node for callback list.
Definition lorawan.h:194
void(* cb)(uint8_t port, bool data_pending, int16_t rssi, int8_t snr, uint8_t len, const uint8_t *data)
Callback function to run on downlink data.
Definition lorawan.h:190
LoRaWAN join parameters for activation by personalization (ABP)
Definition lorawan.h:134
uint8_t * app_eui
Application EUI.
Definition lorawan.h:142
uint8_t * app_skey
Application session key.
Definition lorawan.h:138
uint8_t * nwk_skey
Network session key.
Definition lorawan.h:140
uint32_t dev_addr
Device address on the network.
Definition lorawan.h:136
LoRaWAN join parameters.
Definition lorawan.h:148
struct lorawan_join_abp abp
ABP join parameters.
Definition lorawan.h:152
struct lorawan_join_otaa otaa
OTAA join parameters.
Definition lorawan.h:151
enum lorawan_act_type mode
Activation mode.
Definition lorawan.h:159
uint8_t * dev_eui
Device EUI.
Definition lorawan.h:156
LoRaWAN join parameters for over-the-Air activation (OTAA)
Definition lorawan.h:114
uint8_t * app_key
Application Key.
Definition lorawan.h:120
uint8_t * join_eui
Join EUI.
Definition lorawan.h:116
uint16_t dev_nonce
Device Nonce.
Definition lorawan.h:128
uint8_t * nwk_key
Network Key.
Definition lorawan.h:118
static fdata_t data[2]
Definition test_fifo_contexts.c:15