lriot 2.1.0.0
lr1110_modem_lorawan.h File Reference

LoRaWAN driver for LR1110 modem. More...

#include <stdbool.h>
#include <stdint.h>
#include "modem/lr1110_modem_lorawan_types.h"
#include "lriot.h"

Go to the source code of this file.

Functions

err_t lr1110_modem_get_event (lriot_t *ctx, lr1110_modem_event_fields_t *event_fields)
 This command can be used to retrieve pending events from the modem. Pending events are indicated by the EVENT line. The EVENT line will be de-asserted after all events have been retrieved and no further events are available. When no event is available this command returns with empty response payload.
 
err_t lr1110_modem_get_version (lriot_t *ctx, lr1110_modem_version_t *version)
 This command returns the version of the bootloader and the version of the installed firmware plus the version of the implemented LoRaWAN standard (BCD, e.g. 0x0103 for LoRaWAN 1.0.3).
 
err_t lr1110_modem_reset (lriot_t *ctx)
 This command performs a reset of the LR1110 modem. All transient state (including session information) will be lost and the modem needs to join the network again.
 
err_t lr1110_modem_reset_charge (lriot_t *ctx)
 This command resets the accumulated charge counter to zero.
 
err_t lr1110_modem_get_charge (lriot_t *ctx, uint32_t *charge)
 This command returns the total charge counter of the modem in mAh. This value includes the accumulated charge since the last reset of the modem or since the last invocation of the ResetCharge command.
 
err_t lr1110_modem_get_tx_power_offset (lriot_t *ctx, int8_t *tx_power_offset)
 This command gets the board-specific correction offset for transmission power to be used (signed integer in dB).
 
err_t lr1110_modem_set_tx_power_offset (lriot_t *ctx, int8_t tx_power_offset)
 This command sets the board-specific correction offset for transmission power to be used. The offset depends on the board design and antenna matching and is expressed in dB (signed integer).
 
err_t lr1110_modem_test_mode_start (lriot_t *ctx)
 This command is used to implement test functionality for regulatory conformance, certification, and functional testing. With the exception of the TST_START command, test commands are only available if test mode is active. Test mode can only be activated if the modem has not yet received a command that results in a radio operation. Once test mode is active, all other modem commands are disabled.
 
err_t lr1110_modem_test_nop (lriot_t *ctx)
 No operation. This command may be used to terminate an ongoing continuous TX operation.
 
err_t lr1110_modem_test_tx_single (lriot_t *ctx, uint32_t frequency, int8_t tx_power, lr1110_modem_tst_mode_sf_t sf, lr1110_modem_tst_mode_bw_t bw, lr1110_modem_tst_mode_cr_t cr, uint8_t payload_length)
 Transmit a single packet.
 
err_t lr1110_modem_test_tx_cont (lriot_t *ctx, uint32_t frequency, int8_t tx_power, lr1110_modem_tst_mode_sf_t sf, lr1110_modem_tst_mode_bw_t bw, lr1110_modem_tst_mode_cr_t cr, uint8_t payload_length)
 Continuously transmit packets as fast as possible.
 
err_t lr1110_modem_test_tx_cw (lriot_t *ctx, uint32_t frequency, int8_t tx_power)
 Transmit a continuous wave.
 
err_t lr1110_modem_test_rx_cont (lriot_t *ctx, uint32_t frequency, lr1110_modem_tst_mode_sf_t sf, lr1110_modem_tst_mode_bw_t bw, lr1110_modem_tst_mode_cr_t cr)
 Continuously receive packets.
 
err_t lr1110_modem_test_read_packet_counter_rx_cont (lriot_t *ctx, uint32_t *rx_packet_counter)
 Read the packet counter received during continuously receive packets test.
 
err_t lr1110_modem_test_rssi_subghz (lriot_t *ctx, uint32_t frequency, uint16_t time_ms, lr1110_modem_tst_mode_bw_t bw)
 Continuously receive packets on Sub-GHz radio path.
 
err_t lr1110_modem_test_radio_rst (lriot_t *ctx)
 Reset the LR1110 radio.
 
err_t lr1110_modem_test_exit (lriot_t *ctx)
 Exit test mode and reset LR1110 modem.
 
err_t lr1110_modem_test_tx_single_preamble (lriot_t *ctx, uint32_t frequency, int8_t tx_power, lr1110_modem_tst_mode_sf_t sf, lr1110_modem_tst_mode_bw_t bw, lr1110_modem_tst_mode_cr_t cr, uint8_t payload_length, uint16_t preamble_length)
 Transmit a single packet with the number of preamble configurable.
 
err_t lr1110_modem_test_read_rssi (lriot_t *ctx, int8_t *rssi)
 Read RSSI after a Sub Gig / 2.4 Ghz / GNSS test rssi command.
 
err_t lr1110_modem_test_rssi_2g4 (lriot_t *ctx, uint8_t channel, uint16_t time_ms, lr1110_modem_tst_mode_bw_t bw)
 Continuously receive packets on 2.4GHz radio path.
 
err_t lr1110_modem_test_rssi_gnss (lriot_t *ctx, lr1110_modem_tst_mode_constellation_t constellation_modulation, uint16_t time_ms, lr1110_modem_tst_mode_bw_t bw)
 Continuously receive packets on GNSS radio path.
 
err_t lr1110_modem_get_gps_time (lriot_t *ctx, uint32_t *time)
 Query the current GPS time. The application layer clock synchronization protocol is used to link the device clock to GPS time. The returned time specifies the seconds since GPS epoch (00:00:00, Sunday 6th of January 1980). If the device is not yet synchronized to GPS time then the returned value is zero. This may happen if the server has not yet answered time sync requests. The accuracy of the synchronization is in the range of seconds and depends on latencies in the network infrastructure.
 
err_t lr1110_modem_get_status (lriot_t *ctx, lr1110_modem_status_t *status)
 This command returns the modem status which may indicate one or more notification conditions.
 
err_t lr1110_modem_set_alarm_timer (lriot_t *ctx, uint32_t seconds)
 This command sets an application alarm timer (in seconds). When the timer has expired an Alarm event is generated. If this command is applied again before the timer has expired, the timer will be started again with the new period. A value of 0 will cancel an possibly pending previous alarm timer.
 
err_t lr1110_modem_get_pin (lriot_t *ctx, uint32_t *pin)
 This command returns the device registration PIN.
 
err_t lr1110_modem_get_chip_eui (lriot_t *ctx, lr1110_modem_chip_eui_t chip_eui)
 This command returns the ChipEUI. The ChipEUI is also the default DeviceEUI. It is programmed during manufacturing and is immutable.
 
err_t lr1110_modem_get_join_eui (lriot_t *ctx, lr1110_modem_join_eui_t join_eui)
 This command returns the join EUI.
 
err_t lr1110_modem_set_join_eui (lriot_t *ctx, lr1110_modem_join_eui_t join_eui)
 This command sets the Join EUI.
 
err_t lr1110_modem_get_dev_eui (lriot_t *ctx, lr1110_modem_dev_eui_t dev_eui)
 This command returns the DeviceEUI.
 
err_t lr1110_modem_set_dev_eui (lriot_t *ctx, lr1110_modem_dev_eui_t dev_eui)
 This command sets the DeviceEUI.
 
err_t lr1110_modem_set_app_key (lriot_t *ctx, lr1110_modem_app_key_t app_key)
 This command sets the LoRaWAN 1.0.3 application key. Note that a factory reset will erase this information. The device is required to rejoin the network.
 
err_t lr1110_modem_get_class (lriot_t *ctx, lr1110_modem_classes_t *modem_class)
 This command gets the LoRaWAN device class.
 
err_t lr1110_modem_set_class (lriot_t *ctx, lr1110_modem_classes_t modem_class)
 This command sets the LoRaWAN device class. Currently only class A and class C are supported. If the command is successful, a change from class A to class C is effective after a completed TX transaction. The network server should also be informed about the class change, typically on a separate channel for LoRaWAN 1.0.3. For a change from class C to class A, the RX remains enabled until the next TX transaction.
 
err_t lr1110_modem_get_region (lriot_t *ctx, lr1110_modem_regions_t *region)
 This command returns the regulatory region.
 
err_t lr1110_modem_set_region (lriot_t *ctx, lr1110_modem_regions_t region)
 This command sets the regulatory region. Additionally this command resets the ADR profile to Network Server Controlled. If different ADR profile is desired, the profile needs to be set again.
 
err_t lr1110_modem_list_regions (lriot_t *ctx, uint8_t *region_codes, uint8_t *region_codes_size)
 This command returns the regulatory regions supported by the LR1110 modem.
 
err_t lr1110_modem_get_adr_profile (lriot_t *ctx, lr1110_modem_adr_profiles_t *adr_profile)
 This command returns the ADR profile type.
 
err_t lr1110_modem_set_adr_profile (lriot_t *ctx, lr1110_modem_adr_profiles_t adr_profile, uint8_t *adr_custom_list)
 This command sets the ADR profile and parameters.
 
err_t lr1110_modem_get_dm_port (lriot_t *ctx, uint8_t *port)
 This command gets the device management port.
 
err_t lr1110_modem_set_dm_port (lriot_t *ctx, uint8_t port)
 This command sets the device management port. Port 0 and ports from 224 and 255 must not be used since they are reserved for future standardized application extensions.
 
err_t lr1110_modem_get_dm_info_interval (lriot_t *ctx, uint8_t *format, uint8_t *interval)
 This command returns the device management reporting interval. The interval is specified in seconds, minutes, hours or days.
 
err_t lr1110_modem_set_dm_info_interval (lriot_t *ctx, lr1110_modem_reporting_interval_format_t format, uint8_t interval)
 This command sets the device management reporting interval. The interval is specified in seconds, minutes, hours or days.
 
err_t lr1110_modem_get_dm_info_field (lriot_t *ctx, lr1110_modem_dm_info_fields_t *dm_info_fields)
 This command lists the info fields to be included in the periodic DM status messages.
 
err_t lr1110_modem_set_dm_info_field (lriot_t *ctx, lr1110_modem_dm_info_fields_t *dm_info_fields)
 This command sets the default info fields to be included in the periodic DM status messages. The set is specified as list of field codes as defined in Uplink Message Format. Duplicate and invalid fields will be rejected An empty set is valid and will effectively disable the DM status message.
 
err_t lr1110_modem_send_dm_status (lriot_t *ctx, lr1110_modem_dm_info_fields_t *dm_info_fields)
 This command sends the specified set of information fields in one or more DM status messages immediately. The set is specified as list of field codes as defined in Uplink Message Format. Duplicate and invalid fields will be rejected (see note in Periodic Status Reporting).
 
err_t lr1110_modem_set_app_status (lriot_t *ctx, uint8_t *app_status)
 This commands sets application-specific status information to be reported to the DM service. This information is an application-defined, arbitrary 8-byte data blob. Once set, it is included in the appstatus info field sent as part of the periodic status reports to the DM service. On the cloud side, this information can then be retrieved from the service.
 
err_t lr1110_modem_join (lriot_t *ctx)
 This command starts joining the network. During the join procedure no further transmissions can occur. When the network has been successfully joined, a Joined event is generated. If the device is already joined to a network, or is in the process of joining, this command has no effect.
 
err_t lr1110_modem_leave_network (lriot_t *ctx)
 This command leaves the network if already joined, or cancels an ongoing join process. After leaving the network, no further transmissions can occur.
 
err_t lr1110_modem_suspend (lriot_t *ctx, lr1110_modem_suspend_t suspend)
 This command temporarily suspends or resumes the modem’s radio operations. It can be used to prevent extra power consumption by the modem in case the application MCU temporarily needs more power itself and wants to prevent exceeding limits.
 
err_t lr1110_modem_get_next_tx_max_payload (lriot_t *ctx, uint8_t *tx_max_payload)
 This command returns the maximum application payload size possible according to the LoRaWAN regional parameters for the next transmission using the current data rate, while assuming no FOpts are present and that a device is not behind a repeater.
 
err_t lr1110_modem_request_tx (lriot_t *ctx, uint8_t port, lr1110_modem_uplink_type_t uplink_type, uint8_t *data_buf, uint8_t length)
 This command requests sending the given data on the specified port as an unconfirmed (0x00) or confirmed (0x01) frame. The request will be queued and the frame will be sent as soon as the current bandwidth usage of the regulatory region permits. A TxDone event is generated when the frame either has been sent, or if it couldn’t be sent because the specified data exceeded the maximum possible payload size.
 
err_t lr1110_modem_emergency_tx (lriot_t *ctx, uint8_t port, lr1110_modem_uplink_type_t uplink_type, uint8_t *data_buf, uint8_t length)
 This command sends the given data on the specified port as an unconfirmed (0x00) or confirmed (0x01) frame immediately. It has higher priority than all other services and does not take duty cycle or payload size restrictions into account.
 
err_t lr1110_modem_upload_init (lriot_t *ctx, uint8_t port, lr1110_modem_encryption_mode_t encryption_mode, uint16_t size, uint16_t interval)
 This command prepares a fragmented file upload. It specifies the port for the subsequent upload, optional encryption mode, file size, and average frame transmission interval (in seconds).
 
err_t lr1110_modem_upload_data (lriot_t *ctx, uint8_t *data_buf, uint8_t length)
 This command can be used to repeatedly set file data to be uploaded. The file data needs to be split into parts of maximum 255 bytes each and the submitted parts will be appended to an internal buffer. In total exactly as many bytes as specified by the UploadInit command have to be provided. The buffer allocated for file uploads is 8K bytes.
 
err_t lr1110_modem_upload_start (lriot_t *ctx, uint32_t crc)
 After all data bytes indicated to UploadInit have been provided using UploadData this command can be issued to actually start the transmission stream.
 
err_t lr1110_modem_stream_init (lriot_t *ctx, uint8_t port, lr1110_modem_encryption_mode_t encryption_mode)
 This command initializes redundant data streaming on a specific port. The StreamInit command can only be issued before the stream has been started using the SendStreamData command.
 
err_t lr1110_modem_send_stream_data (lriot_t *ctx, uint8_t port, uint8_t *record, uint8_t length)
 This command adds a new data record to the buffer of the data streaming encoder for the given port. Whenever the buffer contains data records, the modem autonomously retrieves data from the buffer, optionally encrypts it, adds redundancy, and sends uplinks containing the redundant stream.
 
err_t lr1110_modem_stream_status (lriot_t *ctx, uint8_t port, lr1110_modem_stream_status_t *stream_status)
 This command queries the status of the data streaming buffer on the specified port. It returns two unsigned 16 bit integer values indicating the number of bytes pending for transmission and the number of bytes still free in the buffer.
 
err_t lr1110_modem_set_gps_time (lriot_t *ctx, uint32_t gps_time)
 This commands sends the GPS time to LR1110 Modem, The time format is 4 bytes, big endian. It encodes the number of seconds from the 6-Jan 1980 00:00:00.
 
err_t lr1110_modem_derive_keys (lriot_t *ctx)
 Use the previously set of JoinEUI/DevEUI to derive the app keys used in the Semtech join server.
 
err_t lr1110_modem_set_rf_output (lriot_t *ctx, lr1110_modem_radio_pa_selection_t output)
 Configure rf output configuration.
 
err_t lr1110_modem_set_alc_sync_port (lriot_t *ctx, uint8_t port)
 Set the port for application layer clock synchronization.
 
err_t lr1110_modem_get_alc_sync_port (lriot_t *ctx, uint8_t *port)
 Get the port for application layer clock synchronization.
 
err_t lr1110_modem_set_alc_sync_mode (lriot_t *ctx, lr1110_modem_alc_sync_mode_t mode)
 Set the mode for application layer clock synchronization service.
 
err_t lr1110_modem_get_alc_sync_mode (lriot_t *ctx, lr1110_modem_alc_sync_mode_t *mode)
 Get the mode for application layer clock synchronization service.
 
err_t lr1110_modem_set_connection_timeout (lriot_t *ctx, uint16_t nb_uplink_mobile_static, uint16_t nb_uplink_reset)
 Set the number of uplink without ack from network before Modem changes it's ADR or resets.
 
err_t lr1110_modem_get_connection_timeout (lriot_t *ctx, uint16_t *nb_uplink_mobile_static, uint16_t *nb_uplink_reset)
 Get the number of uplink without ack from network before Modem changes it's ADR or resets.
 
err_t lr1110_modem_get_connection_timeout_status (lriot_t *ctx, uint16_t *nb_uplink_mobile_static, uint16_t *nb_uplink_reset)
 Get the status of the number of uplink without ack from network before Modem changes it's ADR or resets.
 
err_t lr1110_modem_get_lorawan_state (lriot_t *ctx, lr1110_modem_lorawan_state_t *lorawan_state)
 Returns the LoRaWAN state Idle or Not Idle.
 
err_t lr1110_modem_write_user_defined_charge_counter (lriot_t *ctx, uint16_t charge)
 Write a charge value to user defined charger counter.
 
err_t lr1110_modem_read_user_defined_charge_counter (lriot_t *ctx, uint16_t *charge)
 Read a charge value to user defined charger counter.
 
err_t lr1110_modem_select_charge_uplink (lriot_t *ctx, lr1110_modem_charge_type_t charge_type)
 Select which charge counter to send.
 
err_t lr1110_modem_get_duty_cycle_status (lriot_t *ctx, int32_t *duty_cycle)
 Get Duty cycle status info.
 
err_t lr1110_modem_activate_duty_cycle (lriot_t *ctx, lr1110_modem_duty_cycle_t duty_cycle)
 Activate/deactivate Duty cycle.
 
err_t lr1110_modem_set_certification_mode (lriot_t *ctx, lr1110_modem_certification_mode_t enable)
 Activate/deactivate the certification mode.
 
err_t lr1110_modem_get_certification_mode (lriot_t *ctx, lr1110_modem_certification_mode_t *enable)
 Get the certification mode.
 
err_t lr1110_modem_get_available_data_rate (lriot_t *ctx, uint16_t *available_data_rate)
 Get the available data rate mask. One bit indicates one data rate. Bit n = 1 mean Data Rate n is available.
 
err_t lr1110_modem_set_output_power_config (lriot_t *ctx, lr1110_modem_output_power_config_list_t output_power_config)
 This command sets 6 blocks (at most 6 dedicated power levels) of Tx output power configurations: expected power, configured power, PA, Tx parameters and PA ramp time. For the Tx power levels not defined in the 6 levels with this command, the modem always selects automatically the appropriate PA and Tx parameters configurations.
 
err_t lr1110_modem_get_output_power_config (lriot_t *ctx, lr1110_modem_output_power_config_list_t output_power_config)
 This command gets 6 blocks of Tx output power configurations: expected power, configured power, PA, Tx parameters and PA ramp time. For the Tx power levels not defined in the 6 levels with this command, the modem always selects automatically the appropriate PA and Tx parameters configurations.
 
err_t lr1110_modem_get_network_type (lriot_t *ctx, lr1110_modem_network_type_t *network_type)
 Get the LoRaWAN network type.
 
err_t lr1110_modem_set_network_type (lriot_t *ctx, lr1110_modem_network_type_t network_type)
 Set the LoRaWAN network type.
 
err_t lr1110_modem_activate_lbt (lriot_t *ctx, lr1110_modem_lbt_mode_t enable, int16_t threshold, uint32_t duration, uint32_t bandwidth)
 Activate the listen before talk.
 
err_t lr1110_modem_set_nb_trans (lriot_t *ctx, uint8_t nb_trans)
 Set the LoRaWAN number of retransmission.
 
err_t lr1110_modem_get_nb_trans (lriot_t *ctx, uint8_t *nb_trans)
 Get the LoRaWAN number of retransmission.
 
err_t lr1110_modem_set_stream_redundancy_rate (lriot_t *ctx, uint8_t stream_redundancy_rate)
 Set the stream redundancy rate.
 
err_t lr1110_modem_get_stream_redundancy_rate (lriot_t *ctx, uint8_t *stream_redundancy_rate)
 Get the stream redundancy rate.
 
err_t lr1110_modem_set_crystal_error (lriot_t *ctx, uint32_t crystal_error)
 Set the Crystal error of the MCU to fine adjust the rx window for lorawan ( ex: set 30 for a crystal error = 0.3% ).
 
err_t lr1110_modem_get_crystal_error (lriot_t *ctx, uint32_t *crystal_error)
 Get the Crystal error.
 

Detailed Description

LoRaWAN driver for LR1110 modem.

Revised BSD License Copyright Semtech Corporation 2020. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the Semtech corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ lr1110_modem_activate_duty_cycle()

err_t lr1110_modem_activate_duty_cycle ( lriot_t * ctx,
lr1110_modem_duty_cycle_t duty_cycle )

Activate/deactivate Duty cycle.

Parameters
[in]ctxChip implementation context
[in]duty_cyclelr1110_modem_duty_cycle_t
Returns
Operation status

◆ lr1110_modem_activate_lbt()

err_t lr1110_modem_activate_lbt ( lriot_t * ctx,
lr1110_modem_lbt_mode_t enable,
int16_t threshold,
uint32_t duration,
uint32_t bandwidth )

Activate the listen before talk.

Parameters
[in]ctxChip implementation context
[in]enablelr1110_modem_lbt_mode_t
[in]thresholdLBT treshold in dBm, default value is -80 dBm
[in]durationLBT duration in ms, default value is 5 ms
[in]bandwidthLBT bandwidth in Hz, default value is 200000 Hz
Returns
Operation status

◆ lr1110_modem_derive_keys()

err_t lr1110_modem_derive_keys ( lriot_t * ctx)

Use the previously set of JoinEUI/DevEUI to derive the app keys used in the Semtech join server.

Parameters
[in]ctxChip implementation context
Returns
Operation status

◆ lr1110_modem_emergency_tx()

err_t lr1110_modem_emergency_tx ( lriot_t * ctx,
uint8_t port,
lr1110_modem_uplink_type_t uplink_type,
uint8_t * data_buf,
uint8_t length )

This command sends the given data on the specified port as an unconfirmed (0x00) or confirmed (0x01) frame immediately. It has higher priority than all other services and does not take duty cycle or payload size restrictions into account.

Parameters
[in]ctxChip implementation context
[in]portLoRaWAN port
[in]uplink_typeUplink type unconfirmed (0x00) or confirmed (0x01) lr1110_modem_uplink_type_t
[in]data_bufData buffer
[in]lengthData length
Remarks
The application shall not use port 0 or the LoRaWAN test port 224 as well as the ports from 225 to 255 since they are reserved for future standardized application extensions.
Returns
Operation status

◆ lr1110_modem_get_adr_profile()

err_t lr1110_modem_get_adr_profile ( lriot_t * ctx,
lr1110_modem_adr_profiles_t * adr_profile )

This command returns the ADR profile type.

Parameters
[in]ctxChip implementation context
[out]adr_profileADR profile type lr1110_modem_adr_profiles_t
Returns
Operation status

◆ lr1110_modem_get_alc_sync_mode()

err_t lr1110_modem_get_alc_sync_mode ( lriot_t * ctx,
lr1110_modem_alc_sync_mode_t * mode )

Get the mode for application layer clock synchronization service.

Parameters
[in]ctxChip implementation context
[out]modeapplication layer clock mode
Returns
Operation status

◆ lr1110_modem_get_alc_sync_port()

err_t lr1110_modem_get_alc_sync_port ( lriot_t * ctx,
uint8_t * port )

Get the port for application layer clock synchronization.

Parameters
[in]ctxChip implementation context
[out]portPort application
Returns
Operation status

◆ lr1110_modem_get_available_data_rate()

err_t lr1110_modem_get_available_data_rate ( lriot_t * ctx,
uint16_t * available_data_rate )

Get the available data rate mask. One bit indicates one data rate. Bit n = 1 mean Data Rate n is available.

Parameters
[in]ctxChip implementation context
[out]available_data_rateAvailable data rate bit mask
Returns
Operation status

◆ lr1110_modem_get_certification_mode()

err_t lr1110_modem_get_certification_mode ( lriot_t * ctx,
lr1110_modem_certification_mode_t * enable )

Get the certification mode.

Parameters
[in]ctxChip implementation context
[out]enablelr1110_modem_certification_mode_t
Returns
Operation status

◆ lr1110_modem_get_charge()

err_t lr1110_modem_get_charge ( lriot_t * ctx,
uint32_t * charge )

This command returns the total charge counter of the modem in mAh. This value includes the accumulated charge since the last reset of the modem or since the last invocation of the ResetCharge command.

Parameters
[in]ctxChip implementation context
[out]chargeCharge counter in mAh
Returns
Operation status

◆ lr1110_modem_get_chip_eui()

err_t lr1110_modem_get_chip_eui ( lriot_t * ctx,
lr1110_modem_chip_eui_t chip_eui )

This command returns the ChipEUI. The ChipEUI is also the default DeviceEUI. It is programmed during manufacturing and is immutable.

Parameters
[in]ctxChip implementation context
[out]chip_euiChip EUI buffer on 8 bytes
Returns
Operation status

◆ lr1110_modem_get_class()

err_t lr1110_modem_get_class ( lriot_t * ctx,
lr1110_modem_classes_t * modem_class )

This command gets the LoRaWAN device class.

Parameters
[in]ctxChip implementation context
[out]modem_classLoRaWAN device class lr1110_modem_classes_t
Returns
Operation status

◆ lr1110_modem_get_connection_timeout()

err_t lr1110_modem_get_connection_timeout ( lriot_t * ctx,
uint16_t * nb_uplink_mobile_static,
uint16_t * nb_uplink_reset )

Get the number of uplink without ack from network before Modem changes it's ADR or resets.

Parameters
[in]ctxChip implementation context
[out]nb_uplink_mobile_staticnumber of uplink without ack from network before by then the modem adr profile will switch from mobile to static
[out]nb_uplink_resetnumber of uplink without ack from network before Modem resets
Returns
Operation status

◆ lr1110_modem_get_connection_timeout_status()

err_t lr1110_modem_get_connection_timeout_status ( lriot_t * ctx,
uint16_t * nb_uplink_mobile_static,
uint16_t * nb_uplink_reset )

Get the status of the number of uplink without ack from network before Modem changes it's ADR or resets.

Parameters
[in]ctxChip implementation context
[out]nb_uplink_mobile_staticnumber of uplink without ack from network before by then the modem adr profile will switch from mobile to static
[out]nb_uplink_resetnumber of uplink without ack from network before Modem resets
Returns
Operation status

◆ lr1110_modem_get_crystal_error()

err_t lr1110_modem_get_crystal_error ( lriot_t * ctx,
uint32_t * crystal_error )

Get the Crystal error.

Parameters
[in]ctxChip implementation context
[out]crystal_errorCrystal error
Returns
Operation status

◆ lr1110_modem_get_dev_eui()

err_t lr1110_modem_get_dev_eui ( lriot_t * ctx,
lr1110_modem_dev_eui_t dev_eui )

This command returns the DeviceEUI.

Parameters
[in]ctxChip implementation context
[out]dev_euiDevice EUI buffer on 8 bytes
Returns
Operation status

◆ lr1110_modem_get_dm_info_field()

err_t lr1110_modem_get_dm_info_field ( lriot_t * ctx,
lr1110_modem_dm_info_fields_t * dm_info_fields )

This command lists the info fields to be included in the periodic DM status messages.

Parameters
[in]ctxChip implementation context
[out]dm_info_fieldslist of tag bytes lr1110_modem_dm_info_fields_t
Returns
Operation status

◆ lr1110_modem_get_dm_info_interval()

err_t lr1110_modem_get_dm_info_interval ( lriot_t * ctx,
uint8_t * format,
uint8_t * interval )

This command returns the device management reporting interval. The interval is specified in seconds, minutes, hours or days.

Parameters
[in]ctxChip implementation context
[out]formatreporting interval format lr1110_modem_reporting_interval_format_t
[out]intervalinterval specified in seconds, minutes, hours or days
Returns
Operation status

◆ lr1110_modem_get_dm_port()

err_t lr1110_modem_get_dm_port ( lriot_t * ctx,
uint8_t * port )

This command gets the device management port.

Parameters
[in]ctxChip implementation context
[out]portDevice management port
Returns
Operation status

◆ lr1110_modem_get_duty_cycle_status()

err_t lr1110_modem_get_duty_cycle_status ( lriot_t * ctx,
int32_t * duty_cycle )

Get Duty cycle status info.

Parameters
[in]ctxChip implementation context
[out]duty_cycleTime in milliseconds (see notes for explanations)
Note
The sign determines the meaning of the value:
  • duty_cycle >= 0: duty_cycle is the time budget in millisecond still available for transmission
  • duty_cycle < 0: Abs(duty_cycle) is the time in millisecond before it can start transmitting again
When duty cycle is deactivated, the returned value is 0.
Returns
Operation status

◆ lr1110_modem_get_event()

err_t lr1110_modem_get_event ( lriot_t * ctx,
lr1110_modem_event_fields_t * event_fields )

This command can be used to retrieve pending events from the modem. Pending events are indicated by the EVENT line. The EVENT line will be de-asserted after all events have been retrieved and no further events are available. When no event is available this command returns with empty response payload.

Parameters
[in]ctxChip implementation context
[out]event_fields
See also
lr1110_modem_event_fields_t
Returns
Operation status

◆ lr1110_modem_get_gps_time()

err_t lr1110_modem_get_gps_time ( lriot_t * ctx,
uint32_t * time )

Query the current GPS time. The application layer clock synchronization protocol is used to link the device clock to GPS time. The returned time specifies the seconds since GPS epoch (00:00:00, Sunday 6th of January 1980). If the device is not yet synchronized to GPS time then the returned value is zero. This may happen if the server has not yet answered time sync requests. The accuracy of the synchronization is in the range of seconds and depends on latencies in the network infrastructure.

Parameters
[in]ctxChip implementation context
[out]timeTime in seconds
Returns
Operation status

◆ lr1110_modem_get_join_eui()

err_t lr1110_modem_get_join_eui ( lriot_t * ctx,
lr1110_modem_join_eui_t join_eui )

This command returns the join EUI.

Remarks
Join EUI is also known as Application Identifier (AppEUI) in LoRaWan v1.0.3.
Parameters
[in]ctxChip implementation context
[out]join_euiJoin EUI buffer on 8 bytes
Returns
Operation status

◆ lr1110_modem_get_lorawan_state()

err_t lr1110_modem_get_lorawan_state ( lriot_t * ctx,
lr1110_modem_lorawan_state_t * lorawan_state )

Returns the LoRaWAN state Idle or Not Idle.

Parameters
[in]ctxChip implementation context
[out]lorawan_stateLoRaWAN state lr1110_modem_lorawan_state_t
Returns
Operation status

◆ lr1110_modem_get_nb_trans()

err_t lr1110_modem_get_nb_trans ( lriot_t * ctx,
uint8_t * nb_trans )

Get the LoRaWAN number of retransmission.

Parameters
[in]ctxChip implementation context
[out]nb_transnumber of retransmission
Returns
Operation status

◆ lr1110_modem_get_network_type()

err_t lr1110_modem_get_network_type ( lriot_t * ctx,
lr1110_modem_network_type_t * network_type )

Get the LoRaWAN network type.

Parameters
[in]ctxChip implementation context
[out]network_typelr1110_modem_network_type_t
Returns
Operation status

◆ lr1110_modem_get_next_tx_max_payload()

err_t lr1110_modem_get_next_tx_max_payload ( lriot_t * ctx,
uint8_t * tx_max_payload )

This command returns the maximum application payload size possible according to the LoRaWAN regional parameters for the next transmission using the current data rate, while assuming no FOpts are present and that a device is not behind a repeater.

Parameters
[in]ctxChip implementation context
[out]tx_max_payloadMaximum application payload size possible
Returns
Operation status

◆ lr1110_modem_get_output_power_config()

err_t lr1110_modem_get_output_power_config ( lriot_t * ctx,
lr1110_modem_output_power_config_list_t output_power_config )

This command gets 6 blocks of Tx output power configurations: expected power, configured power, PA, Tx parameters and PA ramp time. For the Tx power levels not defined in the 6 levels with this command, the modem always selects automatically the appropriate PA and Tx parameters configurations.

Parameters
[in]ctxChip implementation context
[out]output_power_configTx output power configuration block list,
See also
lr1110_modem_output_power_config_list_t
Returns
Operation status

◆ lr1110_modem_get_pin()

err_t lr1110_modem_get_pin ( lriot_t * ctx,
uint32_t * pin )

This command returns the device registration PIN.

Parameters
[in]ctxChip implementation context
[out]pinDevice registration PIN on 4 bytes
Returns
Operation status

◆ lr1110_modem_get_region()

err_t lr1110_modem_get_region ( lriot_t * ctx,
lr1110_modem_regions_t * region )

This command returns the regulatory region.

Parameters
[in]ctxChip implementation context
[out]regionLoRaWAN regulatory region lr1110_modem_regions_t
Returns
Operation status

◆ lr1110_modem_get_status()

err_t lr1110_modem_get_status ( lriot_t * ctx,
lr1110_modem_status_t * status )

This command returns the modem status which may indicate one or more notification conditions.

Parameters
[in]ctxChip implementation context
[out]statusLR1110 mode status but mask lr1110_modem_status_t
Returns
Operation status

◆ lr1110_modem_get_stream_redundancy_rate()

err_t lr1110_modem_get_stream_redundancy_rate ( lriot_t * ctx,
uint8_t * stream_redundancy_rate )

Get the stream redundancy rate.

Parameters
[in]ctxChip implementation context
[out]stream_redundancy_rateStreaming redundancy rate
Returns
Operation status

◆ lr1110_modem_get_tx_power_offset()

err_t lr1110_modem_get_tx_power_offset ( lriot_t * ctx,
int8_t * tx_power_offset )

This command gets the board-specific correction offset for transmission power to be used (signed integer in dB).

Parameters
[in]ctxChip implementation context
[out]tx_power_offsetTx power offset correction in dBm
Returns
Operation status

◆ lr1110_modem_get_version()

err_t lr1110_modem_get_version ( lriot_t * ctx,
lr1110_modem_version_t * version )

This command returns the version of the bootloader and the version of the installed firmware plus the version of the implemented LoRaWAN standard (BCD, e.g. 0x0103 for LoRaWAN 1.0.3).

Parameters
[in]ctxChip implementation context
[out]versionVersion of the LR1110 modem
Returns
Operation status

◆ lr1110_modem_join()

err_t lr1110_modem_join ( lriot_t * ctx)

This command starts joining the network. During the join procedure no further transmissions can occur. When the network has been successfully joined, a Joined event is generated. If the device is already joined to a network, or is in the process of joining, this command has no effect.

Parameters
[in]ctxChip implementation context
Returns
Operation status

◆ lr1110_modem_leave_network()

err_t lr1110_modem_leave_network ( lriot_t * ctx)

This command leaves the network if already joined, or cancels an ongoing join process. After leaving the network, no further transmissions can occur.

Parameters
[in]ctxChip implementation context
Returns
Operation status

◆ lr1110_modem_list_regions()

err_t lr1110_modem_list_regions ( lriot_t * ctx,
uint8_t * region_codes,
uint8_t * region_codes_size )

This command returns the regulatory regions supported by the LR1110 modem.

Parameters
[in]ctxChip implementation context
[out]region_codesRegions supported by the LR1110 modem
[out]region_codes_sizesize of the regions list
Returns
Operation status

◆ lr1110_modem_read_user_defined_charge_counter()

err_t lr1110_modem_read_user_defined_charge_counter ( lriot_t * ctx,
uint16_t * charge )

Read a charge value to user defined charger counter.

Parameters
[in]ctxChip implementation context
[out]chargeuser defined charger counter
Returns
Operation status

◆ lr1110_modem_request_tx()

err_t lr1110_modem_request_tx ( lriot_t * ctx,
uint8_t port,
lr1110_modem_uplink_type_t uplink_type,
uint8_t * data_buf,
uint8_t length )

This command requests sending the given data on the specified port as an unconfirmed (0x00) or confirmed (0x01) frame. The request will be queued and the frame will be sent as soon as the current bandwidth usage of the regulatory region permits. A TxDone event is generated when the frame either has been sent, or if it couldn’t be sent because the specified data exceeded the maximum possible payload size.

Parameters
[in]ctxChip implementation context
[in]portLoRaWAN port
[in]uplink_typeUplink type unconfirmed (0x00) or confirmed (0x01) lr1110_modem_uplink_type_t
[in]data_bufData buffer
[in]lengthData length
Remarks
The application shall not use port 0 or the LoRaWAN test port 224 as well as the ports from 225 to 255 since they are reserved for future standardized application extensions.
Returns
Operation status

◆ lr1110_modem_reset()

err_t lr1110_modem_reset ( lriot_t * ctx)

This command performs a reset of the LR1110 modem. All transient state (including session information) will be lost and the modem needs to join the network again.

Parameters
[in]ctxChip implementation context
Returns
Operation status

◆ lr1110_modem_reset_charge()

err_t lr1110_modem_reset_charge ( lriot_t * ctx)

This command resets the accumulated charge counter to zero.

Parameters
[in]ctxChip implementation context
Returns
Operation status

◆ lr1110_modem_select_charge_uplink()

err_t lr1110_modem_select_charge_uplink ( lriot_t * ctx,
lr1110_modem_charge_type_t charge_type )

Select which charge counter to send.

Parameters
[in]ctxChip implementation context
[in]charge_typecharge type lr1110_modem_charge_type_t
Returns
Operation status

◆ lr1110_modem_send_dm_status()

err_t lr1110_modem_send_dm_status ( lriot_t * ctx,
lr1110_modem_dm_info_fields_t * dm_info_fields )

This command sends the specified set of information fields in one or more DM status messages immediately. The set is specified as list of field codes as defined in Uplink Message Format. Duplicate and invalid fields will be rejected (see note in Periodic Status Reporting).

Parameters
[in]ctxChip implementation context
[in]dm_info_fieldslist of tag bytes lr1110_modem_dm_info_fields_t
Returns
Operation status

◆ lr1110_modem_send_stream_data()

err_t lr1110_modem_send_stream_data ( lriot_t * ctx,
uint8_t port,
uint8_t * record,
uint8_t length )

This command adds a new data record to the buffer of the data streaming encoder for the given port. Whenever the buffer contains data records, the modem autonomously retrieves data from the buffer, optionally encrypts it, adds redundancy, and sends uplinks containing the redundant stream.

Parameters
[in]ctxChip implementation context
[in]portStreaming port
[in]recordFile data to be streamed
[in]lengthData length. The maximum length is 254 bytes.
Returns
Operation status

◆ lr1110_modem_set_adr_profile()

err_t lr1110_modem_set_adr_profile ( lriot_t * ctx,
lr1110_modem_adr_profiles_t adr_profile,
uint8_t * adr_custom_list )

This command sets the ADR profile and parameters.

Parameters
[in]ctxChip implementation context
[in]adr_profileADR profile type lr1110_modem_adr_profiles_t
[in]adr_custom_listcustom ADR profile consisting of a list of 16 preferred data rates
Remarks
each call to the function reinitialize the data rate distribution.
Returns
Operation status

◆ lr1110_modem_set_alarm_timer()

err_t lr1110_modem_set_alarm_timer ( lriot_t * ctx,
uint32_t seconds )

This command sets an application alarm timer (in seconds). When the timer has expired an Alarm event is generated. If this command is applied again before the timer has expired, the timer will be started again with the new period. A value of 0 will cancel an possibly pending previous alarm timer.

Parameters
[in]ctxChip implementation context
[in]secondsSeconds
Returns
Operation status

◆ lr1110_modem_set_alc_sync_mode()

err_t lr1110_modem_set_alc_sync_mode ( lriot_t * ctx,
lr1110_modem_alc_sync_mode_t mode )

Set the mode for application layer clock synchronization service.

Parameters
[in]ctxChip implementation context
[in]modeapplication layer clock mode
Returns
Operation status

◆ lr1110_modem_set_alc_sync_port()

err_t lr1110_modem_set_alc_sync_port ( lriot_t * ctx,
uint8_t port )

Set the port for application layer clock synchronization.

Parameters
[in]ctxChip implementation context
[in]portPort application
Returns
Operation status

◆ lr1110_modem_set_app_key()

err_t lr1110_modem_set_app_key ( lriot_t * ctx,
lr1110_modem_app_key_t app_key )

This command sets the LoRaWAN 1.0.3 application key. Note that a factory reset will erase this information. The device is required to rejoin the network.

Parameters
[in]ctxChip implementation context
[in]app_keyApplication Key buffer on 16 bytes
Returns
Operation status

◆ lr1110_modem_set_app_status()

err_t lr1110_modem_set_app_status ( lriot_t * ctx,
uint8_t * app_status )

This commands sets application-specific status information to be reported to the DM service. This information is an application-defined, arbitrary 8-byte data blob. Once set, it is included in the appstatus info field sent as part of the periodic status reports to the DM service. On the cloud side, this information can then be retrieved from the service.

Parameters
[in]ctxChip implementation context
[in]app_statusApplication-specific status information
Remarks
Note that this command does not trigger an immediate status report. If the application desires to send the status immediately, it can issue the SendDmStatus command with the appstatus tag. The application status is not stored persistently, i.e. after reset no application status will be reported.
Returns
Operation status

◆ lr1110_modem_set_certification_mode()

err_t lr1110_modem_set_certification_mode ( lriot_t * ctx,
lr1110_modem_certification_mode_t enable )

Activate/deactivate the certification mode.

Parameters
[in]ctxChip implementation context
[in]enablelr1110_modem_certification_mode_t
Returns
Operation status

◆ lr1110_modem_set_class()

err_t lr1110_modem_set_class ( lriot_t * ctx,
lr1110_modem_classes_t modem_class )

This command sets the LoRaWAN device class. Currently only class A and class C are supported. If the command is successful, a change from class A to class C is effective after a completed TX transaction. The network server should also be informed about the class change, typically on a separate channel for LoRaWAN 1.0.3. For a change from class C to class A, the RX remains enabled until the next TX transaction.

Parameters
[in]ctxChip implementation context
[in]modem_classLoRaWAN device class lr1110_modem_classes_t
Returns
Operation status

◆ lr1110_modem_set_connection_timeout()

err_t lr1110_modem_set_connection_timeout ( lriot_t * ctx,
uint16_t nb_uplink_mobile_static,
uint16_t nb_uplink_reset )

Set the number of uplink without ack from network before Modem changes it's ADR or resets.

Note
It is recommended to have the first counter smaller than the second one. The value 0 deactivate the recovery function. Default values are 255 for nb_uplink_mobile_static and 2400 for nb_uplink_reset.
Parameters
[in]ctxChip implementation context
[in]nb_uplink_mobile_staticnumber of uplink without ack from network before by then the modem adr profile will switch from mobile to static
[in]nb_uplink_resetnumber of uplink without ack from network before Modem resets
Returns
Operation status

◆ lr1110_modem_set_crystal_error()

err_t lr1110_modem_set_crystal_error ( lriot_t * ctx,
uint32_t crystal_error )

Set the Crystal error of the MCU to fine adjust the rx window for lorawan ( ex: set 30 for a crystal error = 0.3% ).

Parameters
[in]ctxChip implementation context
[out]crystal_errorCrystal error
Returns
Operation status

◆ lr1110_modem_set_dev_eui()

err_t lr1110_modem_set_dev_eui ( lriot_t * ctx,
lr1110_modem_dev_eui_t dev_eui )

This command sets the DeviceEUI.

Parameters
[in]ctxChip implementation context
[in]dev_euiDevice EUI buffer on 8 bytes
Returns
Operation status

◆ lr1110_modem_set_dm_info_field()

err_t lr1110_modem_set_dm_info_field ( lriot_t * ctx,
lr1110_modem_dm_info_fields_t * dm_info_fields )

This command sets the default info fields to be included in the periodic DM status messages. The set is specified as list of field codes as defined in Uplink Message Format. Duplicate and invalid fields will be rejected An empty set is valid and will effectively disable the DM status message.

Parameters
[in]ctxChip implementation context
[in]dm_info_fieldslist of tag bytes lr1110_modem_dm_info_fields_t
Returns
Operation status

◆ lr1110_modem_set_dm_info_interval()

err_t lr1110_modem_set_dm_info_interval ( lriot_t * ctx,
lr1110_modem_reporting_interval_format_t format,
uint8_t interval )

This command sets the device management reporting interval. The interval is specified in seconds, minutes, hours or days.

Parameters
[in]ctxChip implementation context
[in]formatreporting interval format lr1110_modem_reporting_interval_format_t
[in]intervalinterval specified in seconds, minutes, hours or days
Remarks
Any value of 0 (seconds, minutes, hours, or days) disables device management reporting. The periodic status reporting interval field is encoded in one byte where the two top-most bits specify the unit (sec/min/hour/day), and the lower six bits the value 0-63. A value of zero disables the periodic status reporting.
Returns
Operation status

◆ lr1110_modem_set_dm_port()

err_t lr1110_modem_set_dm_port ( lriot_t * ctx,
uint8_t port )

This command sets the device management port. Port 0 and ports from 224 and 255 must not be used since they are reserved for future standardized application extensions.

Parameters
[in]ctxChip implementation context
[in]portDevice management port
Returns
Operation status

◆ lr1110_modem_set_gps_time()

err_t lr1110_modem_set_gps_time ( lriot_t * ctx,
uint32_t gps_time )

This commands sends the GPS time to LR1110 Modem, The time format is 4 bytes, big endian. It encodes the number of seconds from the 6-Jan 1980 00:00:00.

Parameters
[in]ctxChip implementation context
[in]gps_timeGPS Time in seconds
Returns
Operation status

◆ lr1110_modem_set_join_eui()

err_t lr1110_modem_set_join_eui ( lriot_t * ctx,
lr1110_modem_join_eui_t join_eui )

This command sets the Join EUI.

Remarks
Join EUI is also known as Application Identifier (AppEUI) in LoRaWan v1.0.3.
Parameters
[in]ctxChip implementation context
[in]join_euiJoin EUI buffer on 8 bytes
Returns
Operation status

◆ lr1110_modem_set_nb_trans()

err_t lr1110_modem_set_nb_trans ( lriot_t * ctx,
uint8_t nb_trans )

Set the LoRaWAN number of retransmission.

Parameters
[in]ctxChip implementation context
[in]nb_transnumber of retransmission, the values are allowed between 0 and 15
Returns
Operation status

◆ lr1110_modem_set_network_type()

err_t lr1110_modem_set_network_type ( lriot_t * ctx,
lr1110_modem_network_type_t network_type )

Set the LoRaWAN network type.

Parameters
[in]ctxChip implementation context
[in]network_typelr1110_modem_network_type_t
Returns
Operation status

◆ lr1110_modem_set_output_power_config()

err_t lr1110_modem_set_output_power_config ( lriot_t * ctx,
lr1110_modem_output_power_config_list_t output_power_config )

This command sets 6 blocks (at most 6 dedicated power levels) of Tx output power configurations: expected power, configured power, PA, Tx parameters and PA ramp time. For the Tx power levels not defined in the 6 levels with this command, the modem always selects automatically the appropriate PA and Tx parameters configurations.

Parameters
[in]ctxChip implementation context
[in]output_power_configTx output power configuration block list,
See also
lr1110_modem_output_power_config_list_t
Returns
Operation status

◆ lr1110_modem_set_region()

err_t lr1110_modem_set_region ( lriot_t * ctx,
lr1110_modem_regions_t region )

This command sets the regulatory region. Additionally this command resets the ADR profile to Network Server Controlled. If different ADR profile is desired, the profile needs to be set again.

Parameters
[in]ctxChip implementation context
[in]regionLoRaWAN regulatory region lr1110_modem_regions_t
Returns
Operation status

◆ lr1110_modem_set_rf_output()

err_t lr1110_modem_set_rf_output ( lriot_t * ctx,
lr1110_modem_radio_pa_selection_t output )

Configure rf output configuration.

Parameters
[in]ctxChip implementation context
[in]outputRf output lr1110_modem_radio_pa_selection_t
Returns
Operation status

◆ lr1110_modem_set_stream_redundancy_rate()

err_t lr1110_modem_set_stream_redundancy_rate ( lriot_t * ctx,
uint8_t stream_redundancy_rate )

Set the stream redundancy rate.

Parameters
[in]ctxChip implementation context
[in]stream_redundancy_rateStreaming redundancy rate, the values are allowed between 0 and 110%
Returns
Operation status

◆ lr1110_modem_set_tx_power_offset()

err_t lr1110_modem_set_tx_power_offset ( lriot_t * ctx,
int8_t tx_power_offset )

This command sets the board-specific correction offset for transmission power to be used. The offset depends on the board design and antenna matching and is expressed in dB (signed integer).

Parameters
[in]ctxChip implementation context
[in]tx_power_offsetTx power offset correction in dBm
Returns
Operation status

◆ lr1110_modem_stream_init()

err_t lr1110_modem_stream_init ( lriot_t * ctx,
uint8_t port,
lr1110_modem_encryption_mode_t encryption_mode )

This command initializes redundant data streaming on a specific port. The StreamInit command can only be issued before the stream has been started using the SendStreamData command.

Parameters
[in]ctxChip implementation context
[in]portStreaming port
[in]encryption_modeEncryption mode lr1110_modem_encryption_mode_t
Returns
Operation status

◆ lr1110_modem_stream_status()

err_t lr1110_modem_stream_status ( lriot_t * ctx,
uint8_t port,
lr1110_modem_stream_status_t * stream_status )

This command queries the status of the data streaming buffer on the specified port. It returns two unsigned 16 bit integer values indicating the number of bytes pending for transmission and the number of bytes still free in the buffer.

Parameters
[in]ctxChip implementation context
[in]portStreaming port
[in]stream_statusStreaming status lr1110_modem_stream_status_t
Returns
Operation status

◆ lr1110_modem_suspend()

err_t lr1110_modem_suspend ( lriot_t * ctx,
lr1110_modem_suspend_t suspend )

This command temporarily suspends or resumes the modem’s radio operations. It can be used to prevent extra power consumption by the modem in case the application MCU temporarily needs more power itself and wants to prevent exceeding limits.

Parameters
[in]ctxChip implementation context
[in]suspendOperations are suspended with parameter value 0x01 and resumed with parameter value 0x00 lr1110_modem_suspend_t
Returns
Operation status

◆ lr1110_modem_test_exit()

err_t lr1110_modem_test_exit ( lriot_t * ctx)

Exit test mode and reset LR1110 modem.

Parameters
[in]ctxChip implementation context
Returns
Operation status

◆ lr1110_modem_test_mode_start()

err_t lr1110_modem_test_mode_start ( lriot_t * ctx)

This command is used to implement test functionality for regulatory conformance, certification, and functional testing. With the exception of the TST_START command, test commands are only available if test mode is active. Test mode can only be activated if the modem has not yet received a command that results in a radio operation. Once test mode is active, all other modem commands are disabled.

Parameters
[in]ctxChip implementation context
Returns
Operation status

◆ lr1110_modem_test_nop()

err_t lr1110_modem_test_nop ( lriot_t * ctx)

No operation. This command may be used to terminate an ongoing continuous TX operation.

Parameters
[in]ctxChip implementation context
Returns
Operation status

◆ lr1110_modem_test_radio_rst()

err_t lr1110_modem_test_radio_rst ( lriot_t * ctx)

Reset the LR1110 radio.

Parameters
[in]ctxChip implementation context
Returns
Operation status

◆ lr1110_modem_test_read_packet_counter_rx_cont()

err_t lr1110_modem_test_read_packet_counter_rx_cont ( lriot_t * ctx,
uint32_t * rx_packet_counter )

Read the packet counter received during continuously receive packets test.

Parameters
[in]ctxChip implementation context
[in]rx_packet_counterThe counter of packet received during RX continuous packet test
Returns
Operation status
See also
lr1110_modem_test_rx_cont

◆ lr1110_modem_test_read_rssi()

err_t lr1110_modem_test_read_rssi ( lriot_t * ctx,
int8_t * rssi )

Read RSSI after a Sub Gig / 2.4 Ghz / GNSS test rssi command.

Parameters
[in]ctxChip implementation context
[out]rssiRSSI in dBm
Returns
Operation status

◆ lr1110_modem_test_rssi_2g4()

err_t lr1110_modem_test_rssi_2g4 ( lriot_t * ctx,
uint8_t channel,
uint16_t time_ms,
lr1110_modem_tst_mode_bw_t bw )

Continuously receive packets on 2.4GHz radio path.

Parameters
[in]ctxChip implementation context
[in]channelWi-Fi Channel from 1 to 14
[in]time_mstime in millisecond of the radio acquisition
[in]bwbandwidth lr1110_modem_tst_mode_bw_t
Note
The allowed bandwidths are 12MHz and 24MH
Returns
Operation status

◆ lr1110_modem_test_rssi_gnss()

err_t lr1110_modem_test_rssi_gnss ( lriot_t * ctx,
lr1110_modem_tst_mode_constellation_t constellation_modulation,
uint16_t time_ms,
lr1110_modem_tst_mode_bw_t bw )

Continuously receive packets on GNSS radio path.

Parameters
[in]ctxChip implementation context
[in]constellation_modulationconstellation used lr1110_modem_tst_mode_constellation_t
[in]time_mstime in millisecond of the radio acquisition
[in]bwbandwidth lr1110_modem_tst_mode_bw_t
Note
The allowed bandwidth is 12MHz
Returns
Operation status

◆ lr1110_modem_test_rssi_subghz()

err_t lr1110_modem_test_rssi_subghz ( lriot_t * ctx,
uint32_t frequency,
uint16_t time_ms,
lr1110_modem_tst_mode_bw_t bw )

Continuously receive packets on Sub-GHz radio path.

Parameters
[in]ctxChip implementation context
[in]frequencyFrequency in Hz
[in]time_mstime in millisecond of the radio acquisition
[in]bwbandwidth lr1110_modem_tst_mode_bw_t
Returns
Operation status

◆ lr1110_modem_test_rx_cont()

err_t lr1110_modem_test_rx_cont ( lriot_t * ctx,
uint32_t frequency,
lr1110_modem_tst_mode_sf_t sf,
lr1110_modem_tst_mode_bw_t bw,
lr1110_modem_tst_mode_cr_t cr )

Continuously receive packets.

Parameters
[in]ctxChip implementation context
[in]frequencyFrequency in Hz
[in]sfspreading factor lr1110_modem_tst_mode_sf_t
[in]bwbandwidth lr1110_modem_tst_mode_bw_t
[in]crCoding Rate lr1110_modem_tst_mode_cr_t
Returns
Operation status

◆ lr1110_modem_test_tx_cont()

err_t lr1110_modem_test_tx_cont ( lriot_t * ctx,
uint32_t frequency,
int8_t tx_power,
lr1110_modem_tst_mode_sf_t sf,
lr1110_modem_tst_mode_bw_t bw,
lr1110_modem_tst_mode_cr_t cr,
uint8_t payload_length )

Continuously transmit packets as fast as possible.

Parameters
[in]ctxChip implementation context
[in]frequencyFrequency in Hz
[in]tx_powerTx power in dBm
[in]sfspreading factor lr1110_modem_tst_mode_sf_t
[in]bwbandwidth lr1110_modem_tst_mode_bw_t
[in]crCoding Rate lr1110_modem_tst_mode_cr_t
[in]payload_lengthPayload length
Returns
Operation status

◆ lr1110_modem_test_tx_cw()

err_t lr1110_modem_test_tx_cw ( lriot_t * ctx,
uint32_t frequency,
int8_t tx_power )

Transmit a continuous wave.

Parameters
[in]ctxChip implementation context
[in]frequencyFrequency in Hz
[in]tx_powerTx power in dBm
Returns
Operation status

◆ lr1110_modem_test_tx_single()

err_t lr1110_modem_test_tx_single ( lriot_t * ctx,
uint32_t frequency,
int8_t tx_power,
lr1110_modem_tst_mode_sf_t sf,
lr1110_modem_tst_mode_bw_t bw,
lr1110_modem_tst_mode_cr_t cr,
uint8_t payload_length )

Transmit a single packet.

Parameters
[in]ctxChip implementation context
[in]frequencyFrequency in Hz
[in]tx_powerTx power in dBm
[in]sfspreading factor lr1110_modem_tst_mode_sf_t
[in]bwbandwidth lr1110_modem_tst_mode_bw_t
[in]crCoding Rate lr1110_modem_tst_mode_cr_t
[in]payload_lengthPayload length
Returns
Operation status

◆ lr1110_modem_test_tx_single_preamble()

err_t lr1110_modem_test_tx_single_preamble ( lriot_t * ctx,
uint32_t frequency,
int8_t tx_power,
lr1110_modem_tst_mode_sf_t sf,
lr1110_modem_tst_mode_bw_t bw,
lr1110_modem_tst_mode_cr_t cr,
uint8_t payload_length,
uint16_t preamble_length )

Transmit a single packet with the number of preamble configurable.

Parameters
[in]ctxChip implementation context
[in]frequencyFrequency in Hz
[in]tx_powerTx power in dBm
[in]sfspreading factor lr1110_modem_tst_mode_sf_t
[in]bwbandwidth lr1110_modem_tst_mode_bw_t
[in]crCoding Rate lr1110_modem_tst_mode_cr_t
[in]payload_lengthPayload length
[in]preamble_lengthPreamble Length
Returns
Operation status

◆ lr1110_modem_upload_data()

err_t lr1110_modem_upload_data ( lriot_t * ctx,
uint8_t * data_buf,
uint8_t length )

This command can be used to repeatedly set file data to be uploaded. The file data needs to be split into parts of maximum 255 bytes each and the submitted parts will be appended to an internal buffer. In total exactly as many bytes as specified by the UploadInit command have to be provided. The buffer allocated for file uploads is 8K bytes.

Parameters
[in]ctxChip implementation context
[in]data_bufFile data to be uploaded
[in]lengthData length
Returns
Operation status

◆ lr1110_modem_upload_init()

err_t lr1110_modem_upload_init ( lriot_t * ctx,
uint8_t port,
lr1110_modem_encryption_mode_t encryption_mode,
uint16_t size,
uint16_t interval )

This command prepares a fragmented file upload. It specifies the port for the subsequent upload, optional encryption mode, file size, and average frame transmission interval (in seconds).

Parameters
[in]ctxChip implementation context
[in]portLoRaWAN port
[in]encryption_modeEncryption mode lr1110_modem_encryption_mode_t
[in]sizeUpload size
[in]intervalTransmission interval in seconds
Returns
Operation status

◆ lr1110_modem_upload_start()

err_t lr1110_modem_upload_start ( lriot_t * ctx,
uint32_t crc )

After all data bytes indicated to UploadInit have been provided using UploadData this command can be issued to actually start the transmission stream.

Parameters
[in]ctxChip implementation context
[in]crcCRC parameter which must match the CRC of the supplied data
Returns
Operation status

◆ lr1110_modem_write_user_defined_charge_counter()

err_t lr1110_modem_write_user_defined_charge_counter ( lriot_t * ctx,
uint16_t charge )

Write a charge value to user defined charger counter.

Parameters
[in]ctxChip implementation context
[in]chargeuser defined charger counter
Returns
Operation status