Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Sierra Wireless HL7800 cellular modems. More...

Files

file  hl7800.h
 HL7800 modem public API header file.

Data Structures

struct  mdm_hl7800_apn
 Access Point Name configuration. More...
struct  mdm_hl7800_site_survey
 Site survey result. More...
struct  mdm_hl7800_compound_event
 Event data made of a code and a string. More...
struct  mdm_hl7800_polte_registration_event_data
 PoLTE registration result. More...
struct  mdm_hl7800_polte_location_data
 PoLTE location response. More...
struct  mdm_hl7800_callback_agent
 Event callback registration. More...

Macros

#define MDM_HL7800_REVISION_MAX_SIZE   29
 Size of a firmware revision string, including the terminating NUL.
#define MDM_HL7800_REVISION_MAX_STRLEN   (MDM_HL7800_REVISION_MAX_SIZE - 1)
 Maximum length of a firmware revision string.
#define MDM_HL7800_IMEI_SIZE   16
 Size of an IMEI string, including the terminating NUL.
#define MDM_HL7800_IMEI_STRLEN   (MDM_HL7800_IMEI_SIZE - 1)
 Length of an IMEI string.
#define MDM_HL7800_ICCID_MAX_SIZE   21
 Size of an ICCID string, including the terminating NUL.
#define MDM_HL7800_ICCID_MAX_STRLEN   (MDM_HL7800_ICCID_MAX_SIZE - 1)
 Maximum length of an ICCID string.
#define MDM_HL7800_SERIAL_NUMBER_SIZE   15
 Size of a serial number string, including the terminating NUL.
#define MDM_HL7800_SERIAL_NUMBER_STRLEN   (MDM_HL7800_SERIAL_NUMBER_SIZE - 1)
 Length of a serial number string.
#define MDM_HL7800_APN_MAX_SIZE   64
 Size of an Access Point Name, including the terminating NUL.
#define MDM_HL7800_APN_USERNAME_MAX_SIZE   65
 Size of an APN username, including the terminating NUL.
#define MDM_HL7800_APN_PASSWORD_MAX_SIZE   65
 Size of an APN password, including the terminating NUL.
#define MDM_HL7800_APN_MAX_STRLEN   (MDM_HL7800_APN_MAX_SIZE - 1)
 Maximum length of an Access Point Name.
#define MDM_HL7800_APN_USERNAME_MAX_STRLEN   (MDM_HL7800_APN_USERNAME_MAX_SIZE - 1)
 Maximum length of an APN username.
#define MDM_HL7800_APN_PASSWORD_MAX_STRLEN   (MDM_HL7800_APN_PASSWORD_MAX_SIZE - 1)
 Maximum length of an APN password.
#define MDM_HL7800_LTE_BAND_STR_SIZE   21
 Size of an LTE band configuration string, including the terminating NUL.
#define MDM_HL7800_LTE_BAND_STRLEN   (MDM_HL7800_LTE_BAND_STR_SIZE - 1)
 Maximum length of an LTE band configuration string.
#define MDM_HL7800_IMSI_MIN_STR_SIZE   15
 Minimum size of an IMSI string, including the terminating NUL.
#define MDM_HL7800_IMSI_MAX_STR_SIZE   16
 Maximum size of an IMSI string, including the terminating NUL.
#define MDM_HL7800_IMSI_MAX_STRLEN   (MDM_HL7800_IMSI_MAX_STR_SIZE - 1)
 Maximum length of an IMSI string.
#define MDM_HL7800_MAX_GPS_STR_SIZE   33
 Size of a GPS string, including the terminating NUL.
#define MDM_HL7800_MAX_POLTE_USER_ID_SIZE   16
 Size of a PoLTE user ID string, including the terminating NUL.
#define MDM_HL7800_MAX_POLTE_PASSWORD_SIZE   16
 Size of a PoLTE password string, including the terminating NUL.
#define MDM_HL7800_MAX_POLTE_LOCATION_STR_SIZE   33
 Size of a PoLTE location string, including the terminating NUL.
#define MDM_HL7800_POLTE_SERVER_ERROR   10
 Status reported by HL7800_EVENT_POLTE when the PoLTE server could not be reached.

Typedefs

typedef void(* mdm_hl7800_event_callback_t) (enum mdm_hl7800_event event, void *event_data)
 Event callback.

Enumerations

enum  mdm_hl7800_radio_mode { MDM_RAT_CAT_M1 = 0 , MDM_RAT_CAT_NB1 }
 Radio Access Technology. More...
enum  mdm_hl7800_event {
  HL7800_EVENT_RESERVED = 0 , HL7800_EVENT_NETWORK_STATE_CHANGE , HL7800_EVENT_APN_UPDATE , HL7800_EVENT_RSSI ,
  HL7800_EVENT_SINR , HL7800_EVENT_STARTUP_STATE_CHANGE , HL7800_EVENT_SLEEP_STATE_CHANGE , HL7800_EVENT_RAT ,
  HL7800_EVENT_BANDS , HL7800_EVENT_ACTIVE_BANDS , HL7800_EVENT_FOTA_STATE , HL7800_EVENT_FOTA_COUNT ,
  HL7800_EVENT_REVISION , HL7800_EVENT_GPS , HL7800_EVENT_GPS_POSITION_STATUS , HL7800_EVENT_POLTE_REGISTRATION ,
  HL7800_EVENT_POLTE_LOCATE_STATUS , HL7800_EVENT_POLTE , HL7800_EVENT_SITE_SURVEY , HL7800_EVENT_STATE
}
 Event type reported to a mdm_hl7800_event_callback_t. More...
enum  mdm_hl7800_state { HL7800_STATE_NOT_READY = 0 , HL7800_STATE_INITIALIZED }
 Driver state. More...
enum  mdm_hl7800_startup_state {
  HL7800_STARTUP_STATE_READY = 0 , HL7800_STARTUP_STATE_WAITING_FOR_ACCESS_CODE , HL7800_STARTUP_STATE_SIM_NOT_PRESENT , HL7800_STARTUP_STATE_SIMLOCK ,
  HL7800_STARTUP_STATE_UNRECOVERABLE_ERROR , HL7800_STARTUP_STATE_UNKNOWN , HL7800_STARTUP_STATE_INACTIVE_SIM
}
 Modem startup state. More...
enum  mdm_hl7800_network_state {
  HL7800_NOT_REGISTERED = 0 , HL7800_HOME_NETWORK , HL7800_SEARCHING , HL7800_REGISTRATION_DENIED ,
  HL7800_OUT_OF_COVERAGE , HL7800_ROAMING , HL7800_EMERGENCY = 8 , HL7800_UNABLE_TO_CONFIGURE = 0xf0
}
 Network registration state. More...
enum  mdm_hl7800_sleep {
  HL7800_SLEEP_UNINITIALIZED = 0 , HL7800_SLEEP_HIBERNATE , HL7800_SLEEP_AWAKE , HL7800_SLEEP_LITE_HIBERNATE ,
  HL7800_SLEEP_SLEEP
}
 Sleep state. More...
enum  mdm_hl7800_fota_state {
  HL7800_FOTA_IDLE , HL7800_FOTA_START , HL7800_FOTA_WIP , HL7800_FOTA_PAD ,
  HL7800_FOTA_SEND_EOT , HL7800_FOTA_FILE_ERROR , HL7800_FOTA_INSTALL , HL7800_FOTA_REBOOT_AND_RECONFIGURE ,
  HL7800_FOTA_COMPLETE
}
 Firmware update state. More...
enum  mdm_hl7800_functionality { HL7800_FUNCTIONALITY_MINIMUM = 0 , HL7800_FUNCTIONALITY_FULL = 1 , HL7800_FUNCTIONALITY_AIRPLANE = 4 }
 Modem functionality level, follows the +CFUN values. More...
enum  mdm_hl7800_gnss_event {
  HL7800_GNSS_EVENT_INVALID = -1 , HL7800_GNSS_EVENT_INIT , HL7800_GNSS_EVENT_START , HL7800_GNSS_EVENT_STOP ,
  HL7800_GNSS_EVENT_POSITION
}
 GNSS event reported by the modem. More...
enum  mdm_hl7800_gnss_status { HL7800_GNSS_STATUS_INVALID = -1 , HL7800_GNSS_STATUS_FAILURE , HL7800_GNSS_STATUS_SUCCESS }
 Status of a GNSS event. More...
enum  mdm_hl7800_gnss_position_event {
  HL7800_GNSS_POSITION_EVENT_INVALID = -1 , HL7800_GNSS_POSITION_EVENT_LOST_OR_NOT_AVAILABLE_YET , HL7800_GNSS_POSITION_EVENT_PREDICTION_AVAILABLE , HL7800_GNSS_POSITION_EVENT_2D_AVAILABLE ,
  HL7800_GNSS_POSITION_EVENT_3D_AVAILABLE , HL7800_GNSS_POSITION_EVENT_FIXED_TO_INVALID
}
 Position fix status reported by HL7800_EVENT_GPS_POSITION_STATUS. More...
enum  mdm_hl7800_gps_string_types {
  HL7800_GPS_STR_LATITUDE , HL7800_GPS_STR_LONGITUDE , HL7800_GPS_STR_GPS_TIME , HL7800_GPS_STR_FIX_TYPE ,
  HL7800_GPS_STR_HEPE , HL7800_GPS_STR_ALTITUDE , HL7800_GPS_STR_ALT_UNC , HL7800_GPS_STR_DIRECTION ,
  HL7800_GPS_STR_HOR_SPEED , HL7800_GPS_STR_VER_SPEED
}
 Type of GPS string reported by HL7800_EVENT_GPS. More...

Functions

int32_t mdm_hl7800_power_off (void)
 Power off the HL7800.
int32_t mdm_hl7800_reset (void)
 Reset the HL7800 (and allow it to reconfigure).
void mdm_hl7800_wakeup (bool awake)
 Control the wake signals to the HL7800.
int32_t mdm_hl7800_send_at_cmd (const uint8_t *data, uint8_t resp_timeout, char *resp, uint16_t *resp_len)
 Send an AT command to the HL7800.
void mdm_hl7800_get_signal_quality (int *rsrp, int *sinr)
 Get the signal quality of the HL7800.
char * mdm_hl7800_get_iccid (void)
 Get the SIM card ICCID.
char * mdm_hl7800_get_sn (void)
 Get the HL7800 serial number.
char * mdm_hl7800_get_imei (void)
 Get the HL7800 IMEI.
char * mdm_hl7800_get_fw_version (void)
 Get the HL7800 firmware version.
char * mdm_hl7800_get_imsi (void)
 Get the IMSI.
int32_t mdm_hl7800_update_apn (char *access_point_name)
 Update the Access Point Name in the modem.
int32_t mdm_hl7800_update_rat (enum mdm_hl7800_radio_mode value)
 Update the Radio Access Technology (mode).
bool mdm_hl7800_valid_rat (uint8_t value)
 Check if a Radio Access Technology value is valid.
int mdm_hl7800_register_event_callback (struct mdm_hl7800_callback_agent *agent)
 Register a function that is called when a modem event occurs.
int mdm_hl7800_unregister_event_callback (struct mdm_hl7800_callback_agent *agent)
 Unregister a callback event function.
void mdm_hl7800_generate_status_events (void)
 Force modem module to generate status events.
int32_t mdm_hl7800_get_local_time (struct tm *tm, int32_t *offset)
 Get the local time from the modem's real time clock.
int32_t mdm_hl7800_update_fw (char *file_path)
 Update the HL7800 via XMODEM protocol.
int32_t mdm_hl7800_get_operator_index (void)
 Read the operator index from the modem.
int32_t mdm_hl7800_get_functionality (void)
 Get modem functionality.
int32_t mdm_hl7800_set_functionality (enum mdm_hl7800_functionality mode)
 Set airplane, normal, or reduced functionality mode.
int32_t mdm_hl7800_set_gps_rate (uint32_t rate)
 When rate is non-zero: Put modem into Airplane mode.
int32_t mdm_hl7800_polte_register (void)
 Register modem/SIM with polte.io.
int32_t mdm_hl7800_polte_enable (char *user, char *password)
 Enable PoLTE.
int32_t mdm_hl7800_polte_locate (void)
 Locate device using PoLTE.
int32_t mdm_hl7800_perform_site_survey (void)
 Perform a site survey.
int mdm_hl7800_set_desired_sleep_level (enum mdm_hl7800_sleep level)
 Set desired sleep level.
void mdm_hl7800_register_wake_test_point_callback (void(*func)(int state))
 Allows mapping of WAKE_UP signal to a user accessible test point on the development board.
void mdm_hl7800_register_gpio6_callback (void(*func)(int state))
 Allows mapping of P1.12_GPIO6 signal to a user accessible test point on the development board.
void mdm_hl7800_register_cts_callback (void(*func)(int state))
 Allows mapping of UART1_CTS signal to a user accessible test point on the development board.
int32_t mdm_hl7800_set_bands (const char *bands)
 Set the bands available for the LTE connection.
uint32_t mdm_hl7800_log_filter_set (uint32_t level)
 Set the log level for the modem.

Detailed Description

Sierra Wireless HL7800 cellular modems.

Macro Definition Documentation

◆ MDM_HL7800_APN_MAX_SIZE

#define MDM_HL7800_APN_MAX_SIZE   64

#include <hl7800.h>

Size of an Access Point Name, including the terminating NUL.

◆ MDM_HL7800_APN_MAX_STRLEN

#define MDM_HL7800_APN_MAX_STRLEN   (MDM_HL7800_APN_MAX_SIZE - 1)

#include <hl7800.h>

Maximum length of an Access Point Name.

◆ MDM_HL7800_APN_PASSWORD_MAX_SIZE

#define MDM_HL7800_APN_PASSWORD_MAX_SIZE   65

#include <hl7800.h>

Size of an APN password, including the terminating NUL.

◆ MDM_HL7800_APN_PASSWORD_MAX_STRLEN

#define MDM_HL7800_APN_PASSWORD_MAX_STRLEN   (MDM_HL7800_APN_PASSWORD_MAX_SIZE - 1)

#include <hl7800.h>

Maximum length of an APN password.

◆ MDM_HL7800_APN_USERNAME_MAX_SIZE

#define MDM_HL7800_APN_USERNAME_MAX_SIZE   65

#include <hl7800.h>

Size of an APN username, including the terminating NUL.

◆ MDM_HL7800_APN_USERNAME_MAX_STRLEN

#define MDM_HL7800_APN_USERNAME_MAX_STRLEN   (MDM_HL7800_APN_USERNAME_MAX_SIZE - 1)

#include <hl7800.h>

Maximum length of an APN username.

◆ MDM_HL7800_ICCID_MAX_SIZE

#define MDM_HL7800_ICCID_MAX_SIZE   21

#include <hl7800.h>

Size of an ICCID string, including the terminating NUL.

◆ MDM_HL7800_ICCID_MAX_STRLEN

#define MDM_HL7800_ICCID_MAX_STRLEN   (MDM_HL7800_ICCID_MAX_SIZE - 1)

#include <hl7800.h>

Maximum length of an ICCID string.

◆ MDM_HL7800_IMEI_SIZE

#define MDM_HL7800_IMEI_SIZE   16

#include <hl7800.h>

Size of an IMEI string, including the terminating NUL.

◆ MDM_HL7800_IMEI_STRLEN

#define MDM_HL7800_IMEI_STRLEN   (MDM_HL7800_IMEI_SIZE - 1)

#include <hl7800.h>

Length of an IMEI string.

◆ MDM_HL7800_IMSI_MAX_STR_SIZE

#define MDM_HL7800_IMSI_MAX_STR_SIZE   16

#include <hl7800.h>

Maximum size of an IMSI string, including the terminating NUL.

◆ MDM_HL7800_IMSI_MAX_STRLEN

#define MDM_HL7800_IMSI_MAX_STRLEN   (MDM_HL7800_IMSI_MAX_STR_SIZE - 1)

#include <hl7800.h>

Maximum length of an IMSI string.

◆ MDM_HL7800_IMSI_MIN_STR_SIZE

#define MDM_HL7800_IMSI_MIN_STR_SIZE   15

#include <hl7800.h>

Minimum size of an IMSI string, including the terminating NUL.

◆ MDM_HL7800_LTE_BAND_STR_SIZE

#define MDM_HL7800_LTE_BAND_STR_SIZE   21

#include <hl7800.h>

Size of an LTE band configuration string, including the terminating NUL.

◆ MDM_HL7800_LTE_BAND_STRLEN

#define MDM_HL7800_LTE_BAND_STRLEN   (MDM_HL7800_LTE_BAND_STR_SIZE - 1)

#include <hl7800.h>

Maximum length of an LTE band configuration string.

◆ MDM_HL7800_MAX_GPS_STR_SIZE

#define MDM_HL7800_MAX_GPS_STR_SIZE   33

#include <hl7800.h>

Size of a GPS string, including the terminating NUL.

◆ MDM_HL7800_MAX_POLTE_LOCATION_STR_SIZE

#define MDM_HL7800_MAX_POLTE_LOCATION_STR_SIZE   33

#include <hl7800.h>

Size of a PoLTE location string, including the terminating NUL.

◆ MDM_HL7800_MAX_POLTE_PASSWORD_SIZE

#define MDM_HL7800_MAX_POLTE_PASSWORD_SIZE   16

#include <hl7800.h>

Size of a PoLTE password string, including the terminating NUL.

◆ MDM_HL7800_MAX_POLTE_USER_ID_SIZE

#define MDM_HL7800_MAX_POLTE_USER_ID_SIZE   16

#include <hl7800.h>

Size of a PoLTE user ID string, including the terminating NUL.

◆ MDM_HL7800_POLTE_SERVER_ERROR

#define MDM_HL7800_POLTE_SERVER_ERROR   10

#include <hl7800.h>

Status reported by HL7800_EVENT_POLTE when the PoLTE server could not be reached.

Assign the server error code (location response) to a value that isn't used by locate response so that a single status callback can be used.

◆ MDM_HL7800_REVISION_MAX_SIZE

#define MDM_HL7800_REVISION_MAX_SIZE   29

#include <hl7800.h>

Size of a firmware revision string, including the terminating NUL.

◆ MDM_HL7800_REVISION_MAX_STRLEN

#define MDM_HL7800_REVISION_MAX_STRLEN   (MDM_HL7800_REVISION_MAX_SIZE - 1)

#include <hl7800.h>

Maximum length of a firmware revision string.

◆ MDM_HL7800_SERIAL_NUMBER_SIZE

#define MDM_HL7800_SERIAL_NUMBER_SIZE   15

#include <hl7800.h>

Size of a serial number string, including the terminating NUL.

◆ MDM_HL7800_SERIAL_NUMBER_STRLEN

#define MDM_HL7800_SERIAL_NUMBER_STRLEN   (MDM_HL7800_SERIAL_NUMBER_SIZE - 1)

#include <hl7800.h>

Length of a serial number string.

Typedef Documentation

◆ mdm_hl7800_event_callback_t

typedef void(* mdm_hl7800_event_callback_t) (enum mdm_hl7800_event event, void *event_data)

#include <hl7800.h>

Event callback.

Parameters
eventThe type of event
event_dataPointer to the event specific data structure, as listed in the documentation of each mdm_hl7800_event value

Enumeration Type Documentation

◆ mdm_hl7800_event

#include <hl7800.h>

Event type reported to a mdm_hl7800_event_callback_t.

The documentation of each event lists the type that the event_data argument of the callback points to when it is invoked with that event.

Enumerator
HL7800_EVENT_RESERVED 

Reserved, not generated.

HL7800_EVENT_NETWORK_STATE_CHANGE 

Network registration change.

The event data points to a struct mdm_hl7800_compound_event holding an enum mdm_hl7800_network_state code.

HL7800_EVENT_APN_UPDATE 

Access Point Name change.

The event data points to a struct mdm_hl7800_apn.

HL7800_EVENT_RSSI 

Reference Signal Received Power change.

The event data points to an int holding the RSRP in dBm.

HL7800_EVENT_SINR 

Signal to Interference plus Noise Ratio change.

The event data points to an int holding the SINR in dB.

HL7800_EVENT_STARTUP_STATE_CHANGE 

Modem startup state change.

The event data points to a struct mdm_hl7800_compound_event holding an enum mdm_hl7800_startup_state code.

HL7800_EVENT_SLEEP_STATE_CHANGE 

Sleep state change.

The event data points to a struct mdm_hl7800_compound_event holding an enum mdm_hl7800_sleep code.

HL7800_EVENT_RAT 

Radio Access Technology change.

The event data points to an enum mdm_hl7800_radio_mode value.

HL7800_EVENT_BANDS 

Configured LTE bands changed.

The event data points to a NUL terminated band configuration string.

HL7800_EVENT_ACTIVE_BANDS 

Active LTE bands changed.

The event data points to a NUL terminated band configuration string.

HL7800_EVENT_FOTA_STATE 

Firmware update state change.

The event data points to a struct mdm_hl7800_compound_event holding an enum mdm_hl7800_fota_state code.

HL7800_EVENT_FOTA_COUNT 

Firmware update progress.

The event data points to a uint32_t holding the number of bytes sent to the modem.

HL7800_EVENT_REVISION 

Firmware revision change.

The event data points to a NUL terminated revision string.

HL7800_EVENT_GPS 

GPS data received.

The event data points to a struct mdm_hl7800_compound_event holding an enum mdm_hl7800_gps_string_types code.

HL7800_EVENT_GPS_POSITION_STATUS 

Position fix status change.

The event data points to an int holding an enum mdm_hl7800_gnss_position_event value.

HL7800_EVENT_POLTE_REGISTRATION 

PoLTE registration result.

The event data points to a struct mdm_hl7800_polte_registration_event_data.

HL7800_EVENT_POLTE_LOCATE_STATUS 

Result of issuing the PoLTE locate command.

The event data points to a struct mdm_hl7800_polte_location_data with only the status valid.

HL7800_EVENT_POLTE 

PoLTE location response.

The event data points to a struct mdm_hl7800_polte_location_data.

HL7800_EVENT_SITE_SURVEY 

Site survey response.

The event data points to a struct mdm_hl7800_site_survey. The event is generated once for each response received from the modem.

HL7800_EVENT_STATE 

Driver state change.

The event data points to a struct mdm_hl7800_compound_event holding an enum mdm_hl7800_state code.

◆ mdm_hl7800_fota_state

#include <hl7800.h>

Firmware update state.

Enumerator
HL7800_FOTA_IDLE 

No update in progress.

HL7800_FOTA_START 

Update file transfer is starting.

HL7800_FOTA_WIP 

File transfer in progress.

HL7800_FOTA_PAD 

Padding of the last XMODEM block.

HL7800_FOTA_SEND_EOT 

End of transmission being sent.

HL7800_FOTA_FILE_ERROR 

Update file could not be read.

HL7800_FOTA_INSTALL 

Modem is installing the update.

HL7800_FOTA_REBOOT_AND_RECONFIGURE 

Modem is rebooting to complete the update.

HL7800_FOTA_COMPLETE 

Update complete.

◆ mdm_hl7800_functionality

#include <hl7800.h>

Modem functionality level, follows the +CFUN values.

Enumerator
HL7800_FUNCTIONALITY_MINIMUM 

Minimum (reduced) functionality.

HL7800_FUNCTIONALITY_FULL 

Full functionality.

HL7800_FUNCTIONALITY_AIRPLANE 

Airplane mode (radio disabled).

◆ mdm_hl7800_gnss_event

#include <hl7800.h>

GNSS event reported by the modem.

Enumerator
HL7800_GNSS_EVENT_INVALID 

Event could not be parsed.

HL7800_GNSS_EVENT_INIT 

GNSS initialized.

HL7800_GNSS_EVENT_START 

Position fix started.

HL7800_GNSS_EVENT_STOP 

Position fix stopped.

HL7800_GNSS_EVENT_POSITION 

Position fix status change.

◆ mdm_hl7800_gnss_position_event

#include <hl7800.h>

Position fix status reported by HL7800_EVENT_GPS_POSITION_STATUS.

Enumerator
HL7800_GNSS_POSITION_EVENT_INVALID 

Event could not be parsed.

HL7800_GNSS_POSITION_EVENT_LOST_OR_NOT_AVAILABLE_YET 

No position fix.

HL7800_GNSS_POSITION_EVENT_PREDICTION_AVAILABLE 

Predicted position available.

HL7800_GNSS_POSITION_EVENT_2D_AVAILABLE 

2D position fix available

HL7800_GNSS_POSITION_EVENT_3D_AVAILABLE 

3D position fix available

HL7800_GNSS_POSITION_EVENT_FIXED_TO_INVALID 

Position fix was lost.

◆ mdm_hl7800_gnss_status

#include <hl7800.h>

Status of a GNSS event.

Enumerator
HL7800_GNSS_STATUS_INVALID 

Status could not be parsed.

HL7800_GNSS_STATUS_FAILURE 

Operation failed.

HL7800_GNSS_STATUS_SUCCESS 

Operation succeeded.

◆ mdm_hl7800_gps_string_types

#include <hl7800.h>

Type of GPS string reported by HL7800_EVENT_GPS.

Enumerator
HL7800_GPS_STR_LATITUDE 

Latitude.

HL7800_GPS_STR_LONGITUDE 

Longitude.

HL7800_GPS_STR_GPS_TIME 

Time of the position fix.

HL7800_GPS_STR_FIX_TYPE 

Type of position fix.

HL7800_GPS_STR_HEPE 

Horizontal Estimated Position Error.

HL7800_GPS_STR_ALTITUDE 

Altitude.

HL7800_GPS_STR_ALT_UNC 

Altitude uncertainty.

HL7800_GPS_STR_DIRECTION 

Direction of movement.

HL7800_GPS_STR_HOR_SPEED 

Horizontal speed.

HL7800_GPS_STR_VER_SPEED 

Vertical speed.

◆ mdm_hl7800_network_state

#include <hl7800.h>

Network registration state.

Follows the +CEREG registration status values, with Laird defined states above 0xef.

Enumerator
HL7800_NOT_REGISTERED 

Not registered, not searching.

HL7800_HOME_NETWORK 

Registered, home network.

HL7800_SEARCHING 

Not registered, searching for an operator.

HL7800_REGISTRATION_DENIED 

Registration denied.

HL7800_OUT_OF_COVERAGE 

Out of coverage.

HL7800_ROAMING 

Registered, roaming.

HL7800_EMERGENCY 

Emergency services only.

HL7800_UNABLE_TO_CONFIGURE 

Modem could not be configured.

◆ mdm_hl7800_radio_mode

#include <hl7800.h>

Radio Access Technology.

Enumerator
MDM_RAT_CAT_M1 

LTE-M (LTE Cat M1).

MDM_RAT_CAT_NB1 

NB-IoT (LTE Cat NB1).

◆ mdm_hl7800_sleep

#include <hl7800.h>

Sleep state.

Enumerator
HL7800_SLEEP_UNINITIALIZED 

Sleep state not known yet.

HL7800_SLEEP_HIBERNATE 

Hibernate (lowest power consumption).

HL7800_SLEEP_AWAKE 

Awake.

HL7800_SLEEP_LITE_HIBERNATE 

Lite hibernate (IO state retained).

HL7800_SLEEP_SLEEP 

Sleep (UART can wake the modem).

◆ mdm_hl7800_startup_state

#include <hl7800.h>

Modem startup state.

Enumerator
HL7800_STARTUP_STATE_READY 

Ready.

HL7800_STARTUP_STATE_WAITING_FOR_ACCESS_CODE 

SIM waiting for PIN or PUK.

HL7800_STARTUP_STATE_SIM_NOT_PRESENT 

No SIM card present.

HL7800_STARTUP_STATE_SIMLOCK 

SIM locked to another operator.

HL7800_STARTUP_STATE_UNRECOVERABLE_ERROR 

Unrecoverable error.

HL7800_STARTUP_STATE_UNKNOWN 

Unknown state.

HL7800_STARTUP_STATE_INACTIVE_SIM 

SIM card is inactive.

◆ mdm_hl7800_state

#include <hl7800.h>

Driver state.

Enumerator
HL7800_STATE_NOT_READY 

Driver is not ready.

HL7800_STATE_INITIALIZED 

Driver has configured the modem.

Function Documentation

◆ mdm_hl7800_generate_status_events()

void mdm_hl7800_generate_status_events ( void )

#include <hl7800.h>

Force modem module to generate status events.

Note
This can be used to get the current state when a module initializes later than the modem.

◆ mdm_hl7800_get_functionality()

int32_t mdm_hl7800_get_functionality ( void )

#include <hl7800.h>

Get modem functionality.

Returns
int32_t negative errno on failure, else mdm_hl7800_functionality

◆ mdm_hl7800_get_fw_version()

char * mdm_hl7800_get_fw_version ( void )

#include <hl7800.h>

Get the HL7800 firmware version.

Returns
NUL terminated firmware version string

◆ mdm_hl7800_get_iccid()

char * mdm_hl7800_get_iccid ( void )

#include <hl7800.h>

Get the SIM card ICCID.

Returns
NUL terminated ICCID string

◆ mdm_hl7800_get_imei()

char * mdm_hl7800_get_imei ( void )

#include <hl7800.h>

Get the HL7800 IMEI.

Returns
NUL terminated IMEI string

◆ mdm_hl7800_get_imsi()

char * mdm_hl7800_get_imsi ( void )

#include <hl7800.h>

Get the IMSI.

Returns
NUL terminated IMSI string

◆ mdm_hl7800_get_local_time()

int32_t mdm_hl7800_get_local_time ( struct tm * tm,
int32_t * offset )

#include <hl7800.h>

Get the local time from the modem's real time clock.

Parameters
tmtime structure
offsetThe amount the local time is offset from GMT/UTC in seconds.
Returns
int32_t 0 if successful

◆ mdm_hl7800_get_operator_index()

int32_t mdm_hl7800_get_operator_index ( void )

#include <hl7800.h>

Read the operator index from the modem.

Return values
negativeerror code, 0 on success

◆ mdm_hl7800_get_signal_quality()

void mdm_hl7800_get_signal_quality ( int * rsrp,
int * sinr )

#include <hl7800.h>

Get the signal quality of the HL7800.

If

CONFIG_MODEM_HL7800_RSSI_RATE_SECONDS 

is non-zero, then this function returns the value from the last periodic read. If

CONFIG_MODEM_HL7800_RSSI_RATE_SECONDS 

is 0, then this may cause the modem to be woken so that the values can be queried.

Parameters
rsrpReference Signals Received Power (dBm) Range = -140 dBm to -44 dBm
sinrSignal to Interference plus Noise Ratio (dB) Range = -128 dB to 40 dB

◆ mdm_hl7800_get_sn()

char * mdm_hl7800_get_sn ( void )

#include <hl7800.h>

Get the HL7800 serial number.

Returns
NUL terminated serial number string

◆ mdm_hl7800_log_filter_set()

uint32_t mdm_hl7800_log_filter_set ( uint32_t level)

#include <hl7800.h>

Set the log level for the modem.

Note
It cannot be set higher than CONFIG_MODEM_LOG_LEVEL. If debug level is desired, then it must be compiled with that level.
Parameters
level0 (None) - 4 (Debug)
Return values
newlog level

◆ mdm_hl7800_perform_site_survey()

int32_t mdm_hl7800_perform_site_survey ( void )

#include <hl7800.h>

Perform a site survey.

This command may return different values each time it is run (depending on what is in range).

HL7800_EVENT_SITE_SURVEY is generated for each response received from modem.

Return values
negativeerror code, 0 on success

◆ mdm_hl7800_polte_enable()

int32_t mdm_hl7800_polte_enable ( char * user,
char * password )

#include <hl7800.h>

Enable PoLTE.

Parameters
userfrom polte.io or register command callback
passwordfrom polte.io register command callback
Returns
int32_t negative errno, 0 on success

◆ mdm_hl7800_polte_locate()

int32_t mdm_hl7800_polte_locate ( void )

#include <hl7800.h>

Locate device using PoLTE.

Note
The first HL7800_EVENT_POLTE_LOCATE_STATUS event indicates the status of issuing the locate command. The second event requires 20-120 seconds to be generated and it contains the location information (or indicates server failure).
Returns
int32_t negative errno, 0 on success

◆ mdm_hl7800_polte_register()

int32_t mdm_hl7800_polte_register ( void )

#include <hl7800.h>

Register modem/SIM with polte.io.

Note
It takes around 30 seconds for HL7800_EVENT_POLTE_REGISTRATION to be generated. If the applications saves the user and password information into non-volatile memory, then this command only needs to be run once.
Returns
int32_t negative errno, 0 on success

◆ mdm_hl7800_power_off()

int32_t mdm_hl7800_power_off ( void )

#include <hl7800.h>

Power off the HL7800.

Returns
int32_t 0 for success

◆ mdm_hl7800_register_cts_callback()

void mdm_hl7800_register_cts_callback ( void(* func )(int state))

#include <hl7800.h>

Allows mapping of UART1_CTS signal to a user accessible test point on the development board.

Parameters
functo be called when CTS state changes if sleep level is sleep. The state parameter of the callback follows gpio_pin_get definitions, but will default low if there is an error reading pin

◆ mdm_hl7800_register_event_callback()

int mdm_hl7800_register_event_callback ( struct mdm_hl7800_callback_agent * agent)

#include <hl7800.h>

Register a function that is called when a modem event occurs.

Multiple users registering for callbacks is supported.

Parameters
agentevent callback agent
Return values
0on success, negative on failure

◆ mdm_hl7800_register_gpio6_callback()

void mdm_hl7800_register_gpio6_callback ( void(* func )(int state))

#include <hl7800.h>

Allows mapping of P1.12_GPIO6 signal to a user accessible test point on the development board.

Parameters
functo be called when modem wakes/sleeps is sleep level is hibernate or lite hibernate. The state parameter of the callback follows gpio_pin_get definitions, but will default high if there is an error reading pin

◆ mdm_hl7800_register_wake_test_point_callback()

void mdm_hl7800_register_wake_test_point_callback ( void(* func )(int state))

#include <hl7800.h>

Allows mapping of WAKE_UP signal to a user accessible test point on the development board.

Parameters
functo be called when application requests modem wake/sleep. The state parameter of the callback is 1 when modem should stay awake, 0 when modem can sleep

◆ mdm_hl7800_reset()

int32_t mdm_hl7800_reset ( void )

#include <hl7800.h>

Reset the HL7800 (and allow it to reconfigure).

Returns
int32_t >= 0 for success, < 0 for failure

◆ mdm_hl7800_send_at_cmd()

int32_t mdm_hl7800_send_at_cmd ( const uint8_t * data,
uint8_t resp_timeout,
char * resp,
uint16_t * resp_len )

#include <hl7800.h>

Send an AT command to the HL7800.

Note
This API should only be used for debug purposes. It is possible to break the driver using this API.
Parameters
dataAT command string
resp_timeoutTimeout in seconds to wait for the response
respPointer to the response buffer. This can be NULL to ignore the response.
resp_lenInput: length of the response buffer, Output: length of the response. This can be NULL.
Returns
int32_t 0 for success

◆ mdm_hl7800_set_bands()

int32_t mdm_hl7800_set_bands ( const char * bands)

#include <hl7800.h>

Set the bands available for the LTE connection.

NOTE: This will cause the modem to reboot. This call returns before the reboot.

Parameters
bandsBand bitmap in hexadecimal format without the 0x prefix. Leading 0's for the value can be omitted.
Returns
int32_t negative errno, 0 on success

◆ mdm_hl7800_set_desired_sleep_level()

int mdm_hl7800_set_desired_sleep_level ( enum mdm_hl7800_sleep level)

#include <hl7800.h>

Set desired sleep level.

Requires

CONFIG_MODEM_HL7800_LOW_POWER_MODE 

.

Parameters
level(sleep, lite hibernate, or hibernate)
Returns
int negative errno, 0 on success

◆ mdm_hl7800_set_functionality()

int32_t mdm_hl7800_set_functionality ( enum mdm_hl7800_functionality mode)

#include <hl7800.h>

Set airplane, normal, or reduced functionality mode.

Airplane mode persists when reset.

Note
Boot functionality is also controlled by
CONFIG_MODEM_HL7800_BOOT_IN_AIRPLANE_MODE 
.
Parameters
modenew functionality level
Returns
int32_t negative errno, 0 on success

◆ mdm_hl7800_set_gps_rate()

int32_t mdm_hl7800_set_gps_rate ( uint32_t rate)

#include <hl7800.h>

When rate is non-zero: Put modem into Airplane mode.

Enable GPS and generate HL7800_EVENT_GPS events. When zero: Disable GPS and put modem into normal mode.

Note
Airplane mode isn't cleared when the modem is reset.
Parameters
ratein seconds to query location
Returns
int32_t negative errno, 0 on success

◆ mdm_hl7800_unregister_event_callback()

int mdm_hl7800_unregister_event_callback ( struct mdm_hl7800_callback_agent * agent)

#include <hl7800.h>

Unregister a callback event function.

Parameters
agentevent callback agent
Return values
0on success, negative on failure

◆ mdm_hl7800_update_apn()

int32_t mdm_hl7800_update_apn ( char * access_point_name)

#include <hl7800.h>

Update the Access Point Name in the modem.

Parameters
access_point_nameNUL terminated APN string
Return values
0on success, negative on failure.

◆ mdm_hl7800_update_fw()

int32_t mdm_hl7800_update_fw ( char * file_path)

#include <hl7800.h>

Update the HL7800 via XMODEM protocol.

During the firmware update no other modem functions will be available.

Only available if

CONFIG_MODEM_HL7800_FW_UPDATE 

is enabled.

Parameters
file_pathAbsolute path of the update file
Returns
0 if successful

◆ mdm_hl7800_update_rat()

int32_t mdm_hl7800_update_rat ( enum mdm_hl7800_radio_mode value)

#include <hl7800.h>

Update the Radio Access Technology (mode).

Parameters
valuenew Radio Access Technology
Return values
0on success, negative on failure.

◆ mdm_hl7800_valid_rat()

bool mdm_hl7800_valid_rat ( uint8_t value)

#include <hl7800.h>

Check if a Radio Access Technology value is valid.

Parameters
valueRAT value to check
Return values
trueif RAT value is valid

◆ mdm_hl7800_wakeup()

void mdm_hl7800_wakeup ( bool awake)

#include <hl7800.h>

Control the wake signals to the HL7800.

Note
this API should only be used for debug purposes.
Parameters
awakeTrue to keep the HL7800 awake, False to allow sleep