lriot 2.1.0.0
lr1110_modem_common.h File Reference

modem driver common definition for LR1110 More...

#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define LR1110_MODEM_EVENT_RESET_COUNT_DATA_LENGTH   ( 2 )
 Length of data buffer for reset event.
 
#define LR1110_MODEM_EVENT_TX_DONE_STATUS_DATA_LENGTH   ( 2 )
 Length of data buffer for TX done event.
 
#define LR1110_MODEM_EVENT_DOWN_DATA_DATA_LENGTH   ( 2 )
 Length of data buffer for downlink data event.
 
#define LR1110_MODEM_EVENT_UPLOAD_DONE_DATA_LENGTH   ( 2 )
 Length of data buffer for file upload done event.
 
#define LR1110_MODEM_EVENT_SET_CONF_DATA_LENGTH   ( 2 )
 Length of data buffer for setting configured by Device Management event.
 
#define LR1110_MODEM_EVENT_LINK_STATUS_DATA_LENGTH   ( 2 )
 Length of data buffer for link ADR update event.
 
#define LR1110_MODEM_EVENT_MAX_LENGTH_BUFFER   ( 1024 )
 Maximal length of event data buffer.
 

Enumerations

enum  lr1110_modem_api_group_id_t { LR1110_MODEM_GROUP_ID_SYSTEM = 0x01 , LR1110_MODEM_GROUP_ID_WIFI = 0x03 , LR1110_MODEM_GROUP_ID_GNSS = 0x04 , LR1110_MODEM_GROUP_ID_MODEM = 0x06 }
 Command group identifier. More...
 
enum  lr1110_modem_response_code_t {
  LR1110_MODEM_RESPONSE_CODE_OK = 0x00 , LR1110_MODEM_RESPONSE_CODE_UNKOWN = 0x01 , LR1110_MODEM_RESPONSE_CODE_NOT_INITIALIZED = 0x03 , LR1110_MODEM_RESPONSE_CODE_INVALID = 0x04 ,
  LR1110_MODEM_RESPONSE_CODE_BUSY = 0x05 , LR1110_MODEM_RESPONSE_CODE_FAIL = 0x06 , LR1110_MODEM_RESPONSE_CODE_BAD_FILE_UPLOAD_CRC = 0x08 , LR1110_MODEM_RESPONSE_CODE_BAD_SIZE = 0x0A ,
  LR1110_MODEM_RESPONSE_CODE_BAD_FRAME = 0x0F , LR1110_MODEM_RESPONSE_CODE_NO_TIME = 0x10
}
 Command return code (RC) More...
 
enum  lr1110_modem_lorawan_event_type_t {
  LR1110_MODEM_LORAWAN_EVENT_RESET = 0x00 , LR1110_MODEM_LORAWAN_EVENT_ALARM = 0x01 , LR1110_MODEM_LORAWAN_EVENT_JOINED = 0x02 , LR1110_MODEM_LORAWAN_EVENT_TX_DONE = 0x03 ,
  LR1110_MODEM_LORAWAN_EVENT_DOWN_DATA = 0x04 , LR1110_MODEM_LORAWAN_EVENT_UPLOAD_DONE = 0x05 , LR1110_MODEM_LORAWAN_EVENT_SET_CONF = 0x06 , LR1110_MODEM_LORAWAN_EVENT_MUTE = 0x07 ,
  LR1110_MODEM_LORAWAN_EVENT_STREAM_DONE = 0x08 , LR1110_MODEM_LORAWAN_EVENT_JOIN_FAIL = 0x0A , LR1110_MODEM_LORAWAN_EVENT_WIFI_SCAN_DONE = 0x0B , LR1110_MODEM_LORAWAN_EVENT_GNSS_SCAN_DONE = 0x0C ,
  LR1110_MODEM_LORAWAN_EVENT_TIME_UPDATED_ALC_SYNC , LR1110_MODEM_LORAWAN_EVENT_ADR_MOBILE_TO_STATIC , LR1110_MODEM_LORAWAN_EVENT_NEW_LINK_ADR = 0x0F , LR1110_MODEM_LORAWAN_EVENT_NO_EVENT = 0xFF
}
 Event type for modem operation. More...
 

Detailed Description

modem driver common definition for LR1110

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.

Macro Definition Documentation

◆ LR1110_MODEM_EVENT_DOWN_DATA_DATA_LENGTH

#define LR1110_MODEM_EVENT_DOWN_DATA_DATA_LENGTH   ( 2 )

Length of data buffer for downlink data event.

◆ LR1110_MODEM_EVENT_LINK_STATUS_DATA_LENGTH

#define LR1110_MODEM_EVENT_LINK_STATUS_DATA_LENGTH   ( 2 )

Length of data buffer for link ADR update event.

◆ LR1110_MODEM_EVENT_MAX_LENGTH_BUFFER

#define LR1110_MODEM_EVENT_MAX_LENGTH_BUFFER   ( 1024 )

Maximal length of event data buffer.

◆ LR1110_MODEM_EVENT_RESET_COUNT_DATA_LENGTH

#define LR1110_MODEM_EVENT_RESET_COUNT_DATA_LENGTH   ( 2 )

Length of data buffer for reset event.

◆ LR1110_MODEM_EVENT_SET_CONF_DATA_LENGTH

#define LR1110_MODEM_EVENT_SET_CONF_DATA_LENGTH   ( 2 )

Length of data buffer for setting configured by Device Management event.

◆ LR1110_MODEM_EVENT_TX_DONE_STATUS_DATA_LENGTH

#define LR1110_MODEM_EVENT_TX_DONE_STATUS_DATA_LENGTH   ( 2 )

Length of data buffer for TX done event.

◆ LR1110_MODEM_EVENT_UPLOAD_DONE_DATA_LENGTH

#define LR1110_MODEM_EVENT_UPLOAD_DONE_DATA_LENGTH   ( 2 )

Length of data buffer for file upload done event.

Enumeration Type Documentation

◆ lr1110_modem_api_group_id_t

Command group identifier.

Enumerator
LR1110_MODEM_GROUP_ID_SYSTEM 

Group ID for system commands.

LR1110_MODEM_GROUP_ID_WIFI 

Group ID for Wi-Fi commands.

LR1110_MODEM_GROUP_ID_GNSS 

Group ID for GNSS commands.

LR1110_MODEM_GROUP_ID_MODEM 

Group ID for modem commands.

◆ lr1110_modem_lorawan_event_type_t

Event type for modem operation.

Enumerator
LR1110_MODEM_LORAWAN_EVENT_RESET 

Modem has reset.

LR1110_MODEM_LORAWAN_EVENT_ALARM 

Alarm time expired.

LR1110_MODEM_LORAWAN_EVENT_JOINED 

Network successfully joined.

LR1110_MODEM_LORAWAN_EVENT_TX_DONE 

Frame transmitted.

LR1110_MODEM_LORAWAN_EVENT_DOWN_DATA 

Downlink data received.

LR1110_MODEM_LORAWAN_EVENT_UPLOAD_DONE 

File upload completed.

LR1110_MODEM_LORAWAN_EVENT_SET_CONF 

Configuration has been changed by Device Manager.

LR1110_MODEM_LORAWAN_EVENT_MUTE 

Modem has been muted or un-muted by Device Manager.

LR1110_MODEM_LORAWAN_EVENT_STREAM_DONE 

Last data stream fragment sent.

LR1110_MODEM_LORAWAN_EVENT_JOIN_FAIL 

Attempt to join network failed.

LR1110_MODEM_LORAWAN_EVENT_WIFI_SCAN_DONE 

Wi-Fi passive scan done.

LR1110_MODEM_LORAWAN_EVENT_GNSS_SCAN_DONE 

GNSS scan done or almanac update done.

LR1110_MODEM_LORAWAN_EVENT_TIME_UPDATED_ALC_SYNC 

Time updated by Application Layer Clock synchronization.

LR1110_MODEM_LORAWAN_EVENT_ADR_MOBILE_TO_STATIC 

Indicates to the host that the modem automatically switches Adaptative Data Rate configuration from mobile to static when connection timeout occurs

LR1110_MODEM_LORAWAN_EVENT_NEW_LINK_ADR 

Modem received a LinkADR request.

LR1110_MODEM_LORAWAN_EVENT_NO_EVENT 

No event: notify the host that no data have to be read.

◆ lr1110_modem_response_code_t

Command return code (RC)

Enumerator
LR1110_MODEM_RESPONSE_CODE_OK 

Driver command executed successfully.

LR1110_MODEM_RESPONSE_CODE_UNKOWN 

Command code unknown.

LR1110_MODEM_RESPONSE_CODE_NOT_INITIALIZED 

Command not initialized.

LR1110_MODEM_RESPONSE_CODE_INVALID 

Invalid command parameters.

LR1110_MODEM_RESPONSE_CODE_BUSY 

Command cannot be executed now.

LR1110_MODEM_RESPONSE_CODE_FAIL 

Command execution failed.

LR1110_MODEM_RESPONSE_CODE_BAD_FILE_UPLOAD_CRC 

File upload CRC check failed.

LR1110_MODEM_RESPONSE_CODE_BAD_SIZE 

Size check failed.

LR1110_MODEM_RESPONSE_CODE_BAD_FRAME 

SPI command checksum failed or CRC failed.

LR1110_MODEM_RESPONSE_CODE_NO_TIME 

GNSS time synchronisation lost.