Logo
Link Labs Interface Library
External host library for using Link Lab's modules.
top
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Core

Detailed Description

Core functions and data structures used to communicate with the module across different MAC modes.

Data Structures

struct  ll_firmware_type_t
 
struct  ll_version_t
 
struct  llabs_dl_band_cfg
 
struct  llabs_network_info_t
 
struct  llabs_stats
 
struct  llabs_time
 
struct  llabs_time_info
 

Macros

#define APP_TOKEN_LEN   (10)
 
#define FIRMWARE_TYPE_LEN   (4)
 
#define IFC_VERSION_MAJOR   (0)
 
#define IFC_VERSION_MINOR   (5)
 
#define IFC_VERSION_TAG   (0)
 
#define IRQ_FLAGS_APP_TOKEN_CONFIRMED   (0x00020000UL)
 Set every time an application token is confirmed by Conductor. More...
 
#define IRQ_FLAGS_APP_TOKEN_ERROR   (0x00200000UL)
 Set when an application token registration fails. More...
 
#define IRQ_FLAGS_ASSERT   (0x80000000UL)
 Set every time we transition from the connected->disconnected state. More...
 
#define IRQ_FLAGS_CONNECTED   (0x00001000UL)
 Set every time we transition from the disconnected -> connected state. More...
 
#define IRQ_FLAGS_CRYPTO_ERROR   (0x00100000UL)
 Set when a crypto exchange attempt fails. More...
 
#define IRQ_FLAGS_CRYPTO_ESTABLISHED   (0x00010000UL)
 Set every time we transition from the crypto not established -> crytpto established state. More...
 
#define IRQ_FLAGS_DISCONNECTED   (0x00002000UL)
 Set every time we transition from the connected -> disconnected state. More...
 
#define IRQ_FLAGS_DOWNLINK_REQUEST_ACK   (0x00040000UL)
 Set every time a downlink registration request is acknowledged. More...
 
#define IRQ_FLAGS_ENROLL_GRANT   (0x00004000UL)
 Set when the module has been granted an enrollment by the gateway. More...
 
#define IRQ_FLAGS_FIRMWARE_REQ   (0x00800000UL)
 Set when we want to request the firmware data of the host controller. More...
 
#define IRQ_FLAGS_INITIALIZATION_COMPLETE   (0x00080000UL)
 Set every time the MAC has completed initialization. More...
 
#define IRQ_FLAGS_MAILBOX_EMPTY   (0x00000200UL)
 Set when a GW reports an empty mailbox. More...
 
#define IRQ_FLAGS_RESET   (0x00000002UL)
 Set every time the module reboots for any reason. More...
 
#define IRQ_FLAGS_RX_DONE   (0x00000100UL)
 Set every time a new packet is received. More...
 
#define IRQ_FLAGS_STATUS_REQ   (0x00400000UL)
 Set when we want to request the status of the host controller. More...
 
#define IRQ_FLAGS_TX_DONE   (0x00000010UL)
 Set every time a Tx Queue goes from non-empty to empty. More...
 
#define IRQ_FLAGS_TX_ERROR   (0x00000020UL)
 Set every time there is a Tx Error. More...
 
#define IRQ_FLAGS_WDOG_RESET   (0x00000001UL)
 Set every time the module reboots after a Watchdog reboot. More...
 
#define LL_IFC_ACK   (0)
 All good. More...
 
#define LL_IFC_NACK_APP_TOKEN_REG   (7)
 Application token is not registered for this node. More...
 
#define LL_IFC_NACK_BOOTUP_IN_PROGRESS   (5)
 Not allowed since firmware bootup still in progress. Wait. More...
 
#define LL_IFC_NACK_BUSY_TRY_AGAIN   (6)
 Operation prevented by temporary event. Re-try should work. More...
 
#define LL_IFC_NACK_CMD_NOT_SUPPORTED   (1)
 Command not supported. More...
 
#define LL_IFC_NACK_INCORRECT_CHKSUM   (2)
 Incorrect Checksum. More...
 
#define LL_IFC_NACK_NODATA   (11)
 No data is available to be returned. More...
 
#define LL_IFC_NACK_NOT_IN_MAILBOX_MODE   (9)
 Module must be in DOWNLINK_MAILBOX mode. More...
 
#define LL_IFC_NACK_OTHER   (99)
 
#define LL_IFC_NACK_PAYLOAD_BAD_PROPERTY   (10)
 Invalid property specified in command. More...
 
#define LL_IFC_NACK_PAYLOAD_LEN_EXCEEDED   (8)
 Payload length is greater than the max supported length. More...
 
#define LL_IFC_NACK_PAYLOAD_LEN_OOR   (3)
 Length of payload sent in command was out of range. More...
 
#define LL_IFC_NACK_PAYLOAD_OOR   (4)
 Payload sent in command was out of range. More...
 
#define LL_IFC_NACK_QUEUE_FULL   (12)
 Data could not be enqueued for transmission (queue full) More...
 
#define MAX_RX_MSG_LEN   (128)
 
#define RADIO_PARAM_FLAGS_BW   (1u<<2u)
 
#define RADIO_PARAM_FLAGS_CR   (1u<<1u)
 
#define RADIO_PARAM_FLAGS_CRC   (1u<<6u)
 
#define RADIO_PARAM_FLAGS_FREQ   (1u<<3u)
 
#define RADIO_PARAM_FLAGS_HEADER   (1u<<5u)
 
#define RADIO_PARAM_FLAGS_IQ   (1u<<7u)
 
#define RADIO_PARAM_FLAGS_PREAMBLE   (1u<<4u)
 
#define RADIO_PARAM_FLAGS_SF   (1u<<0u)
 
#define VERSION_LEN   (4)
 

Typedefs

typedef enum ll_ifc_error_codes_e ll_ifc_error_codes_t
 
typedef enum ll_timestamp_operation_e ll_timestamp_operation_t
 The operations for ll_timestamp_set(). More...
 
typedef struct PACKED llabs_dl_band_cfg llabs_dl_band_cfg_t
 
typedef struct PACKED llabs_network_info_t llabs_network_info_t
 
typedef struct llabs_stats llabs_stats_t
 
typedef struct PACKED llabs_time_info llabs_time_info_t
 
typedef struct PACKED llabs_time llabs_time_t
 

Enumerations

enum  cpu_code_t {
  CPU_EFM32TG210F32 = 0, CPU_EFM32G210F128 = 1, CPU_R5F51115ADNE = 2, CPU_R5F51116ADNE = 3,
  CPU_EFM32GG232F1024 = 4
}
 
enum  downlink_mode_t {
  DOWNLINK_MODE_OFF = 0, DOWNLINK_MODE_ALWAYS_ON = 1, DOWNLINK_MODE_MAILBOX = 2, DOWNLINK_MODE_PERIODIC = 3,
  NUM_DOWNLINK_MODES, DOWNLINK_MODE_FAILURE = 255
}
 
enum  frame_t { FRAME_START = 0xC4 }
 
enum  functionality_code_t { GATEWAY_TX_ONLY = 0, MODULE_END_NODE = 1, REPEATER_HOST = 2 }
 
enum  ll_hardware_type_t {
  UNAVAILABLE = 0, LLRLP20_V2 = 1, LLRXR26_V2 = 2, LLRLP20_V3 = 3,
  LLRXR26_V3 = 4, LLREPEATER = 5
}
 
enum  ll_ifc_error_codes_e {
  LL_IFC_ERROR_INCORRECT_PARAMETER = -101, LL_IFC_ERROR_INCORRECT_RESPONSE_LENGTH = -102, LL_IFC_ERROR_MESSAGE_NUMBER_MISMATCH = -103, LL_IFC_ERROR_CHECKSUM_MISMATCH = -104,
  LL_IFC_ERROR_COMMAND_MISMATCH = -105, LL_IFC_ERROR_HOST_INTERFACE_TIMEOUT = -106, LL_IFC_ERROR_BUFFER_TOO_SMALL = -107, LL_IFC_ERROR_START_OF_FRAME = -108,
  LL_IFC_ERROR_HEADER = -109, LL_IFC_ERROR_TIMEOUT = -110, LL_IFC_ERROR_INCORRECT_MESSAGE_SIZE = -111, LL_IFC_ERROR_NO_NETWORK = -112
}
 
enum  ll_mac_type_t {
  LORA_NO_MAC = 0, DEPRECATED_MAC1, DEPRECATED_MAC2, SYMPHONY_LINK,
  NUM_MACS, MAC_INVALID = 255
}
 
enum  ll_timestamp_operation_e { LL_TIMESTAMP_NO_OPERATION, LL_TIMESTAMP_SET_IMMEDIATE, LL_TIMESTAMP_SYNC_IMMEDIATE, LL_TIMESTAMP_SYNC }
 The operations for ll_timestamp_set(). More...
 
enum  llabs_connect_status_t { LLABS_CONNECT_INITIAL = 0, LLABS_CONNECT_DISCONNECTED, LLABS_CONNECT_CONNECTED, LLABS_NUM_CONNECT_STATUSES }
 
enum  opcode_t {
  OP_VERSION = 0, OP_IFC_VERSION = 1, OP_STATE = 2, OP_TX_STATE = 3,
  OP_RX_STATE = 4, OP_FREQUENCY = 6, OP_TX_POWER_SET = 7, OP_RESET_SETTINGS = 8,
  OP_GET_RADIO_PARAMS = 9, OP_SET_RADIO_PARAMS = 10, OP_PKT_SEND_QUEUE = 11, OP_TX_POWER_GET = 12,
  OP_SYNC_WORD_SET = 13, OP_SYNC_WORD_GET = 14, OP_IRQ_FLAGS = 15, OP_IRQ_FLAGS_MASK = 16,
  OP_SLEEP = 20, OP_SLEEP_BLOCK = 21, OP_PKT_ECHO = 31, OP_PKT_RECV = 40,
  OP_MSG_RECV_RSSI = 41, OP_PKT_RECV_CONT = 42, OP_MSG_RECV = 43, OP_MODULE_ID = 50,
  OP_STORE_SETTINGS = 51, OP_DELETE_SETTINGS = 52, OP_RESET_MCU = 60, OP_TRIGGER_BOOTLOADER = 61,
  OP_MAC_MODE_SET = 70, OP_MAC_MODE_GET = 71, OP_RESERVED_LIFERAFT0 = 72, OP_MSG_SEND_ACK = 90,
  OP_MSG_SEND_UNACK = 91, OP_MSG_SEND = 92, OP_CONN_FILT_SET = 93, OP_CONN_FILT_GET = 94,
  OP_RESERVED0 = 96, OP_RESERVED1 = 97, OP_TX_CW = 98, OP_SYSTEM_TIME_GET = 108,
  OP_SYSTEM_TIME_SYNC = 109, OP_RX_MODE_SET = 110, OP_RX_MODE_GET = 111, OP_QOS_REQUEST = 112,
  OP_QOS_GET = 113, OP_ANTENNA_SET = 114, OP_ANTENNA_GET = 115, OP_NET_TOKEN_SET = 116,
  OP_NET_TOKEN_GET = 117, OP_NET_INFO_GET = 118, OP_STATS_GET = 119, OP_RSSI_SET = 120,
  OP_RSSI_GET = 121, OP_DL_BAND_CFG_GET = 122, OP_DL_BAND_CFG_SET = 123, OP_APP_TOKEN_SET = 124,
  OP_APP_TOKEN_GET = 125, OP_APP_TOKEN_REG_GET = 126, OP_CRYPTO_KEY_XCHG_REQ = 128, OP_MAILBOX_REQUEST = 129,
  OP_RESERVED_LIFERAFT1 = 130, OP_TIMESTAMP = 131, OP_SEND_TIMESTAMP = 132, OP_FCC_TEST = 245,
  OP_PER_TEST_TX = 246, OP_PER_TEST_RX = 247, OP_GET_ASSERT = 248, OP_SET_ASSERT = 249,
  OP_HARDWARE_TYPE = 254, OP_FIRMWARE_TYPE = 255
}
 
enum  property_bw_t {
  PROPERTY_LORA_BW_MIN = 0, PROPERTY_LORA_BW_62_5 = 0, PROPERTY_LORA_BW_125 = 1, PROPERTY_LORA_BW_250 = 2,
  PROPERTY_LORA_BW_500 = 3, PROPERTY_LORA_BW_MAX
}
 
enum  property_cr_t {
  PROPERTY_LORA_CR_MIN = 1, PROPERTY_LORA_CR_4_5 = 1, PROPERTY_LORA_CR_4_6 = 2, PROPERTY_LORA_CR_4_7 = 3,
  PROPERTY_LORA_CR_4_8 = 4, PROPERTY_LORA_CR_MAX
}
 
enum  property_sf_t {
  PROPERTY_LORA_SF_MIN = 6, PROPERTY_LORA_SF_6 = 6, PROPERTY_LORA_SF_7 = 7, PROPERTY_LORA_SF_8 = 8,
  PROPERTY_LORA_SF_9 = 9, PROPERTY_LORA_SF_10 = 10, PROPERTY_LORA_SF_11 = 11, PROPERTY_LORA_SF_12 = 12,
  PROPERTY_LORA_SF_MAX
}
 

Functions

int32_t ll_antenna_get (uint8_t *ant)
 Get the antenna configuration. More...
 
int32_t ll_antenna_set (uint8_t ant)
 Set the antenna configuration. More...
 
int32_t ll_bootloader_mode (void)
 Force the module to reset and enter bootloader mode (takes a few seconds). More...
 
void ll_dl_band_cfg_deserialize (const uint8_t buff[DL_BAND_CFG_SIZE], llabs_dl_band_cfg_t *dl_cfg)
 
uint16_t ll_dl_band_cfg_serialize (const llabs_dl_band_cfg_t *dl_cfg, uint8_t buff[DL_BAND_CFG_SIZE])
 
int32_t ll_firmware_type_get (ll_firmware_type_t *t)
 Get the module firmware type. More...
 
int32_t ll_get_assert_info (char *filename, uint16_t filename_len, uint32_t *line)
 Gets the assert info from the module. More...
 
int32_t ll_hardware_type_get (ll_hardware_type_t *t)
 Get the module hardware type. More...
 
const char * ll_hardware_type_string (ll_hardware_type_t t)
 Get the string for the module hardware type. More...
 
int32_t ll_interface_version_get (ll_version_t *version)
 Get the host interface version number. More...
 
int32_t ll_irq_flags (uint32_t flags_to_clear, uint32_t *flags)
 Read (and optionally clear) IRQ flags in module. More...
 
int32_t ll_mac_mode_get (ll_mac_type_t *mac_mode)
 Get the MAC Mode. More...
 
int32_t ll_mac_mode_set (ll_mac_type_t mac_mode)
 Set the MAC Mode. More...
 
void ll_net_info_deserialize (const uint8_t buff[NET_INFO_BUFF_SIZE], llabs_network_info_t *net_info)
 
uint16_t ll_net_info_serialize (const llabs_network_info_t *net_info, uint8_t buff[NET_INFO_BUFF_SIZE])
 
int32_t ll_reset_mcu (void)
 Force the module to reset (takes a few seconds). More...
 
int32_t ll_reset_state (void)
 Reset the host-side state maintained by the interface. More...
 
int32_t ll_restore_defaults (void)
 Restore the default radio parameters: More...
 
char const * ll_return_code_description (int32_t return_code)
 Convert an return code into a description. More...
 
char const * ll_return_code_name (int32_t return_code)
 Convert an return code into a short name string. More...
 
int32_t ll_settings_delete (void)
 Delete all settings from flash storage. More...
 
int32_t ll_settings_store (void)
 Store the current radio parameters to flash: More...
 
int32_t ll_sleep (void)
 Force the module to enter sleep. More...
 
int32_t ll_sleep_block (void)
 Block any sleep mode. More...
 
int32_t ll_sleep_unblock (void)
 Unblock sleep modes. More...
 
void ll_stats_deserialize (const uint8_t buff[STATS_SIZE], llabs_stats_t *stats)
 
uint16_t ll_stats_serialize (const llabs_stats_t *stats, uint8_t buff[STATS_SIZE])
 
void ll_time_deserialize (const uint8_t buff[TIME_INFO_SIZE], llabs_time_info_t *time_info)
 
uint16_t ll_time_serialize (const llabs_time_info_t *time_info, uint8_t buff[TIME_INFO_SIZE])
 
int32_t ll_timestamp_get (uint32_t *timestamp_us)
 Get the module's current timestamp value. More...
 
int32_t ll_timestamp_set (ll_timestamp_operation_t operation, uint32_t timestamp_us, uint32_t *actual_timestamp_us)
 Set the module's current timestamp value using an external reference. More...
 
int32_t ll_trigger_assert (void)
 Triggers an assert (for test purposes). More...
 
int32_t ll_trigger_watchdog (void)
 Triggers watchdog reboot from host ifc. More...
 
int32_t ll_unique_id_get (uint64_t *unique_id)
 Get the module unique identifier. More...
 
int32_t ll_version_get (ll_version_t *version)
 Get the module firmware version number. More...
 

Variables

const uint32_t OPEN_NET_TOKEN
 Open network token (0x4f50454e) More...
 

Macro Definition Documentation

#define APP_TOKEN_LEN   (10)
#define FIRMWARE_TYPE_LEN   (4)
#define IFC_VERSION_MAJOR   (0)
#define IFC_VERSION_MINOR   (5)
#define IFC_VERSION_TAG   (0)
#define IRQ_FLAGS_APP_TOKEN_CONFIRMED   (0x00020000UL)

Set every time an application token is confirmed by Conductor.

#define IRQ_FLAGS_APP_TOKEN_ERROR   (0x00200000UL)

Set when an application token registration fails.

#define IRQ_FLAGS_ASSERT   (0x80000000UL)

Set every time we transition from the connected->disconnected state.

#define IRQ_FLAGS_CONNECTED   (0x00001000UL)

Set every time we transition from the disconnected -> connected state.

#define IRQ_FLAGS_CRYPTO_ERROR   (0x00100000UL)

Set when a crypto exchange attempt fails.

#define IRQ_FLAGS_CRYPTO_ESTABLISHED   (0x00010000UL)

Set every time we transition from the crypto not established -> crytpto established state.

#define IRQ_FLAGS_DISCONNECTED   (0x00002000UL)

Set every time we transition from the connected -> disconnected state.

#define IRQ_FLAGS_DOWNLINK_REQUEST_ACK   (0x00040000UL)

Set every time a downlink registration request is acknowledged.

#define IRQ_FLAGS_ENROLL_GRANT   (0x00004000UL)

Set when the module has been granted an enrollment by the gateway.

#define IRQ_FLAGS_FIRMWARE_REQ   (0x00800000UL)

Set when we want to request the firmware data of the host controller.

#define IRQ_FLAGS_INITIALIZATION_COMPLETE   (0x00080000UL)

Set every time the MAC has completed initialization.

#define IRQ_FLAGS_MAILBOX_EMPTY   (0x00000200UL)

Set when a GW reports an empty mailbox.

#define IRQ_FLAGS_RESET   (0x00000002UL)

Set every time the module reboots for any reason.

#define IRQ_FLAGS_RX_DONE   (0x00000100UL)

Set every time a new packet is received.

#define IRQ_FLAGS_STATUS_REQ   (0x00400000UL)

Set when we want to request the status of the host controller.

#define IRQ_FLAGS_TX_DONE   (0x00000010UL)

Set every time a Tx Queue goes from non-empty to empty.

#define IRQ_FLAGS_TX_ERROR   (0x00000020UL)

Set every time there is a Tx Error.

#define IRQ_FLAGS_WDOG_RESET   (0x00000001UL)

Set every time the module reboots after a Watchdog reboot.

Bit Definitions for OP_IRQ_FLAGS

#define LL_IFC_ACK   (0)

All good.

ACK/NACK Codes

#define LL_IFC_NACK_APP_TOKEN_REG   (7)

Application token is not registered for this node.

#define LL_IFC_NACK_BOOTUP_IN_PROGRESS   (5)

Not allowed since firmware bootup still in progress. Wait.

#define LL_IFC_NACK_BUSY_TRY_AGAIN   (6)

Operation prevented by temporary event. Re-try should work.

#define LL_IFC_NACK_CMD_NOT_SUPPORTED   (1)

Command not supported.

#define LL_IFC_NACK_INCORRECT_CHKSUM   (2)

Incorrect Checksum.

#define LL_IFC_NACK_NODATA   (11)

No data is available to be returned.

#define LL_IFC_NACK_NOT_IN_MAILBOX_MODE   (9)

Module must be in DOWNLINK_MAILBOX mode.

#define LL_IFC_NACK_OTHER   (99)
#define LL_IFC_NACK_PAYLOAD_BAD_PROPERTY   (10)

Invalid property specified in command.

#define LL_IFC_NACK_PAYLOAD_LEN_EXCEEDED   (8)

Payload length is greater than the max supported length.

#define LL_IFC_NACK_PAYLOAD_LEN_OOR   (3)

Length of payload sent in command was out of range.

#define LL_IFC_NACK_PAYLOAD_OOR   (4)

Payload sent in command was out of range.

#define LL_IFC_NACK_QUEUE_FULL   (12)

Data could not be enqueued for transmission (queue full)

#define MAX_RX_MSG_LEN   (128)
#define RADIO_PARAM_FLAGS_BW   (1u<<2u)
#define RADIO_PARAM_FLAGS_CR   (1u<<1u)
#define RADIO_PARAM_FLAGS_CRC   (1u<<6u)
#define RADIO_PARAM_FLAGS_FREQ   (1u<<3u)
#define RADIO_PARAM_FLAGS_HEADER   (1u<<5u)
#define RADIO_PARAM_FLAGS_IQ   (1u<<7u)
#define RADIO_PARAM_FLAGS_PREAMBLE   (1u<<4u)
#define RADIO_PARAM_FLAGS_SF   (1u<<0u)

Bit Definitions for OP_SET_RADIO_PARAMS

#define VERSION_LEN   (4)

Typedef Documentation

Error Codes

The operations for ll_timestamp_set().

typedef struct llabs_stats llabs_stats_t
typedef struct PACKED llabs_time llabs_time_t

Enumeration Type Documentation

enum cpu_code_t

Firmware identifiers

Enumerator
CPU_EFM32TG210F32 

0x00

CPU_EFM32G210F128 

0x01

CPU_R5F51115ADNE 

0x02

CPU_R5F51116ADNE 

0x03

CPU_EFM32GG232F1024 

0x04

Possible downlink modes for OP_DOWNLINK_MODE

Enumerator
DOWNLINK_MODE_OFF 

0x00

DOWNLINK_MODE_ALWAYS_ON 

0x01

DOWNLINK_MODE_MAILBOX 

0x02

DOWNLINK_MODE_PERIODIC 

0x03

NUM_DOWNLINK_MODES 
DOWNLINK_MODE_FAILURE 

0xFF

enum frame_t
Enumerator
FRAME_START 

0xC4

Enumerator
GATEWAY_TX_ONLY 

0x00

MODULE_END_NODE 

0x01

REPEATER_HOST 

0x02

Enumerator
UNAVAILABLE 

0x00

LLRLP20_V2 

0x01

LLRXR26_V2 

0x02

LLRLP20_V3 

0x03

LLRXR26_V3 

0x04

LLREPEATER 

0x05 AES_TODO - Replace with official part number?

Error Codes

Enumerator
LL_IFC_ERROR_INCORRECT_PARAMETER 

The parameter value was invalid.

LL_IFC_ERROR_INCORRECT_RESPONSE_LENGTH 

Module response was not the expected size.

LL_IFC_ERROR_MESSAGE_NUMBER_MISMATCH 

Message number in response doesn't match expected.

LL_IFC_ERROR_CHECKSUM_MISMATCH 

Checksum mismatch.

LL_IFC_ERROR_COMMAND_MISMATCH 

Command mismatch (responding to a different command)

LL_IFC_ERROR_HOST_INTERFACE_TIMEOUT 

Timed out waiting for Rx bytes from interface.

LL_IFC_ERROR_BUFFER_TOO_SMALL 

Response larger than provided output buffer.

LL_IFC_ERROR_START_OF_FRAME 

transport_read failed getting FRAME_START

LL_IFC_ERROR_HEADER 

transport_read failed getting header

LL_IFC_ERROR_TIMEOUT 

The operation timed out.

LL_IFC_ERROR_INCORRECT_MESSAGE_SIZE 

The message size from the device was incorrect.

LL_IFC_ERROR_NO_NETWORK 

No network was available.

Enumerator
LORA_NO_MAC 

0x00

DEPRECATED_MAC1 

0x01

DEPRECATED_MAC2 

0x02

SYMPHONY_LINK 

0x03

NUM_MACS 

Total number of MAC modes.

MAC_INVALID 

0xFF

The operations for ll_timestamp_set().

Enumerator
LL_TIMESTAMP_NO_OPERATION 

No set operation.

Just get the current timestamp.

LL_TIMESTAMP_SET_IMMEDIATE 

Directly set the timestamp from the provided value.

The value is not applied until the command is processed by the module, and it does not account for transmission delay.

LL_TIMESTAMP_SYNC_IMMEDIATE 

Synchronize the timestamp using the provided value which corresponds to the most recent event.

Use this mechanism when the host directly controls the trigger event received by both the reference time source and the module. This mechanism guarantees the module that the reference value aligns to the module's timestamp value when the most recent trigger event occurred.

LL_TIMESTAMP_SYNC 

Intelligently synchronize the timestamp using the provided value accounting for possible mismatched trigger events.

Use this mechanism when the host does not control the trigger event. When the trigger event is free-running such as with a GPS pulse-per-seconds (PPS) output, the reference value may be one event behind the module's value. This mechanism allows the module to detect and account for this variability. To correctly update the module's timestamp using this mechanism:

  1. Read the reference timestamp.
  2. Call ll_timestamp_set()
  3. Read the reference timestamp.
  4. Call ll_timestamp_set()
Enumerator
LLABS_CONNECT_INITIAL 

0x00

LLABS_CONNECT_DISCONNECTED 

0x01

LLABS_CONNECT_CONNECTED 

0x02

LLABS_NUM_CONNECT_STATUSES 

0x03

enum opcode_t
Enumerator
OP_VERSION 

0x00

OP_IFC_VERSION 

0x01

OP_STATE 

0x02

OP_TX_STATE 

0x03

OP_RX_STATE 

0x04

OP_FREQUENCY 

0x06

OP_TX_POWER_SET 

0x07

OP_RESET_SETTINGS 

0x08

OP_GET_RADIO_PARAMS 

0x09

OP_SET_RADIO_PARAMS 

0x0A

OP_PKT_SEND_QUEUE 

0x0B

OP_TX_POWER_GET 

0x0C

OP_SYNC_WORD_SET 

0x0D

OP_SYNC_WORD_GET 

0x0E

OP_IRQ_FLAGS 

0x0F

OP_IRQ_FLAGS_MASK 

0x10

OP_SLEEP 

0x14

OP_SLEEP_BLOCK 

0x15

OP_PKT_ECHO 

0x1F

OP_PKT_RECV 

0x28

OP_MSG_RECV_RSSI 

0x29 - Deprecated for Symphony mode

OP_PKT_RECV_CONT 

0x2A

OP_MSG_RECV 

0x2B

OP_MODULE_ID 

0x32

OP_STORE_SETTINGS 

0x33

OP_DELETE_SETTINGS 

0x34

OP_RESET_MCU 

0x3C

OP_TRIGGER_BOOTLOADER 

0x3D

OP_MAC_MODE_SET 

0x46

OP_MAC_MODE_GET 

0x47

OP_RESERVED_LIFERAFT0 

0x48 - Liferaft Specific (Do not use!)

OP_MSG_SEND_ACK 

0x5A - Deprecated

OP_MSG_SEND_UNACK 

0x5B - Deprecated

OP_MSG_SEND 

0x5C

OP_CONN_FILT_SET 

0x5D

OP_CONN_FILT_GET 

0x5E

OP_RESERVED0 

0x60

OP_RESERVED1 

0x60

OP_TX_CW 

0x61

OP_SYSTEM_TIME_GET 

0x6C

OP_SYSTEM_TIME_SYNC 

0x6D

OP_RX_MODE_SET 

0x6E

OP_RX_MODE_GET 

0x6F

OP_QOS_REQUEST 

0x70

OP_QOS_GET 

0x71

OP_ANTENNA_SET 

0x72

OP_ANTENNA_GET 

0x73

OP_NET_TOKEN_SET 

0x74

OP_NET_TOKEN_GET 

0x75

OP_NET_INFO_GET 

0x76

OP_STATS_GET 

0x77

OP_RSSI_SET 

0x78

OP_RSSI_GET 

0x79

OP_DL_BAND_CFG_GET 

0x7A

OP_DL_BAND_CFG_SET 

0x7B

OP_APP_TOKEN_SET 

0x7C

OP_APP_TOKEN_GET 

0x7D

OP_APP_TOKEN_REG_GET 

0x7E

OP_CRYPTO_KEY_XCHG_REQ 

0x80

OP_MAILBOX_REQUEST 

0x81

OP_RESERVED_LIFERAFT1 

0x82 - Liferaft Specific (Do not use!)

OP_TIMESTAMP 

0x83 reserved, not fully implemented

OP_SEND_TIMESTAMP 

0x84 reserved, not fully implemented

OP_FCC_TEST 

0xF5

OP_PER_TEST_TX 

0xF6

OP_PER_TEST_RX 

0xF7

OP_GET_ASSERT 

0xF8

OP_SET_ASSERT 

0xF9

OP_HARDWARE_TYPE 

0xFE

OP_FIRMWARE_TYPE 

0xFF

Link Labs LORA enumeration identifiers for Bandwidth

Enumerator
PROPERTY_LORA_BW_MIN 

range limit value (lower)

PROPERTY_LORA_BW_62_5 

62.5KHz BW

PROPERTY_LORA_BW_125 

125KHz BW

PROPERTY_LORA_BW_250 

250KHz BW

PROPERTY_LORA_BW_500 

500KHz BW

PROPERTY_LORA_BW_MAX 

range limit value (upper)

Link Labs LORA enumeration identifiers for Coding rate

Enumerator
PROPERTY_LORA_CR_MIN 

range limit value (lower)

PROPERTY_LORA_CR_4_5 

0x01 – 4/5

PROPERTY_LORA_CR_4_6 

0x02 – 4/6

PROPERTY_LORA_CR_4_7 

0x03 – 4/7

PROPERTY_LORA_CR_4_8 

0x04 – 4/8

PROPERTY_LORA_CR_MAX 

range limit value (upper)

Link Labs LORA enumeration identifiers for Spreading Factor

Enumerator
PROPERTY_LORA_SF_MIN 

range limit value (lower)

PROPERTY_LORA_SF_6 

SF 6.

PROPERTY_LORA_SF_7 

SF 7.

PROPERTY_LORA_SF_8 

SF 8.

PROPERTY_LORA_SF_9 

SF 9.

PROPERTY_LORA_SF_10 

SF 10.

PROPERTY_LORA_SF_11 

SF 11.

PROPERTY_LORA_SF_12 

SF 12.

PROPERTY_LORA_SF_MAX 

range limit value (upper)

Function Documentation

int32_t ll_antenna_get ( uint8_t *  ant)

Get the antenna configuration.

Parameters
[out]antAntenna configuration.
Returns
0 - success, negative otherwise.
int32_t ll_antenna_set ( uint8_t  ant)

Set the antenna configuration.

Parameters
[in]antAntenna configuration. (1=>U.FL, 2=>trace)
Returns
0 - success, negative otherwise.
int32_t ll_bootloader_mode ( void  )

Force the module to reset and enter bootloader mode (takes a few seconds).

This function forces the module to reset and enter bootloader mode.

Returns
0 - always.
void ll_dl_band_cfg_deserialize ( const uint8_t  buff[DL_BAND_CFG_SIZE],
llabs_dl_band_cfg_t dl_cfg 
)
uint16_t ll_dl_band_cfg_serialize ( const llabs_dl_band_cfg_t dl_cfg,
uint8_t  buff[DL_BAND_CFG_SIZE] 
)
int32_t ll_firmware_type_get ( ll_firmware_type_t t)

Get the module firmware type.

Parameters
[out]tpointer to a firmware type struct.
Returns
0 - success, negative otherwise.
int32_t ll_get_assert_info ( char *  filename,
uint16_t  filename_len,
uint32_t *  line 
)

Gets the assert info from the module.

None.

Returns
positive number of bytes queued, negative if an error.
int32_t ll_hardware_type_get ( ll_hardware_type_t t)

Get the module hardware type.

Parameters
[out]tpointer to a hardware type enum.
Returns
0 - success, negative otherwise.
const char* ll_hardware_type_string ( ll_hardware_type_t  t)

Get the string for the module hardware type.

Parameters
[in]tThe hardware type enum, usually from ll_hardware_type_get().
Returns
The string describing the hardware type.
int32_t ll_interface_version_get ( ll_version_t version)

Get the host interface version number.

Parameters
[out]versionpointer to a version struct.
Returns
0 - success, negative otherwise.
int32_t ll_irq_flags ( uint32_t  flags_to_clear,
uint32_t *  flags 
)

Read (and optionally clear) IRQ flags in module.

This function allows the external host to check whether an event has occurred in the module that has latched a bit in the "IRQ Flags" vector.

Parameters
[in]flags_to_clearA uint32_t bit vector containing flags that should be cleared if they are set. This can be 0 if the host interface just wants to read without clearing. If a bit is set, this function performs a clear-on-read of the irq_flags bits passed in.
[out]flagsA uint32_t bit vector - the value of the irq_flags in the module. Note that if the flags_to_clear argument is non-zero, this argument is the value of the flags before the clear operation.
Returns
0 - success, negative otherwise.
int32_t ll_mac_mode_get ( ll_mac_type_t mac_mode)

Get the MAC Mode.

Parameters
[out]mac_modeThe current MAC operating mode.
Returns
0 - success, negative otherwise.
int32_t ll_mac_mode_set ( ll_mac_type_t  mac_mode)

Set the MAC Mode.

Parameters
[in]mac_mode0 = No MAC (Pass through mode) 3 = Symphony Link
Returns
0 - success, negative otherwise.
void ll_net_info_deserialize ( const uint8_t  buff[NET_INFO_BUFF_SIZE],
llabs_network_info_t net_info 
)
uint16_t ll_net_info_serialize ( const llabs_network_info_t net_info,
uint8_t  buff[NET_INFO_BUFF_SIZE] 
)
int32_t ll_reset_mcu ( void  )

Force the module to reset (takes a few seconds).

This function forces the module to reset.

Returns
0 - success, negative otherwise.
int32_t ll_reset_state ( void  )

Reset the host-side state maintained by the interface.

The host implementation maintains a very small amount of state including the current message identifier. This function resets this internal state and is intended to allow for controlled testing. This function is not normally used in production code.

Returns
0 - success, negative otherwise.
int32_t ll_restore_defaults ( void  )

Restore the default radio parameters:

  • frequency
  • bandwidth
  • spreading factor
  • coding rate
  • low_rate_opt
  • tx power

This function stores settings to flash.

Returns
0 - success, negative otherwise.
char const* ll_return_code_description ( int32_t  return_code)

Convert an return code into a description.

Parameters
[in]return_codeThe return code.
Returns
The user-meaningful return code description.
char const* ll_return_code_name ( int32_t  return_code)

Convert an return code into a short name string.

Parameters
[in]return_codeThe return code.
Returns
The short name string.
int32_t ll_settings_delete ( void  )

Delete all settings from flash storage.

This function stores settings to flash.

Returns
0 - success, negative otherwise.
int32_t ll_settings_store ( void  )

Store the current radio parameters to flash:

  • mode
  • frequency
  • bandwidth
  • spreading factor
  • coding rate
  • low_rate_opt
  • tx power

This function stores settings to flash.

Returns
0 - success, negative otherwise.
int32_t ll_sleep ( void  )

Force the module to enter sleep.

This function puts the module into the sleep mode. The wakeup signal is issued with a logic high pulse of at least 60 us duration. Alternatively, the module will enter the idle state in response to a received byte on the host UART.

Returns
0 - success, negative otherwise.
int32_t ll_sleep_block ( void  )

Block any sleep mode.

This function blocks any sleep mode. ll_sleep_unblock() allows the module to enter into the sleep mode again.

Returns
0 - success, negative otherwise.
int32_t ll_sleep_unblock ( void  )

Unblock sleep modes.

This function unblocks sleep mode regardless of how many times ll_sleep_block() has been called.

Returns
0 - success, negative otherwise.
void ll_stats_deserialize ( const uint8_t  buff[STATS_SIZE],
llabs_stats_t stats 
)
uint16_t ll_stats_serialize ( const llabs_stats_t stats,
uint8_t  buff[STATS_SIZE] 
)
void ll_time_deserialize ( const uint8_t  buff[TIME_INFO_SIZE],
llabs_time_info_t time_info 
)
uint16_t ll_time_serialize ( const llabs_time_info_t time_info,
uint8_t  buff[TIME_INFO_SIZE] 
)
int32_t ll_timestamp_get ( uint32_t *  timestamp_us)

Get the module's current timestamp value.

The Link Labs module maintains an internal free-running timestamp. This function queries the current timestamp value at the time the request is processed by the module. This function does not account for any transmission delays.

Parameters
[out]timestamp_usThe current module timestamp in microseconds. The timestamp will wrap back to zero roughly every 71 minutes.
Returns
0 - success, negative otherwise.
int32_t ll_timestamp_set ( ll_timestamp_operation_t  operation,
uint32_t  timestamp_us,
uint32_t *  actual_timestamp_us 
)

Set the module's current timestamp value using an external reference.

The Link Labs module maintains an internal free-running timestamp which is used by ll_pkt_send_timestamp() to schedule packet transmission. This function sets the correction applied to the module's timestamp so that it aligns to the external reference.

Parameters
[in]operationThe operation performed by the module when setting the timestamp. See ll_timestamp_operation_t for details.
[in]timestamp_usThe reference timestamp in microseconds.
[out]actual_timestamp_usThe module's timestamp in microseconds after the set operation was applied.
Returns
0 - success, negative otherwise.
int32_t ll_trigger_assert ( void  )

Triggers an assert (for test purposes).

None.

Returns
0 - success, negative otherwise.
int32_t ll_trigger_watchdog ( void  )

Triggers watchdog reboot from host ifc.

None.

Returns
positive number of bytes queued, negative if an error.
int32_t ll_unique_id_get ( uint64_t *  unique_id)

Get the module unique identifier.

Parameters
[out]unique_idpointer to a unsigned 64-bit integer.
Returns
0 - success, negative otherwise.
int32_t ll_version_get ( ll_version_t version)

Get the module firmware version number.

Parameters
[out]versionpointer to a version struct.
Returns
0 - success, negative otherwise.

Variable Documentation

const uint32_t OPEN_NET_TOKEN

Open network token (0x4f50454e)