Firmware SDK
twr_cmwx1zzabz

Driver for CMWX1ZZABZ muRata LoRa modem. More...

Typedefs

typedef struct twr_cmwx1zzabz_t twr_cmwx1zzabz_t
 CMWX1ZZABZ instance.
 

Enumerations

enum  twr_cmwx1zzabz_event_t {
  TWR_CMWX1ZZABZ_EVENT_READY = 0,
  TWR_CMWX1ZZABZ_EVENT_ERROR = 1,
  TWR_CMWX1ZZABZ_EVENT_SEND_MESSAGE_START = 2,
  TWR_CMWX1ZZABZ_EVENT_SEND_MESSAGE_DONE = 3,
  TWR_CMWX1ZZABZ_EVENT_CONFIG_SAVE_DONE = 4,
  TWR_CMWX1ZZABZ_EVENT_JOIN_SUCCESS = 5,
  TWR_CMWX1ZZABZ_EVENT_JOIN_ERROR = 6,
  TWR_CMWX1ZZABZ_EVENT_MESSAGE_RECEIVED = 7,
  TWR_CMWX1ZZABZ_EVENT_MESSAGE_RETRANSMISSION = 8,
  TWR_CMWX1ZZABZ_EVENT_MESSAGE_CONFIRMED = 9,
  TWR_CMWX1ZZABZ_EVENT_MESSAGE_NOT_CONFIRMED = 10,
  TWR_CMWX1ZZABZ_EVENT_RFQ = 11,
  TWR_CMWX1ZZABZ_EVENT_FRAME_COUNTER = 12,
  TWR_CMWX1ZZABZ_EVENT_LINK_CHECK_OK = 13,
  TWR_CMWX1ZZABZ_EVENT_LINK_CHECK_NOK = 14,
  TWR_CMWX1ZZABZ_EVENT_MODEM_FACTORY_RESET = 15
}
 Callback events. More...
 
enum  twr_cmwx1zzabz_config_mode_t {
  TWR_CMWX1ZZABZ_CONFIG_MODE_ABP = 0,
  TWR_CMWX1ZZABZ_CONFIG_MODE_OTAA = 1
}
 LoRa mode ABP/OTAA.
 
enum  twr_cmwx1zzabz_config_band_t {
  TWR_CMWX1ZZABZ_CONFIG_BAND_AS923 = 0,
  TWR_CMWX1ZZABZ_CONFIG_BAND_AU915 = 1,
  TWR_CMWX1ZZABZ_CONFIG_BAND_EU868 = 5,
  TWR_CMWX1ZZABZ_CONFIG_BAND_KR920 = 6,
  TWR_CMWX1ZZABZ_CONFIG_BAND_IN865 = 7,
  TWR_CMWX1ZZABZ_CONFIG_BAND_US915 = 8
}
 Frequency modes and standards.
 
enum  twr_cmwx1zzabz_config_class_t {
  TWR_CMWX1ZZABZ_CONFIG_CLASS_A = 0,
  TWR_CMWX1ZZABZ_CONFIG_CLASS_C = 2
}
 LoRa device class A or C.
 
enum  twr_cmwx1zzabz_config_datarate_as923_t {
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AS923_SF12_125KHZ = 0,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AS923_SF11_125KHZ = 1,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AS923_SF10_125KHZ = 2,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AS923_SF9_125KHZ = 3,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AS923_SF8_125KHZ = 4,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AS923_SF7_125KHZ = 5,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AS923_SF7_250KHZ = 6,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AS923_FSK_50KBPS = 7
}
 Datarate for AS923.
 
enum  twr_cmwx1zzabz_config_datarate_au915_t {
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF12_125KHZ = 0,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF11_125KHZ = 1,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF10_125KHZ = 2,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF9_125KHZ = 3,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF8_125KHZ = 4,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF7_125KHZ = 5,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF8_500KHZ = 6,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF12_500KHZ = 8,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF11_500KHZ = 9,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF10_500KHZ = 10,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF9_500KHZ = 11,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF8_500KHZ_2 = 12,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_AU915_SF7_500KHZ = 13
}
 Datarate for AU915.
 
enum  twr_cmwx1zzabz_config_datarate_eu868_t {
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_EU868_SF12_125KHZ = 0,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_EU868_SF11_125KHZ = 1,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_EU868_SF10_125KHZ = 2,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_EU868_SF9_125KHZ = 3,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_EU868_SF8_125KHZ = 4,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_EU868_SF7_125KHZ = 5,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_EU868_SF7_250KHZ = 6,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_EU868_FSK_50KBPS = 7
}
 Datarate for EU868.
 
enum  twr_cmwx1zzabz_config_datarate_kr920_t {
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_KR920_SF12_125KHZ = 0,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_KR920_SF11_125KHZ = 1,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_KR920_SF10_125KHZ = 2,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_KR920_SF9_125KHZ = 3,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_KR920_SF8_125KHZ = 4,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_KR920_SF7_125KHZ = 5
}
 Datarate for KR920.
 
enum  twr_cmwx1zzabz_config_datarate_us915_t {
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_US915_SF10_125KHZ = 0,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_US915_SF9_125KHZ = 1,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_US915_SF8_125KHZ = 2,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_US915_SF7_125KHZ = 3,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_US915_SF8_500KHZ = 4,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_US915_SF12_500KHZ = 8,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_US915_SF11_500KHZ = 9,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_US915_SF10_500KHZ = 10,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_US915_SF9_500KHZ = 11,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_US915_SF8_500KHZ_2 = 12,
  TWR_CMWX1ZZABZ_CONFIG_DATARATE_US915_SF7_500KHZ = 13
}
 Datarate for US915.
 

Functions

void twr_cmwx1zzabz_init (twr_cmwx1zzabz_t *self, twr_uart_channel_t uart_channel)
 Initialize CMWX1ZZABZ. More...
 
void twr_cmwx1zzabz_set_event_handler (twr_cmwx1zzabz_t *self, void(*event_handler)(twr_cmwx1zzabz_t *, twr_cmwx1zzabz_event_t, void *), void *event_param)
 Set callback function. More...
 
bool twr_cmwx1zzabz_is_ready (twr_cmwx1zzabz_t *self)
 Check if modem is ready for commands. More...
 
bool twr_cmwx1zzabz_send_message (twr_cmwx1zzabz_t *self, const void *buffer, size_t length)
 Send LoRa message. More...
 
bool twr_cmwx1zzabz_send_message_confirmed (twr_cmwx1zzabz_t *self, const void *buffer, size_t length)
 Send LoRa confirmed message. More...
 
void twr_cmwx1zzabz_set_devaddr (twr_cmwx1zzabz_t *self, char *devaddr)
 Set DEVADDR. More...
 
void twr_cmwx1zzabz_get_devaddr (twr_cmwx1zzabz_t *self, char *devaddr)
 Get DEVADDR. More...
 
void twr_cmwx1zzabz_set_deveui (twr_cmwx1zzabz_t *self, char *deveui)
 Set DEVEUI. More...
 
void twr_cmwx1zzabz_get_deveui (twr_cmwx1zzabz_t *self, char *deveui)
 Get DEVEUI. More...
 
void twr_cmwx1zzabz_set_appeui (twr_cmwx1zzabz_t *self, char *appeui)
 Set APPEUI. More...
 
void twr_cmwx1zzabz_get_appeui (twr_cmwx1zzabz_t *self, char *appeui)
 Get APPEUI. More...
 
void twr_cmwx1zzabz_set_nwkskey (twr_cmwx1zzabz_t *self, char *nwkskey)
 Set NWKSKEY. More...
 
void twr_cmwx1zzabz_get_nwkskey (twr_cmwx1zzabz_t *self, char *nwkskey)
 Set NWKSKEY. More...
 
void twr_cmwx1zzabz_set_appskey (twr_cmwx1zzabz_t *self, char *appskey)
 Set APPSKEY. More...
 
void twr_cmwx1zzabz_get_appskey (twr_cmwx1zzabz_t *self, char *appskey)
 Get APPSKEY. More...
 
void twr_cmwx1zzabz_set_appkey (twr_cmwx1zzabz_t *self, char *appkey)
 Set APPKEY. More...
 
void twr_cmwx1zzabz_get_appkey (twr_cmwx1zzabz_t *self, char *appkey)
 Get APPKEY. More...
 
void twr_cmwx1zzabz_set_band (twr_cmwx1zzabz_t *self, twr_cmwx1zzabz_config_band_t band)
 Set BAND. More...
 
twr_cmwx1zzabz_config_band_t twr_cmwx1zzabz_get_band (twr_cmwx1zzabz_t *self)
 Get BAND. More...
 
void twr_cmwx1zzabz_set_mode (twr_cmwx1zzabz_t *self, twr_cmwx1zzabz_config_mode_t mode)
 Set ABP/OTAA mode. More...
 
twr_cmwx1zzabz_config_mode_t twr_cmwx1zzabz_get_mode (twr_cmwx1zzabz_t *self)
 Get ABP/OTAA mode. More...
 
void twr_cmwx1zzabz_set_class (twr_cmwx1zzabz_t *self, twr_cmwx1zzabz_config_class_t class)
 Set device class. More...
 
twr_cmwx1zzabz_config_class_t twr_cmwx1zzabz_get_class (twr_cmwx1zzabz_t *self)
 Get device class. More...
 
void twr_cmwx1zzabz_join (twr_cmwx1zzabz_t *self)
 Start LoRa OTAA join procedure. More...
 
uint8_t twr_cmwx1zzabz_get_received_message_port (twr_cmwx1zzabz_t *self)
 Get port of the received message. More...
 
uint32_t twr_cmwx1zzabz_get_received_message_length (twr_cmwx1zzabz_t *self)
 Get length of the received message. More...
 
uint32_t twr_cmwx1zzabz_get_received_message_data (twr_cmwx1zzabz_t *self, uint8_t *buffer, uint32_t buffer_size)
 Get received message data. More...
 
void twr_cmwx1zzabz_set_port (twr_cmwx1zzabz_t *self, uint8_t port)
 Set the port for the transmission of the messages. More...
 
uint8_t twr_cmwx1zzabz_get_port (twr_cmwx1zzabz_t *self)
 Get the port for the transmission of the messages. More...
 
void twr_cmwx1zzabz_set_rx2 (twr_cmwx1zzabz_t *self, uint32_t frequency, uint8_t datarate)
 Set the frequency and datarate for RX2 receive window. More...
 
void twr_cmwx1zzabz_get_rx2 (twr_cmwx1zzabz_t *self, uint32_t *frequency, uint8_t *datarate)
 Get the frequency and datarate for RX2 receive window. More...
 
void twr_cmwx1zzabz_set_nwk_public (twr_cmwx1zzabz_t *self, uint8_t public)
 Set the configuration enabling public networks. More...
 
uint8_t twr_cmwx1zzabz_get_nwk_public (twr_cmwx1zzabz_t *self)
 Get the configuration if public networks are enabled. More...
 
void twr_cmwx1zzabz_set_adaptive_datarate (twr_cmwx1zzabz_t *self, bool enable)
 Set the configuration adaptive data rate. More...
 
bool twr_cmwx1zzabz_get_adaptive_datarate (twr_cmwx1zzabz_t *self)
 Get the configuration if adaptive data rate are enabled. More...
 
void twr_cmwx1zzabz_set_datarate (twr_cmwx1zzabz_t *self, uint8_t datarate)
 Set the configuration of datarate. More...
 
uint8_t twr_cmwx1zzabz_get_datarate (twr_cmwx1zzabz_t *self)
 Get the configuration of datarate. More...
 
void twr_cmwx1zzabz_set_debug (twr_cmwx1zzabz_t *self, bool debug)
 Set debugging flag which prints modem communication to twr_log. More...
 
char * twr_cmwx1zzabz_get_error_command (twr_cmwx1zzabz_t *self)
 Get pointer to string containg last sent command. More...
 
char * twr_cmwx1zzabz_get_error_response (twr_cmwx1zzabz_t *self)
 Get pointer to string containg response on last sent command. More...
 
bool twr_cmwx1zzabz_rfq (twr_cmwx1zzabz_t *self)
 Request RF quality of the last received packet (JOIN, LNPARAM, confirmed message) More...
 
bool twr_cmwx1zzabz_get_rfq (twr_cmwx1zzabz_t *self, int32_t *rssi, int32_t *snr)
 Get RF quality values in callback. More...
 
bool twr_cmwx1zzabz_frame_counter (twr_cmwx1zzabz_t *self)
 Request frame counter value. More...
 
bool twr_cmwx1zzabz_get_frame_counter (twr_cmwx1zzabz_t *self, uint32_t *uplink, uint32_t *downlink)
 Get frame counter value. More...
 
bool twr_cmwx1zzabz_link_check (twr_cmwx1zzabz_t *self)
 Request send of link check packet. More...
 
bool twr_cmwx1zzabz_get_link_check (twr_cmwx1zzabz_t *self, uint8_t *margin, uint8_t *gateway_count)
 Get link check values. More...
 
bool twr_cmwx1zzabz_factory_reset (twr_cmwx1zzabz_t *self)
 Send factory reset command to LoRa Module. More...
 
char * twr_cmwx1zzabz_get_fw_version (twr_cmwx1zzabz_t *self)
 Get firmware version string. More...
 
void twr_cmwx1zzabz_set_repeat_unconfirmed (twr_cmwx1zzabz_t *self, uint8_t repeat)
 Set number of transmissions of unconfirmed message. More...
 
uint8_t twr_cmwx1zzabz_get_repeat_unconfirmed (twr_cmwx1zzabz_t *self)
 Get number of transmissions of unconfirmed message. More...
 
void twr_cmwx1zzabz_set_repeat_confirmed (twr_cmwx1zzabz_t *self, uint8_t repeat)
 Set number of transmissions of confirmed message. More...
 
uint8_t twr_cmwx1zzabz_get_repeat_confirmed (twr_cmwx1zzabz_t *self)
 Get number of transmissions of confirmed message. More...
 

Detailed Description

Driver for CMWX1ZZABZ muRata LoRa modem.

Enumeration Type Documentation

◆ twr_cmwx1zzabz_event_t

Callback events.

Enumerator
TWR_CMWX1ZZABZ_EVENT_READY 

Ready event.

TWR_CMWX1ZZABZ_EVENT_ERROR 

Error event.

TWR_CMWX1ZZABZ_EVENT_SEND_MESSAGE_START 

RF frame transmission started event.

TWR_CMWX1ZZABZ_EVENT_SEND_MESSAGE_DONE 

RF frame transmission finished event.

TWR_CMWX1ZZABZ_EVENT_CONFIG_SAVE_DONE 

Configuration save done.

TWR_CMWX1ZZABZ_EVENT_JOIN_SUCCESS 

OTAA join success.

TWR_CMWX1ZZABZ_EVENT_JOIN_ERROR 

OTAA join error.

TWR_CMWX1ZZABZ_EVENT_MESSAGE_RECEIVED 

Received message.

TWR_CMWX1ZZABZ_EVENT_MESSAGE_RETRANSMISSION 

Retransmission of the confirmed message.

TWR_CMWX1ZZABZ_EVENT_MESSAGE_CONFIRMED 

Sent message confirmed.

TWR_CMWX1ZZABZ_EVENT_MESSAGE_NOT_CONFIRMED 

Sent message not confirmed.

TWR_CMWX1ZZABZ_EVENT_RFQ 

RF quality response.

TWR_CMWX1ZZABZ_EVENT_FRAME_COUNTER 

Frame counter response.

Definition at line 26 of file twr_cmwx1zzabz.h.

Function Documentation

◆ twr_cmwx1zzabz_factory_reset()

bool twr_cmwx1zzabz_factory_reset ( twr_cmwx1zzabz_t self)

Send factory reset command to LoRa Module.

Parameters
[in]selfInstance

Definition at line 1451 of file twr_cmwx1zzabz.c.

Here is the call graph for this function:

◆ twr_cmwx1zzabz_frame_counter()

bool twr_cmwx1zzabz_frame_counter ( twr_cmwx1zzabz_t self)

Request frame counter value.

Parameters
[in]selfInstance

Definition at line 1428 of file twr_cmwx1zzabz.c.

Here is the call graph for this function:

◆ twr_cmwx1zzabz_get_adaptive_datarate()

bool twr_cmwx1zzabz_get_adaptive_datarate ( twr_cmwx1zzabz_t self)

Get the configuration if adaptive data rate are enabled.

Parameters
[in]selfInstance
Returns
public adaptive data rate enabled

Definition at line 1354 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_appeui()

void twr_cmwx1zzabz_get_appeui ( twr_cmwx1zzabz_t self,
char *  appeui 
)

Get APPEUI.

Parameters
[in]selfInstance
[in]appeuiPointer to at least 16+1 character string

Definition at line 1221 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_appkey()

void twr_cmwx1zzabz_get_appkey ( twr_cmwx1zzabz_t self,
char *  appkey 
)

Get APPKEY.

Parameters
[in]selfInstance
[in]appkeyPointer to at least 32+1 character string

Definition at line 1257 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_appskey()

void twr_cmwx1zzabz_get_appskey ( twr_cmwx1zzabz_t self,
char *  appskey 
)

Get APPSKEY.

Parameters
[in]selfInstance
[in]appskeyPointer to at least 32+1 character string

Definition at line 1245 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_band()

twr_cmwx1zzabz_config_band_t twr_cmwx1zzabz_get_band ( twr_cmwx1zzabz_t self)

Get BAND.

Parameters
[in]selfInstance
Returns
Band value

Definition at line 1269 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_class()

twr_cmwx1zzabz_config_class_t twr_cmwx1zzabz_get_class ( twr_cmwx1zzabz_t self)

Get device class.

Parameters
[in]selfInstance
Returns
Class A or C

Definition at line 1293 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_datarate()

uint8_t twr_cmwx1zzabz_get_datarate ( twr_cmwx1zzabz_t self)

Get the configuration of datarate.

Parameters
[in]selfInstance
Returns
datarate Datarate (see the enums)

Definition at line 1366 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_devaddr()

void twr_cmwx1zzabz_get_devaddr ( twr_cmwx1zzabz_t self,
char *  devaddr 
)

Get DEVADDR.

Parameters
[in]selfInstance
[in]devaddrPointer to at least 8+1 character string

Definition at line 1197 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_deveui()

void twr_cmwx1zzabz_get_deveui ( twr_cmwx1zzabz_t self,
char *  deveui 
)

Get DEVEUI.

Parameters
[in]selfInstance
[in]deveuiPointer to at least 16+1 character string.

Definition at line 1209 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_error_command()

char* twr_cmwx1zzabz_get_error_command ( twr_cmwx1zzabz_t self)

Get pointer to string containg last sent command.

Parameters
[in]selfInstance
Returns
Buffer char* containing last modem response

Definition at line 1395 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_error_response()

char* twr_cmwx1zzabz_get_error_response ( twr_cmwx1zzabz_t self)

Get pointer to string containg response on last sent command.

Parameters
[in]selfInstance
Returns
Buffer char* containing last modem response

Definition at line 1400 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_frame_counter()

bool twr_cmwx1zzabz_get_frame_counter ( twr_cmwx1zzabz_t self,
uint32_t *  uplink,
uint32_t *  downlink 
)

Get frame counter value.

Parameters
[in]selfInstance
[out]uplinkUplink frame counter
[out]downlinkDownlink frame counter
Returns
true

Definition at line 1443 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_fw_version()

char* twr_cmwx1zzabz_get_fw_version ( twr_cmwx1zzabz_t self)

Get firmware version string.

Parameters
[in]selfInstance
Returns
Pointer to the string containing version

Definition at line 1466 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_link_check()

bool twr_cmwx1zzabz_get_link_check ( twr_cmwx1zzabz_t self,
uint8_t *  margin,
uint8_t *  gateway_count 
)

Get link check values.

Parameters
[in]selfInstance
[out]marginMargin id dBm
[out]gateway_countNumber of gateways that received link check packet
Returns
true

Definition at line 1485 of file twr_cmwx1zzabz.c.

Here is the call graph for this function:

◆ twr_cmwx1zzabz_get_mode()

twr_cmwx1zzabz_config_mode_t twr_cmwx1zzabz_get_mode ( twr_cmwx1zzabz_t self)

Get ABP/OTAA mode.

Parameters
[in]selfInstance
Returns
ABP or OTAA mode

Definition at line 1281 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_nwk_public()

uint8_t twr_cmwx1zzabz_get_nwk_public ( twr_cmwx1zzabz_t self)

Get the configuration if public networks are enabled.

Parameters
[in]selfInstance
Returns
public networks enabled

Definition at line 1342 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_nwkskey()

void twr_cmwx1zzabz_get_nwkskey ( twr_cmwx1zzabz_t self,
char *  nwkskey 
)

Set NWKSKEY.

Parameters
[in]selfInstance
[in]nwkskeyPointer to at least 32+1 character string

Definition at line 1233 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_port()

uint8_t twr_cmwx1zzabz_get_port ( twr_cmwx1zzabz_t self)

Get the port for the transmission of the messages.

Parameters
[in]selfInstance
Returns
Port

Definition at line 1185 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_received_message_data()

uint32_t twr_cmwx1zzabz_get_received_message_data ( twr_cmwx1zzabz_t self,
uint8_t *  buffer,
uint32_t  buffer_size 
)

Get received message data.

Parameters
[in]selfInstance
[in]bufferDestination buffer for received data
[in]buffer_sizeSize of the destination buffer
Returns
Length of the received message. Zero if the destination buffer is not big enough.

Definition at line 1308 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_received_message_length()

uint32_t twr_cmwx1zzabz_get_received_message_length ( twr_cmwx1zzabz_t self)

Get length of the received message.

Parameters
[in]selfInstance
Returns
length

Definition at line 1303 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_received_message_port()

uint8_t twr_cmwx1zzabz_get_received_message_port ( twr_cmwx1zzabz_t self)

Get port of the received message.

Parameters
[in]selfInstance
Returns
port

Definition at line 1298 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_repeat_confirmed()

uint8_t twr_cmwx1zzabz_get_repeat_confirmed ( twr_cmwx1zzabz_t self)

Get number of transmissions of confirmed message.

Parameters
[in]selfInstance
Returns
Number of transmissions

Definition at line 1390 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_repeat_unconfirmed()

uint8_t twr_cmwx1zzabz_get_repeat_unconfirmed ( twr_cmwx1zzabz_t self)

Get number of transmissions of unconfirmed message.

Parameters
[in]selfInstance
Returns
Number of transmissions

Definition at line 1378 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_rfq()

bool twr_cmwx1zzabz_get_rfq ( twr_cmwx1zzabz_t self,
int32_t *  rssi,
int32_t *  snr 
)

Get RF quality values in callback.

Parameters
[in]selfInstance
[out]rssiRSSI
[out]snrSNR
Returns
true

Definition at line 1420 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_get_rx2()

void twr_cmwx1zzabz_get_rx2 ( twr_cmwx1zzabz_t self,
uint32_t *  frequency,
uint8_t *  datarate 
)

Get the frequency and datarate for RX2 receive window.

Parameters
[in]selfInstance
[in]frequencyPointer to save frequency in Hz
[in]dataratePointer to save datarate

Definition at line 1329 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_init()

void twr_cmwx1zzabz_init ( twr_cmwx1zzabz_t self,
twr_uart_channel_t  uart_channel 
)

Initialize CMWX1ZZABZ.

Parameters
[in]selfInstance
[in]uart_channelUART channel where TX and RX signals are connected

Definition at line 65 of file twr_cmwx1zzabz.c.

Here is the call graph for this function:

◆ twr_cmwx1zzabz_is_ready()

bool twr_cmwx1zzabz_is_ready ( twr_cmwx1zzabz_t self)

Check if modem is ready for commands.

Parameters
[in]selfInstance
Returns
true If ready
false If not ready

Definition at line 102 of file twr_cmwx1zzabz.c.

Referenced by twr_cmwx1zzabz_send_message(), and twr_cmwx1zzabz_send_message_confirmed().

Here is the caller graph for this function:

◆ twr_cmwx1zzabz_join()

void twr_cmwx1zzabz_join ( twr_cmwx1zzabz_t self)

Start LoRa OTAA join procedure.

Parameters
[in]selfInstance
Note
The output of the join is handled by callback events
See also
twr_cmwx1zzabz_event_t

Definition at line 1174 of file twr_cmwx1zzabz.c.

Here is the call graph for this function:

◆ twr_cmwx1zzabz_link_check()

bool twr_cmwx1zzabz_link_check ( twr_cmwx1zzabz_t self)

Request send of link check packet.

Parameters
[in]selfInstance

Definition at line 1471 of file twr_cmwx1zzabz.c.

Here is the call graph for this function:

◆ twr_cmwx1zzabz_rfq()

bool twr_cmwx1zzabz_rfq ( twr_cmwx1zzabz_t self)

Request RF quality of the last received packet (JOIN, LNPARAM, confirmed message)

Parameters
[in]selfInstance

Definition at line 1405 of file twr_cmwx1zzabz.c.

Here is the call graph for this function:

◆ twr_cmwx1zzabz_send_message()

bool twr_cmwx1zzabz_send_message ( twr_cmwx1zzabz_t self,
const void *  buffer,
size_t  length 
)

Send LoRa message.

Parameters
[in]selfInstance
[in]bufferPointer to data to be transmitted
[in]lengthLength of data to be transmitted in bytes (must be from 1 to 51 bytes)
Returns
true If command was accepted for processing
false If command was denied for processing

Definition at line 112 of file twr_cmwx1zzabz.c.

Here is the call graph for this function:

◆ twr_cmwx1zzabz_send_message_confirmed()

bool twr_cmwx1zzabz_send_message_confirmed ( twr_cmwx1zzabz_t self,
const void *  buffer,
size_t  length 
)

Send LoRa confirmed message.

Parameters
[in]selfInstance
[in]bufferPointer to data to be transmitted
[in]lengthLength of data to be transmitted in bytes (must be from 1 to 51 bytes)
Returns
true If command was accepted for processing
false If command was denied for processing

Definition at line 130 of file twr_cmwx1zzabz.c.

Here is the call graph for this function:

◆ twr_cmwx1zzabz_set_adaptive_datarate()

void twr_cmwx1zzabz_set_adaptive_datarate ( twr_cmwx1zzabz_t self,
bool  enable 
)

Set the configuration adaptive data rate.

Parameters
[in]selfInstance
[in]publicenable or disable adaptive data rate

Definition at line 1347 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_appeui()

void twr_cmwx1zzabz_set_appeui ( twr_cmwx1zzabz_t self,
char *  appeui 
)

Set APPEUI.

Parameters
[in]selfInstance
[in]appeuiPointer to 16 character string

Definition at line 1214 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_appkey()

void twr_cmwx1zzabz_set_appkey ( twr_cmwx1zzabz_t self,
char *  appkey 
)

Set APPKEY.

Parameters
[in]selfInstance
[in]appkeyPointer to 32 character string

Definition at line 1250 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_appskey()

void twr_cmwx1zzabz_set_appskey ( twr_cmwx1zzabz_t self,
char *  appskey 
)

Set APPSKEY.

Parameters
[in]selfInstance
[in]appskeyPointer to 32 character string

Definition at line 1238 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_band()

void twr_cmwx1zzabz_set_band ( twr_cmwx1zzabz_t self,
twr_cmwx1zzabz_config_band_t  band 
)

Set BAND.

Parameters
[in]selfInstance
[in]bandSet correct frequency and modulation for EU, US and other countries

Definition at line 1262 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_class()

void twr_cmwx1zzabz_set_class ( twr_cmwx1zzabz_t self,
twr_cmwx1zzabz_config_class_t  class 
)

Set device class.

Parameters
[in]selfInstance
[in]classSupported are Class A and C

Definition at line 1286 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_datarate()

void twr_cmwx1zzabz_set_datarate ( twr_cmwx1zzabz_t self,
uint8_t  datarate 
)

Set the configuration of datarate.

Parameters
[in]selfInstance
[in]datarateDatarate

Definition at line 1359 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_debug()

void twr_cmwx1zzabz_set_debug ( twr_cmwx1zzabz_t self,
bool  debug 
)

Set debugging flag which prints modem communication to twr_log.

Parameters
[in]selfInstance
[in]debugBoolean value

Definition at line 148 of file twr_cmwx1zzabz.c.

Here is the call graph for this function:

◆ twr_cmwx1zzabz_set_devaddr()

void twr_cmwx1zzabz_set_devaddr ( twr_cmwx1zzabz_t self,
char *  devaddr 
)

Set DEVADDR.

Parameters
[in]selfInstance
[in]devaddrPointer to 8 character string

Definition at line 1190 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_deveui()

void twr_cmwx1zzabz_set_deveui ( twr_cmwx1zzabz_t self,
char *  deveui 
)

Set DEVEUI.

Parameters
[in]selfInstance
[in]deveuiPointer to 16 character string. WARNING, this value should not be changed as it is unique number programmed in the factory!

Definition at line 1202 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_event_handler()

void twr_cmwx1zzabz_set_event_handler ( twr_cmwx1zzabz_t self,
void(*)(twr_cmwx1zzabz_t *, twr_cmwx1zzabz_event_t, void *)  event_handler,
void *  event_param 
)

Set callback function.

Parameters
[in]selfInstance
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)

Definition at line 96 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_mode()

void twr_cmwx1zzabz_set_mode ( twr_cmwx1zzabz_t self,
twr_cmwx1zzabz_config_mode_t  mode 
)

Set ABP/OTAA mode.

Parameters
[in]selfInstance
[in]modeABP or OTAA mode

Definition at line 1274 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_nwk_public()

void twr_cmwx1zzabz_set_nwk_public ( twr_cmwx1zzabz_t self,
uint8_t  public 
)

Set the configuration enabling public networks.

Parameters
[in]selfInstance
[in]publicenable public networks

Definition at line 1335 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_nwkskey()

void twr_cmwx1zzabz_set_nwkskey ( twr_cmwx1zzabz_t self,
char *  nwkskey 
)

Set NWKSKEY.

Parameters
[in]selfInstance
[in]nwkskeyPointer to 32 character string

Definition at line 1226 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_port()

void twr_cmwx1zzabz_set_port ( twr_cmwx1zzabz_t self,
uint8_t  port 
)

Set the port for the transmission of the messages.

Parameters
[in]selfInstance
[in]portPort

Definition at line 1180 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_repeat_confirmed()

void twr_cmwx1zzabz_set_repeat_confirmed ( twr_cmwx1zzabz_t self,
uint8_t  repeat 
)

Set number of transmissions of confirmed message.

Parameters
[in]selfInstance
[in]repeatNumber of transmissions

Definition at line 1383 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_repeat_unconfirmed()

void twr_cmwx1zzabz_set_repeat_unconfirmed ( twr_cmwx1zzabz_t self,
uint8_t  repeat 
)

Set number of transmissions of unconfirmed message.

Parameters
[in]selfInstance
[in]repeatNumber of transmissions

Definition at line 1371 of file twr_cmwx1zzabz.c.

◆ twr_cmwx1zzabz_set_rx2()

void twr_cmwx1zzabz_set_rx2 ( twr_cmwx1zzabz_t self,
uint32_t  frequency,
uint8_t  datarate 
)

Set the frequency and datarate for RX2 receive window.

Parameters
[in]selfInstance
[in]frequencyFrequency in Hz
[in]datarateDatarate

Definition at line 1320 of file twr_cmwx1zzabz.c.