Firmware SDK
|
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... | |
Driver for CMWX1ZZABZ muRata LoRa modem.
Callback events.
Definition at line 26 of file twr_cmwx1zzabz.h.
bool twr_cmwx1zzabz_factory_reset | ( | twr_cmwx1zzabz_t * | self | ) |
Send factory reset command to LoRa Module.
[in] | self | Instance |
Definition at line 1451 of file twr_cmwx1zzabz.c.
bool twr_cmwx1zzabz_frame_counter | ( | twr_cmwx1zzabz_t * | self | ) |
Request frame counter value.
[in] | self | Instance |
Definition at line 1428 of file twr_cmwx1zzabz.c.
bool twr_cmwx1zzabz_get_adaptive_datarate | ( | twr_cmwx1zzabz_t * | self | ) |
Get the configuration if adaptive data rate are enabled.
[in] | self | Instance |
Definition at line 1354 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_get_appeui | ( | twr_cmwx1zzabz_t * | self, |
char * | appeui | ||
) |
Get APPEUI.
[in] | self | Instance |
[in] | appeui | Pointer to at least 16+1 character string |
Definition at line 1221 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_get_appkey | ( | twr_cmwx1zzabz_t * | self, |
char * | appkey | ||
) |
Get APPKEY.
[in] | self | Instance |
[in] | appkey | Pointer to at least 32+1 character string |
Definition at line 1257 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_get_appskey | ( | twr_cmwx1zzabz_t * | self, |
char * | appskey | ||
) |
Get APPSKEY.
[in] | self | Instance |
[in] | appskey | Pointer to at least 32+1 character string |
Definition at line 1245 of file twr_cmwx1zzabz.c.
twr_cmwx1zzabz_config_band_t twr_cmwx1zzabz_get_band | ( | twr_cmwx1zzabz_t * | self | ) |
Get BAND.
[in] | self | Instance |
Definition at line 1269 of file twr_cmwx1zzabz.c.
twr_cmwx1zzabz_config_class_t twr_cmwx1zzabz_get_class | ( | twr_cmwx1zzabz_t * | self | ) |
Get device class.
[in] | self | Instance |
Definition at line 1293 of file twr_cmwx1zzabz.c.
uint8_t twr_cmwx1zzabz_get_datarate | ( | twr_cmwx1zzabz_t * | self | ) |
Get the configuration of datarate.
[in] | self | Instance |
Definition at line 1366 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_get_devaddr | ( | twr_cmwx1zzabz_t * | self, |
char * | devaddr | ||
) |
Get DEVADDR.
[in] | self | Instance |
[in] | devaddr | Pointer to at least 8+1 character string |
Definition at line 1197 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_get_deveui | ( | twr_cmwx1zzabz_t * | self, |
char * | deveui | ||
) |
Get DEVEUI.
[in] | self | Instance |
[in] | deveui | Pointer to at least 16+1 character string. |
Definition at line 1209 of file twr_cmwx1zzabz.c.
char* twr_cmwx1zzabz_get_error_command | ( | twr_cmwx1zzabz_t * | self | ) |
Get pointer to string containg last sent command.
[in] | self | Instance |
Definition at line 1395 of file twr_cmwx1zzabz.c.
char* twr_cmwx1zzabz_get_error_response | ( | twr_cmwx1zzabz_t * | self | ) |
Get pointer to string containg response on last sent command.
[in] | self | Instance |
Definition at line 1400 of file twr_cmwx1zzabz.c.
bool twr_cmwx1zzabz_get_frame_counter | ( | twr_cmwx1zzabz_t * | self, |
uint32_t * | uplink, | ||
uint32_t * | downlink | ||
) |
Get frame counter value.
[in] | self | Instance |
[out] | uplink | Uplink frame counter |
[out] | downlink | Downlink frame counter |
Definition at line 1443 of file twr_cmwx1zzabz.c.
char* twr_cmwx1zzabz_get_fw_version | ( | twr_cmwx1zzabz_t * | self | ) |
Get firmware version string.
[in] | self | Instance |
Definition at line 1466 of file twr_cmwx1zzabz.c.
bool twr_cmwx1zzabz_get_link_check | ( | twr_cmwx1zzabz_t * | self, |
uint8_t * | margin, | ||
uint8_t * | gateway_count | ||
) |
Get link check values.
[in] | self | Instance |
[out] | margin | Margin id dBm |
[out] | gateway_count | Number of gateways that received link check packet |
Definition at line 1485 of file twr_cmwx1zzabz.c.
twr_cmwx1zzabz_config_mode_t twr_cmwx1zzabz_get_mode | ( | twr_cmwx1zzabz_t * | self | ) |
Get ABP/OTAA mode.
[in] | self | Instance |
Definition at line 1281 of file twr_cmwx1zzabz.c.
uint8_t twr_cmwx1zzabz_get_nwk_public | ( | twr_cmwx1zzabz_t * | self | ) |
Get the configuration if public networks are enabled.
[in] | self | Instance |
Definition at line 1342 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_get_nwkskey | ( | twr_cmwx1zzabz_t * | self, |
char * | nwkskey | ||
) |
Set NWKSKEY.
[in] | self | Instance |
[in] | nwkskey | Pointer to at least 32+1 character string |
Definition at line 1233 of file twr_cmwx1zzabz.c.
uint8_t twr_cmwx1zzabz_get_port | ( | twr_cmwx1zzabz_t * | self | ) |
Get the port for the transmission of the messages.
[in] | self | Instance |
Definition at line 1185 of file twr_cmwx1zzabz.c.
uint32_t twr_cmwx1zzabz_get_received_message_data | ( | twr_cmwx1zzabz_t * | self, |
uint8_t * | buffer, | ||
uint32_t | buffer_size | ||
) |
Get received message data.
[in] | self | Instance |
[in] | buffer | Destination buffer for received data |
[in] | buffer_size | Size of the destination buffer |
Definition at line 1308 of file twr_cmwx1zzabz.c.
uint32_t twr_cmwx1zzabz_get_received_message_length | ( | twr_cmwx1zzabz_t * | self | ) |
Get length of the received message.
[in] | self | Instance |
Definition at line 1303 of file twr_cmwx1zzabz.c.
uint8_t twr_cmwx1zzabz_get_received_message_port | ( | twr_cmwx1zzabz_t * | self | ) |
Get port of the received message.
[in] | self | Instance |
Definition at line 1298 of file twr_cmwx1zzabz.c.
uint8_t twr_cmwx1zzabz_get_repeat_confirmed | ( | twr_cmwx1zzabz_t * | self | ) |
Get number of transmissions of confirmed message.
[in] | self | Instance |
Definition at line 1390 of file twr_cmwx1zzabz.c.
uint8_t twr_cmwx1zzabz_get_repeat_unconfirmed | ( | twr_cmwx1zzabz_t * | self | ) |
Get number of transmissions of unconfirmed message.
[in] | self | Instance |
Definition at line 1378 of file twr_cmwx1zzabz.c.
bool twr_cmwx1zzabz_get_rfq | ( | twr_cmwx1zzabz_t * | self, |
int32_t * | rssi, | ||
int32_t * | snr | ||
) |
Get RF quality values in callback.
[in] | self | Instance |
[out] | rssi | RSSI |
[out] | snr | SNR |
Definition at line 1420 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_get_rx2 | ( | twr_cmwx1zzabz_t * | self, |
uint32_t * | frequency, | ||
uint8_t * | datarate | ||
) |
Get the frequency and datarate for RX2 receive window.
[in] | self | Instance |
[in] | frequency | Pointer to save frequency in Hz |
[in] | datarate | Pointer to save datarate |
Definition at line 1329 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_init | ( | twr_cmwx1zzabz_t * | self, |
twr_uart_channel_t | uart_channel | ||
) |
Initialize CMWX1ZZABZ.
[in] | self | Instance |
[in] | uart_channel | UART channel where TX and RX signals are connected |
Definition at line 65 of file twr_cmwx1zzabz.c.
bool twr_cmwx1zzabz_is_ready | ( | twr_cmwx1zzabz_t * | self | ) |
Check if modem is ready for commands.
[in] | self | Instance |
Definition at line 102 of file twr_cmwx1zzabz.c.
Referenced by twr_cmwx1zzabz_send_message(), and twr_cmwx1zzabz_send_message_confirmed().
void twr_cmwx1zzabz_join | ( | twr_cmwx1zzabz_t * | self | ) |
Start LoRa OTAA join procedure.
[in] | self | Instance |
Definition at line 1174 of file twr_cmwx1zzabz.c.
bool twr_cmwx1zzabz_link_check | ( | twr_cmwx1zzabz_t * | self | ) |
Request send of link check packet.
[in] | self | Instance |
Definition at line 1471 of file twr_cmwx1zzabz.c.
bool twr_cmwx1zzabz_rfq | ( | twr_cmwx1zzabz_t * | self | ) |
Request RF quality of the last received packet (JOIN, LNPARAM, confirmed message)
[in] | self | Instance |
Definition at line 1405 of file twr_cmwx1zzabz.c.
bool twr_cmwx1zzabz_send_message | ( | twr_cmwx1zzabz_t * | self, |
const void * | buffer, | ||
size_t | length | ||
) |
Send LoRa message.
[in] | self | Instance |
[in] | buffer | Pointer to data to be transmitted |
[in] | length | Length of data to be transmitted in bytes (must be from 1 to 51 bytes) |
Definition at line 112 of file twr_cmwx1zzabz.c.
bool twr_cmwx1zzabz_send_message_confirmed | ( | twr_cmwx1zzabz_t * | self, |
const void * | buffer, | ||
size_t | length | ||
) |
Send LoRa confirmed message.
[in] | self | Instance |
[in] | buffer | Pointer to data to be transmitted |
[in] | length | Length of data to be transmitted in bytes (must be from 1 to 51 bytes) |
Definition at line 130 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_adaptive_datarate | ( | twr_cmwx1zzabz_t * | self, |
bool | enable | ||
) |
Set the configuration adaptive data rate.
[in] | self | Instance |
[in] | public | enable or disable adaptive data rate |
Definition at line 1347 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_appeui | ( | twr_cmwx1zzabz_t * | self, |
char * | appeui | ||
) |
Set APPEUI.
[in] | self | Instance |
[in] | appeui | Pointer to 16 character string |
Definition at line 1214 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_appkey | ( | twr_cmwx1zzabz_t * | self, |
char * | appkey | ||
) |
Set APPKEY.
[in] | self | Instance |
[in] | appkey | Pointer to 32 character string |
Definition at line 1250 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_appskey | ( | twr_cmwx1zzabz_t * | self, |
char * | appskey | ||
) |
Set APPSKEY.
[in] | self | Instance |
[in] | appskey | Pointer to 32 character string |
Definition at line 1238 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_band | ( | twr_cmwx1zzabz_t * | self, |
twr_cmwx1zzabz_config_band_t | band | ||
) |
Set BAND.
[in] | self | Instance |
[in] | band | Set correct frequency and modulation for EU, US and other countries |
Definition at line 1262 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_class | ( | twr_cmwx1zzabz_t * | self, |
twr_cmwx1zzabz_config_class_t | class | ||
) |
Set device class.
[in] | self | Instance |
[in] | class | Supported are Class A and C |
Definition at line 1286 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_datarate | ( | twr_cmwx1zzabz_t * | self, |
uint8_t | datarate | ||
) |
Set the configuration of datarate.
[in] | self | Instance |
[in] | datarate | Datarate |
Definition at line 1359 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_debug | ( | twr_cmwx1zzabz_t * | self, |
bool | debug | ||
) |
Set debugging flag which prints modem communication to twr_log.
[in] | self | Instance |
[in] | debug | Boolean value |
Definition at line 148 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_devaddr | ( | twr_cmwx1zzabz_t * | self, |
char * | devaddr | ||
) |
Set DEVADDR.
[in] | self | Instance |
[in] | devaddr | Pointer to 8 character string |
Definition at line 1190 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_deveui | ( | twr_cmwx1zzabz_t * | self, |
char * | deveui | ||
) |
Set DEVEUI.
[in] | self | Instance |
[in] | deveui | Pointer 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.
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.
[in] | self | Instance |
[in] | event_handler | Function address |
[in] | event_param | Optional event parameter (can be NULL) |
Definition at line 96 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_mode | ( | twr_cmwx1zzabz_t * | self, |
twr_cmwx1zzabz_config_mode_t | mode | ||
) |
Set ABP/OTAA mode.
[in] | self | Instance |
[in] | mode | ABP or OTAA mode |
Definition at line 1274 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_nwk_public | ( | twr_cmwx1zzabz_t * | self, |
uint8_t | public | ||
) |
Set the configuration enabling public networks.
[in] | self | Instance |
[in] | public | enable public networks |
Definition at line 1335 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_nwkskey | ( | twr_cmwx1zzabz_t * | self, |
char * | nwkskey | ||
) |
Set NWKSKEY.
[in] | self | Instance |
[in] | nwkskey | Pointer to 32 character string |
Definition at line 1226 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_port | ( | twr_cmwx1zzabz_t * | self, |
uint8_t | port | ||
) |
Set the port for the transmission of the messages.
[in] | self | Instance |
[in] | port | Port |
Definition at line 1180 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_repeat_confirmed | ( | twr_cmwx1zzabz_t * | self, |
uint8_t | repeat | ||
) |
Set number of transmissions of confirmed message.
[in] | self | Instance |
[in] | repeat | Number of transmissions |
Definition at line 1383 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_repeat_unconfirmed | ( | twr_cmwx1zzabz_t * | self, |
uint8_t | repeat | ||
) |
Set number of transmissions of unconfirmed message.
[in] | self | Instance |
[in] | repeat | Number of transmissions |
Definition at line 1371 of file twr_cmwx1zzabz.c.
void twr_cmwx1zzabz_set_rx2 | ( | twr_cmwx1zzabz_t * | self, |
uint32_t | frequency, | ||
uint8_t | datarate | ||
) |
Set the frequency and datarate for RX2 receive window.
[in] | self | Instance |
[in] | frequency | Frequency in Hz |
[in] | datarate | Datarate |
Definition at line 1320 of file twr_cmwx1zzabz.c.