1#ifndef LORAWAN_HANDLER_H
2#define LORAWAN_HANDLER_H
17#define LORA_SPI_HOST SPI2_HOST
21#define LORA_PIN_MISO 19
25#define LORA_PIN_MOSI 27
37#define LORA_PIN_RST 23
41#define LORA_PIN_DIO0 26
45#define LORA_PIN_DIO1 33
49#define LORA_PIN_DIO2 32
56#define LORA_FREQUENCY 868100000
57#define LORA_SPREADING_FACTOR 7
58#define LORA_BANDWIDTH 0
59#define LORA_CODING_RATE 1
60#define LORA_TX_POWER 20
124esp_err_t
lorawan_send(uint8_t port,
const uint8_t* data, uint8_t len,
bool confirmed);
void(* lorawan_tx_done_cb_t)(bool success)
Definition lorawan_handler.h:76
int lorawan_send(uint8_t port, const uint8_t *data, uint8_t len, bool confirmed)
Send data uplink to TTN.
lorawan_status_t
Definition lorawan_handler.h:66
@ LORAWAN_STATUS_JOINING
Definition lorawan_handler.h:68
@ LORAWAN_STATUS_IDLE
Definition lorawan_handler.h:67
@ LORAWAN_STATUS_TX_COMPLETE
Definition lorawan_handler.h:71
@ LORAWAN_STATUS_SENDING
Definition lorawan_handler.h:70
@ LORAWAN_STATUS_ERROR
Definition lorawan_handler.h:72
@ LORAWAN_STATUS_JOINED
Definition lorawan_handler.h:69
void lorawan_set_tx_done_callback(lorawan_tx_done_cb_t callback)
Set callback for TX complete event.
void lorawan_process(void)
Process LoRaWAN events (call periodically from main loop)
lorawan_status_t lorawan_get_status(void)
Get current LoRaWAN status.
bool lorawan_is_joined(void)
Check if device has joined the network.
int lorawan_join(void)
Start OTAA join procedure.
int lorawan_init(void)
Initialize the LoRaWAN handler.
void lorawan_deinit(void)
Deinitialize LoRaWAN handler.