Using both confirmed and unconfirmed LoRa messages (WisBlock-API V2)

Using WisBlock-API V2, is there a way to send some LoRa messages that require acknowledgement from the gateway and others that do not? (For reference, I want to use unconfirmed messages to send sensor data and confirmed messages for alarms and a heartbeat to verify connection to the gateway.)

The send_lora_packet method doesn’t have a parameter for lmh_confirm, and always uses g_lorawan_settings.confirmed_msg_enabled with lmh_send internally.

I could change the value of g_lorawan_settings.confirmed_msg_enabled in the flash for each different type of message, but I’m worried that this would cause the flash storage to degrade quickly.

Can you think of an easy way to do this with Wisblock-API V2, or should I reimplement the send_lora_packet method in my own code for this case?

Thanks for your help.

typedef enum
{
	LMH_UNCONFIRMED_MSG = 0,
	LMH_CONFIRMED_MSG = !LMH_UNCONFIRMED_MSG
} lmh_confirm;

g_lorawan_settings.confirmed_msg_enabled is not in the Flash memory, it is a copy of the settings hold in RAM, so changing it, will not write to flash unless you call boolean save_settings(void).

You can replace lmh_error_status send_lora_packet(uint8_t *data, uint8_t size, uint8_t fport) with your own call to lmh_send() to change confirmed/unconfirmed dynamically as well.

That’s great.

Before I call send_lora_packet(uint8_t *data, uint8_t size, uint8_t fport),
I’ll set g_lorawan_settings.confirmed_msg_enabled equal to LMH_UNCONFIRMED_MSG or LMH_CONFIRMED_MSG as needed.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.