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

Sierra Wireless HL78xx cellular modems. More...

Files

file  hl78xx_apis.h
 Header file for extended cellular API of HL78xx modems.

Data Structures

struct  kselacq_syntax
 KSELACQ RAT configuration syntax. More...
struct  hl78xx_cxreg_status
 Cached +CEREG/+CREG registration details. More...
struct  hl78xx_network_operator
 Cached network operator information. More...
struct  hl78xx_network_info
 Cached network information. More...
struct  hl78xx_agnss_status
 A-GNSS assistance data status structure. More...
struct  k_cellmeas_signal_info
 Cellular measurement signal information. More...
struct  hl78xx_network
 Cellular network structure. More...
struct  hl78xx_ctzeu_update
 Parsed +CTZEU update payload. More...
struct  hl78xx_evt
 HL78xx event structure. More...
struct  nmea_match_gsa_data
 Parsed GSA sentence data (GNSS DOP and Active Satellites). More...
struct  nmea_match_gst_data
 Parsed GST sentence data (GNSS Pseudorange Error Statistics). More...
struct  nmea_match_epu_data
 Parsed EPU sentence data (HL78xx proprietary position error). More...
struct  hl78xx_gnss_nmea_aux_data
 Container for all GNSS auxiliary NMEA data. More...
struct  hl78xx_gnss_aux_data_callback
 GNSS auxiliary data callback structure. More...
struct  hl78xx_at_notification
 Parsed unsolicited AT notification payload. More...
struct  hl78xx_at_monitor_entry
 AT monitor entry structure. More...
struct  hl78xx_evt_monitor_entry
 Event monitor entry structure. More...

Macros

#define CSQ_RSSI_UNKNOWN   (99)
 Unknown RSSI value returned by AT+CSQ command.
#define CSQ_RSSI_MAX   (31)
 Maximum valid RSSI code returned by AT+CSQ command.
#define CESQ_RSRP_UNKNOWN   (255)
 Unknown RSRP value returned by AT+CESQ command.
#define CESQ_RSRP_MAX   (97)
 Maximum valid RSRP code returned by AT+CESQ command.
#define CESQ_RSRQ_UNKNOWN   (255)
 Unknown RSRQ value returned by AT+CESQ command.
#define CESQ_RSRQ_MAX   (34)
 Maximum valid RSRQ code returned by AT+CESQ command.
#define HL78XX_MODEM_AT_ERROR   1
 Modem response type for generic ERROR responses returned by public AT helpers.
#define HL78XX_MODEM_AT_CME_ERROR   2
 Modem response type for +CME ERROR responses returned by public AT helpers.
#define HL78XX_MODEM_AT_CMS_ERROR   3
 Modem response type for +CMS ERROR responses returned by public AT helpers.
#define CSQ_RSSI_TO_DB(v)
 Convert CSQ RSSI value to dBm.
#define CESQ_RSRP_TO_DB(v)
 Convert CESQ RSRP value to dBm.
#define CESQ_RSRQ_TO_DB(v)
 Convert CESQ RSRQ value to dB.
#define PAUSED   1
 Monitor is paused.
#define ACTIVE   0
 Monitor is active, default.
#define MDM_MANUFACTURER_LENGTH   20
 Maximum length of modem manufacturer string.
#define MDM_MODEL_LENGTH   32
 Maximum length of modem model string.
#define MDM_REVISION_LENGTH   64
 Maximum length of modem revision string.
#define MDM_IMEI_LENGTH   16
 Maximum length of modem IMEI string.
#define MDM_IMSI_LENGTH   23
 Maximum length of modem IMSI string.
#define MDM_ICCID_LENGTH   22
 Maximum length of modem ICCID string.
#define MDM_APN_MAX_LENGTH   64
 Maximum length of APN string.
#define MDM_MAX_CERT_LENGTH   4096
 Maximum length of certificate.
#define MDM_MAX_HOSTNAME_LEN   128
 Maximum length of hostname.
#define MDM_SERIAL_NUMBER_LENGTH   32
 Maximum length of serial number string.
#define HL78XX_CTZEU_UTIME_MAX_LEN   32
 Recommended buffer size for extracted +CTZEU universal time strings.
#define HL78XX_CEREG_TIMER_STR_LEN   9
 Maximum length of CEREG timer string.
#define HL78XX_NETWORK_ADDRESS_MAX_LEN   46
 Maximum length of network address string.
#define MDM_HL78XX_EOF_PATTERN   "--EOF--Pattern--"
 Pattern used to indicate end-of-file or completion of data transmission.
#define MDM_HL78XX_TERMINATION_PATTERN   "+++"
 Escape/termination sequence used to exit data mode and return to command mode.
#define MDM_HL78XX_CONNECT_STRING   "CONNECT"
 Response string indicating a successful data connection has been established.
#define MDM_HL78XX_NO_CARRIER_STRING   "NO CARRIER"
 Response string indicating the connection has been lost or terminated.
#define MDM_HL78XX_CME_ERROR_STRING   "+CME ERROR: "
 Prefix for CME (Mobile Equipment) error responses, typically followed by an error code.
#define MDM_HL78XX_CMS_ERROR_STRING   "+CMS ERROR: "
 Prefix for CMS (Message Service) error responses, typically related to SMS operations.
#define MDM_HL78XX_ERROR_STRING   "ERROR"
 Generic error response string indicating command failure.
#define MDM_HL78XX_OK_STRING   "OK"
 Standard response string indicating successful execution of an AT command.
#define MDM_HL78XX_DESIRED_VERSION_STRING
 Desired firmware version string.
#define HL78XX_MONITOR_ACTIVE   false
 Initial active state for HL78xx monitors.
#define HL78XX_MONITOR_PAUSED   true
 Initial paused state for HL78xx monitors.
#define HL78XX_MONITOR_INITIAL_PAUSED(...)
 Resolve the optional monitor initial state argument.
#define HL78XX_EVT_MONITOR(name, _handler, ...)
 Define an Event monitor to receive notifications in the system workqueue thread.
#define HL78XX_AT_MONITOR_ANY   NULL
 Monitor any parsed unsolicited AT notification.
#define HL78XX_AT_MONITOR(name, _filter, _handler, ...)
 Define an AT monitor to receive parsed unsolicited AT notifications in the system workqueue thread.
#define HL78XX_AT_MONITOR_DIRECT(name, _filter, _handler, ...)
 Define an AT monitor to receive parsed unsolicited AT notifications directly in the HL78xx modem RX workqueue context.
#define GNSS_AUX_DATA_CALLBACK_DEFINE(_dev, _callback)
 Register a callback structure for GNSS auxiliary data published.
#define GNSS_DT_AUX_DATA_CALLBACK_DEFINE(_node_id, _callback)
 Register a callback structure for GNSS auxiliary data published.

Typedefs

typedef bool(* hl78xx_runtime_band_provider_t) (const struct device *dev, enum hl78xx_cell_rat_mode rat, uint16_t *band, void *user_data)
 Callback used to supply an optional runtime band override for a RAT.
typedef void(* hl78xx_gnss_aux_data_callback_t) (const struct device *dev, const struct hl78xx_gnss_nmea_aux_data *aux_data, uint16_t size)
 GNSS auxiliary data callback function type.
typedef int(* hl78xx_api_configure_networks) (const struct device *dev, const struct hl78xx_network *networks, uint8_t size)
 API function pointer for configuring networks.
typedef int(* hl78xx_api_get_supported_networks) (const struct device *dev, const struct hl78xx_network **networks, uint8_t *size)
 API function pointer for getting supported networks.
typedef int(* hl78xx_api_get_signal) (const struct device *dev, const enum cellular_signal_type type, int16_t *value)
 API for getting network signal strength.
typedef int(* hl78xx_api_get_modem_info) (const struct device *dev, const enum cellular_modem_info_type type, char *info, size_t size)
 API function pointer for getting modem information.
typedef int(* hl78xx_api_get_registration_status) (const struct device *dev, enum cellular_access_technology tech, enum cellular_registration_status *status)
 API for getting registration status.
typedef int(* hl78xx_api_set_phone_functionality) (const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)
 API function pointer for setting phone functionality.
typedef int(* hl78xx_api_get_phone_functionality) (const struct device *dev, enum hl78xx_phone_functionality *functionality)
 API for get phone functionality.
typedef int(* hl78xx_api_send_at_cmd) (const struct device *dev, const char *cmd, uint16_t cmd_size, const struct modem_chat_match *response_matches, uint16_t matches_size)
 API for get phone functionality.
typedef void(* hl78xx_at_monitor_handler_t) (const struct hl78xx_at_notification *notif, struct hl78xx_at_monitor_entry *mon)
 AT monitor handler function type.
typedef void(* hl78xx_at_monitor_release_t) (struct hl78xx_at_monitor_entry *mon)
 AT monitor release function type.
typedef void(* hl78xx_evt_monitor_dispatcher_t) (struct hl78xx_evt *notif)
 Event monitor dispatcher function type.
typedef void(* hl78xx_evt_monitor_handler_t) (struct hl78xx_evt *notif, struct hl78xx_evt_monitor_entry *mon)
 Event monitor handler function type.
typedef void(* hl78xx_evt_monitor_release_t) (struct hl78xx_evt_monitor_entry *mon)
 Event monitor release function type.

Enumerations

enum  hl78xx_cell_rat_mode {
  HL78XX_RAT_CAT_M1 = 0 , HL78XX_RAT_NB1 , HL78XX_RAT_GSM , HL78XX_RAT_NBNTN ,
  HL78XX_RAT_MODE_AUTO , HL78XX_RAT_MODE_NONE , HL78XX_RAT_COUNT = HL78XX_RAT_MODE_NONE
}
 Cellular radio access technologies. More...
enum  hl78xx_kselacq_rat { HL78XX_KSELACQ_RAT_CLEAR = 0 , HL78XX_KSELACQ_RAT_CAT_M1 = 1 , HL78XX_KSELACQ_RAT_NB1 = 2 , HL78XX_KSELACQ_RAT_GSM = 3 }
 Raw AT+KSELACQ PRL RAT entries. More...
enum  hl78xx_phone_functionality { HL78XX_SIM_POWER_OFF , HL78XX_FULLY_FUNCTIONAL , HL78XX_AIRPLANE = 4 }
 Phone functionality modes. More...
enum  hl78xx_sim_slot { HL78XX_SIM_SLOT_1 = 0 , HL78XX_SIM_SLOT_2 = 1 }
 External SIM slot selection driven by the optional SIM-switch GPIO. More...
enum  hl78xx_modem_restart_mode { HL78XX_MODEM_RESTART_HARD = 0 , HL78XX_MODEM_RESTART_SOFT }
 Driver-managed modem restart modes. More...
enum  hl78xx_module_status {
  HL78XX_MODULE_READY = 0 , HL78XX_MODULE_WAITING_FOR_ACCESS_CODE , HL78XX_MODULE_SIM_NOT_PRESENT , HL78XX_MODULE_SIMLOCK ,
  HL78XX_MODULE_UNRECOVERABLE_ERROR , HL78XX_MODULE_UNKNOWN_STATE , HL78XX_MODULE_INACTIVE_SIM
}
 Module status codes. More...
enum  hl78xx_modem_info_type { HL78XX_MODEM_INFO_SERIAL_NUMBER , HL78XX_MODEM_INFO_CURRENT_BAUD_RATE , HL78XX_MODEM_INFO_FW_VERSION }
 Cellular modem info type. More...
enum  hl78xx_operator_format { HL78XX_OPERATOR_FORMAT_LONG_ALPHANUMERIC = 0 , HL78XX_OPERATOR_FORMAT_SHORT_ALPHANUMERIC , HL78XX_OPERATOR_FORMAT_NUMERIC }
 Network operator format options. More...
enum  hl78xx_network_info_type {
  HL78XX_NETWORK_INFO_APN , HL78XX_NETWORK_INFO_CURRENT_RAT , HL78XX_NETWORK_INFO_NETWORK_OPERATOR_LONG_ALPHA , HL78XX_NETWORK_INFO_NETWORK_OPERATOR_SHORT_ALPHA ,
  HL78XX_NETWORK_INFO_NETWORK_OPERATOR_NUMERIC , HL78XX_NETWORK_INFO_OPERATOR_FORMAT , HL78XX_NETWORK_INFO_TAC , HL78XX_NETWORK_INFO_MCC ,
  HL78XX_NETWORK_INFO_MNC , HL78XX_NETWORK_INFO_CELL_ID , HL78XX_NETWORK_INFO_IP_ADDRESS , HL78XX_NETWORK_INFO_DNS_PRIMARY ,
  HL78XX_NETWORK_INFO_ACTIVE_BAND , HL78XX_NETWORK_INFO_SINR
}
 Cached network information types. More...
enum  nmea_output_port {
  NMEA_OUTPUT_NONE = 0x00 , NMEA_OUTPUT_USB_NMEA_PORT = 0x01 , NMEA_OUTPUT_UART1 = 0x03 , NMEA_OUTPUT_SAME_PORT = 0x04 ,
  NMEA_OUTPUT_CMUX_DLC1 = 0x05 , NMEA_OUTPUT_CMUX_DLC2 = 0x06 , NMEA_OUTPUT_CMUX_DLC3 = 0x07 , NMEA_OUTPUT_CMUX_DLC4 = 0x08
}
 NMEA output port options. More...
enum  hl78xx_agnss_mode { HL78XX_AGNSS_MODE_INVALID = 0 , HL78XX_AGNSS_MODE_VALID = 1 }
 A-GNSS assistance data validity mode. More...
enum  hl78xx_agnss_days {
  HL78XX_AGNSS_DAYS_1 = 1 , HL78XX_AGNSS_DAYS_2 = 2 , HL78XX_AGNSS_DAYS_3 = 3 , HL78XX_AGNSS_DAYS_7 = 7 ,
  HL78XX_AGNSS_DAYS_14 = 14 , HL78XX_AGNSS_DAYS_28 = 28
}
 Number of days of predicted assistance data to download (write command) or number of days before it expires (read command). More...
enum  power_down_event { POWER_DOWN_EVENT_ENTER = 0 , POWER_DOWN_EVENT_EXIT , POWER_DOWN_EVENT_NONE }
 Power down event types. More...
enum  hl78xx_power_down_response { HL78XX_POWER_DOWN_RESPONSE_IMMEDIATE = 0 , HL78XX_POWER_DOWN_RESPONSE_RESCHEDULE }
 Application responses to a pending power-down request. More...
enum  hl78xx_edrx_event { HL78XX_EDRX_EVENT_IDLE_EXIT = 0 , HL78XX_EDRX_EVENT_IDLE_ENTER , HL78XX_EDRX_EVENT_IDLE_NONE }
 eDRX event types More...
enum  hl78xx_psmev_event { HL78XX_PSM_EVENT_EXIT = 0 , HL78XX_PSM_EVENT_ENTER , HL78XX_PSM_EVENT_NONE }
 PSM event types. More...
enum  hl78xx_evt_type {
  HL78XX_LTE_RAT_UPDATE , HL78XX_LTE_REGISTRATION_STAT_UPDATE , HL78XX_LTE_SIM_REGISTRATION , HL78XX_LTE_MODEM_STARTUP ,
  HL78XX_LTE_FOTA_UPDATE_STATUS , HL78XX_LTE_DNS_READY , HL78XX_LTE_AT_CMD_READY , HL78XX_LTE_PHONE_FUNCTIONALITY_UPDATE ,
  HL78XX_LTE_CTZEU_UPDATE , HL78XX_GNSS_ENGINE_READY , HL78XX_GNSS_EVENT_INIT , HL78XX_GNSS_EVENT_START ,
  HL78XX_GNSS_EVENT_STOP , HL78XX_GNSS_EVENT_POSITION , HL78XX_GNSS_EVENT_START_BLOCKED , HL78XX_GNSS_EVENT_SEARCH_TIMEOUT ,
  HL78XX_GNSS_EVENT_MODE_EXITED , HL78XX_EDRX_IDLE_UPDATE , HL78XX_LTE_PSMEV_UPDATE , HL78XX_POWER_DOWN_UPDATE ,
  HL78XX_VGPIO_LOW , HL78XX_VGPIO_HIGH , HL78XX_GPIO6_LOW , HL78XX_GPIO6_HIGH ,
  HL78XX_CELLMEAS_UPDATE , HL78XX_EVT_TYPE_COUNT
}
 HL78xx event types. More...
enum  wdsi_indication {
  WDSI_BOOTSTRAP_CREDENTIALS_PRESENT = 0 , WDSI_USER_AGREEMENT_REQUEST = 1 , WDSI_FIRMWARE_DOWNLOAD_REQUEST = 2 , WDSI_FIRMWARE_INSTALL_REQUEST = 3 ,
  WDSI_AUTHENTICATION_START = 4 , WDSI_AUTHENTICATION_FAILED = 5 , WDSI_AUTHENTICATION_SUCCESS = 6 , WDSI_CONNECTION_DENIED = 7 ,
  WDSI_DM_SESSION_CLOSED = 8 , WDSI_FIRMWARE_AVAILABLE = 9 , WDSI_FIRMWARE_DOWNLOADED = 10 , WDSI_FIRMWARE_DOWNLOAD_ISSUE = 11 ,
  WDSI_PACKAGE_VERIFIED_CERTIFIED = 12 , WDSI_PACKAGE_VERIFIED_NOT_CERTIFIED = 13 , WDSI_FIRMWARE_UPDATE_START = 14 , WDSI_FIRMWARE_UPDATE_FAILED = 15 ,
  WDSI_FIRMWARE_UPDATE_SUCCESS = 16 , WDSI_DOWNLOAD_IN_PROGRESS = 18 , WDSI_SESSION_STARTED = 23
}
 Device Services Indications (+WDSI). More...
enum  hl78xx_gnss_event_type { HL78XX_GNSSEV_INITIALISATION = 0 , HL78XX_GNSSEV_START = 1 , HL78XX_GNSSEV_STOP = 2 , HL78XX_GNSSEV_POSITION = 3 }
 GNSS event type. More...
enum  hl78xx_event_status { HL78XX_STATUS_FAILED = 0 , HL78XX_STATUS_SUCCESS = 1 }
 GNSS event status. More...
enum  gnss_position_events {
  GNSS_FIX_LOST_OR_UNAVAILABLE = 0 , GNSS_ESTIMATED_POSITION_AVAILABLE = 1 , GNSS_2D_POSITION_AVAILABLE = 2 , GNSS_3D_POSITION_AVAILABLE = 3 ,
  GNSS_FIX_CHANGED_TO_INVALID = 4
}
 GNSS position events (eventType = 3). More...

Functions

int hl78xx_api_func_set_phone_functionality (const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)
 Set phone functionality mode (internal implementation).
int hl78xx_api_func_restart (const struct device *dev, enum hl78xx_modem_restart_mode mode)
 Request a driver-managed modem restart.
int hl78xx_api_func_get_phone_functionality (const struct device *dev, enum hl78xx_phone_functionality *functionality)
 Get phone functionality mode (internal implementation).
int hl78xx_api_func_get_signal (const struct device *dev, const enum cellular_signal_type type, int16_t *value)
 Get network signal strength (internal implementation).
int hl78xx_api_func_get_modem_info (const struct device *dev, enum hl78xx_modem_info_type type, void *info, size_t size)
 Get vendor-specific modem information (internal implementation).
int hl78xx_api_func_get_modem_info_standard (const struct device *dev, enum cellular_modem_info_type type, char *info, size_t size)
 Get standard (Zephyr cellular API) modem information from cache.
int hl78xx_api_func_get_network_info (const struct device *dev, enum hl78xx_network_info_type type, void *info, size_t size)
 Get cached vendor-specific network information.
int hl78xx_api_func_get_rsrp_validity (const struct device *dev, bool *is_valid)
 Check whether the current RSRP meets the configured minimum threshold.
int hl78xx_api_func_get_rsrq_validity (const struct device *dev, bool *is_valid)
 Check whether the current RSRQ meets the configured minimum threshold.
int hl78xx_api_func_get_sinr_validity (const struct device *dev, bool *is_valid)
 Check whether the current SINR meets the configured minimum threshold.
int hl78xx_api_func_set_network_operator_format (const struct device *dev, enum hl78xx_operator_format format)
 Set the +COPS network operator format.
int hl78xx_api_func_set_prl (const struct device *dev, const struct kselacq_syntax kselacq_rats)
 Set a new Preferred RAT List through AT+KSELACQ.
int hl78xx_api_func_get_prl (const struct device *dev, struct kselacq_syntax *kselacq_rats)
 Get the current Preferred RAT List.
int hl78xx_set_runtime_band_provider (const struct device *dev, hl78xx_runtime_band_provider_t provider, void *user_data)
 Register or clear a runtime band provider for the driver.
int hl78xx_api_func_modem_dynamic_cmd_send (const struct device *dev, const char *cmd, uint16_t cmd_size, const struct modem_chat_match *response_matches, uint16_t matches_size)
 Send dynamic AT command (internal implementation).
int hl78xx_modem_at_send (const struct device *dev, const char *cmd)
 Send a pre-formatted AT command to the modem.
int hl78xx_modem_at_cmd (const struct device *dev, char *response, size_t response_size, const char *cmd)
 Send a pre-formatted AT command and copy the whole modem response into a caller-supplied buffer.
static int hl78xx_get_modem_info (const struct device *dev, const enum hl78xx_modem_info_type type, void *info, size_t size)
 Get modem info for the device.
static int hl78xx_get_network_info (const struct device *dev, enum hl78xx_network_info_type type, void *info, size_t size)
 Get cached network info for the device.
static int hl78xx_get_rsrp_validity (const struct device *dev, bool *is_valid)
 Check whether the current RSRP meets the configured threshold.
static int hl78xx_get_rsrq_validity (const struct device *dev, bool *is_valid)
 Check whether the current RSRQ meets the configured threshold.
static int hl78xx_get_sinr_validity (const struct device *dev, bool *is_valid)
 Check whether the current SINR meets the configured threshold.
static int hl78xx_set_prl (const struct device *dev, struct kselacq_syntax prl)
 Set a new raw AT+KSELACQ Preferred RAT List.
static int hl78xx_set_phone_functionality (const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)
 Set the modem phone functionality mode.
static int hl78xx_restart_modem (const struct device *dev, enum hl78xx_modem_restart_mode mode)
 Request a driver-managed modem restart.
static int hl78xx_get_phone_functionality (const struct device *dev, enum hl78xx_phone_functionality *functionality)
 Get the current phone functionality mode of the modem.
static int hl78xx_modem_cmd_send (const struct device *dev, const char *cmd, uint16_t cmd_size, const struct modem_chat_match *response_matches, uint16_t matches_size)
 Send an AT command to the modem and wait for a matched response.
static int hl78xx_modem_at_err_type (int error)
 Return the modem error type encoded in hl78xx_modem_at_send/cmd return values.
static int hl78xx_modem_at_err (int error)
 Return the modem CME/CMS error code encoded in hl78xx_modem_at_send/cmd.
static int hl78xx_parse_rssi (uint8_t rssi, int16_t *value)
 Convert raw RSSI value from the modem to dBm.
static int hl78xx_parse_rsrp (uint8_t rsrp, int16_t *value)
 Convert raw RSRP value from the modem to dBm.
static int hl78xx_parse_rsrq (uint8_t rsrq, int16_t *value)
 Convert raw RSRQ value from the modem to dB.
static void hl78xx_evt_monitor_pause (struct hl78xx_evt_monitor_entry *mon)
 Pause monitor.
static void hl78xx_evt_monitor_resume (struct hl78xx_evt_monitor_entry *mon)
 Resume monitor.
static void hl78xx_at_monitor_pause (struct hl78xx_at_monitor_entry *mon)
 Pause AT monitor.
static void hl78xx_at_monitor_resume (struct hl78xx_at_monitor_entry *mon)
 Resume AT monitor.
int hl78xx_at_monitor_register (struct hl78xx_at_monitor_entry *mon)
 Register an AT monitor.
int hl78xx_at_monitor_unregister (struct hl78xx_at_monitor_entry *mon)
 Unregister an AT monitor.
int hl78xx_evt_notif_handler_set (hl78xx_evt_monitor_dispatcher_t handler)
 Set the event notification handler for HL78xx modem events.
int hl78xx_evt_monitor_register (struct hl78xx_evt_monitor_entry *mon)
 Register an event monitor.
int hl78xx_evt_monitor_unregister (struct hl78xx_evt_monitor_entry *mon)
 Unregister an event monitor.
enum cellular_access_technology hl78xx_rat_to_access_tech (enum hl78xx_cell_rat_mode rat_mode)
 Convert HL78xx RAT mode to standard cellular API.
enum hl78xx_cell_rat_mode hl78xx_access_tech_to_rat (enum cellular_access_technology access_tech)
 Convert standard cellular access technology to HL78xx RAT mode.
int hl78xx_start_airvantage_dm_session (const struct device *dev)
 Start an AirVantage Device Management (DM) session.
int hl78xx_stop_airvantage_dm_session (const struct device *dev)
 Stop an AirVantage Device Management (DM) session.
int hl78xx_set_wake_pin_low (const struct device *dev)
 Drive the modem WAKE pin low.
int hl78xx_set_wake_pin_high (const struct device *dev)
 Drive the modem WAKE pin high.
int hl78xx_set_active_sim (const struct device *dev, enum hl78xx_sim_slot sim_slot)
 Select the active external SIM slot.
int hl78xx_wakeup_modem (const struct device *dev)
 Wake the modem from PSM sleep.
int hl78xx_edrx_get_time_to_sleep (const struct device *dev)
 Get the remaining time for the modem to go in eDRX idle state.
int hl78xx_enter_gnss_mode (const struct device *dev)
 Enter GNSS mode.
int hl78xx_exit_gnss_mode (const struct device *dev)
 Exit GNSS mode and return to LTE mode.
int hl78xx_queue_gnss_search (const struct device *dev)
 Queue a GNSS position search.
int hl78xx_gnss_set_nmea_output (const struct device *dev, enum nmea_output_port port)
 Set NMEA output port for GNSS.
int hl78xx_gnss_set_search_timeout (const struct device *dev, uint32_t timeout_ms)
 Set GNSS search timeout.
int hl78xx_gnss_get_latest_known_fix (const struct device *dev)
 Get the latest known GNSS fix from the modem.
int hl78xx_gnss_assist_data_get_status (const struct device *dev, struct hl78xx_agnss_status *status)
 Get A-GNSS assistance data status.
int hl78xx_gnss_assist_data_download (const struct device *dev, enum hl78xx_agnss_days days)
 Download A-GNSS assistance data.
int hl78xx_gnss_assist_data_delete (const struct device *dev)
 Delete A-GNSS assistance data.
int hl78xx_power_down_trigger (const struct device *dev, k_timeout_t delay)
 Trigger the HL78xx shutdown process after a caller-supplied delay.
int hl78xx_power_down_cancel (const struct device *dev)
 Cancel a pending stage-1 HL78xx shutdown timer.
int hl78xx_power_down_respond (const struct device *dev, enum hl78xx_power_down_response response, uint32_t timeout_s)
 Respond to a pending HL78XX power-down update.
void hl78xx_power_down_confirm (const struct device *dev)
 Confirm that application cleanup is complete and the modem may proceed with physical shutdown.

Detailed Description

Sierra Wireless HL78xx cellular modems.

Macro Definition Documentation

◆ ACTIVE

#define ACTIVE   0

#include <hl78xx_apis.h>

Monitor is active, default.

◆ CESQ_RSRP_MAX

#define CESQ_RSRP_MAX   (97)

#include <hl78xx_apis.h>

Maximum valid RSRP code returned by AT+CESQ command.

◆ CESQ_RSRP_TO_DB

#define CESQ_RSRP_TO_DB ( v)

#include <hl78xx_apis.h>

Value:
(-141 + (v))

Convert CESQ RSRP value to dBm.

Parameters
vRSRP value (0-97)
Returns
Conservative lower-bound representative in dBm (-141 to -44)

◆ CESQ_RSRP_UNKNOWN

#define CESQ_RSRP_UNKNOWN   (255)

#include <hl78xx_apis.h>

Unknown RSRP value returned by AT+CESQ command.

◆ CESQ_RSRQ_MAX

#define CESQ_RSRQ_MAX   (34)

#include <hl78xx_apis.h>

Maximum valid RSRQ code returned by AT+CESQ command.

◆ CESQ_RSRQ_TO_DB

#define CESQ_RSRQ_TO_DB ( v)

#include <hl78xx_apis.h>

Value:
(((v) == 0U) ? -21 : (-20 + ((v) / 2)))

Convert CESQ RSRQ value to dB.

Parameters
vRSRQ value (0-34)
Returns
Conservative integer representative in dB (-21 to -3)

◆ CESQ_RSRQ_UNKNOWN

#define CESQ_RSRQ_UNKNOWN   (255)

#include <hl78xx_apis.h>

Unknown RSRQ value returned by AT+CESQ command.

◆ CSQ_RSSI_MAX

#define CSQ_RSSI_MAX   (31)

#include <hl78xx_apis.h>

Maximum valid RSSI code returned by AT+CSQ command.

◆ CSQ_RSSI_TO_DB

#define CSQ_RSSI_TO_DB ( v)

#include <hl78xx_apis.h>

Value:
(-113 + (2 * (v)))

Convert CSQ RSSI value to dBm.

Parameters
vRSSI value (0-31)
Returns
Signal strength in dBm (-113 to -51)

◆ CSQ_RSSI_UNKNOWN

#define CSQ_RSSI_UNKNOWN   (99)

#include <hl78xx_apis.h>

Unknown RSSI value returned by AT+CSQ command.

◆ GNSS_AUX_DATA_CALLBACK_DEFINE

#define GNSS_AUX_DATA_CALLBACK_DEFINE ( _dev,
_callback )

#include <hl78xx_apis.h>

Value:
_hl78xx_gnss_aux_data_callback__##_callback) = { \
.dev = _dev, \
.callback = _callback, \
}
#define STRUCT_SECTION_ITERABLE(struct_type, varname)
Defines a new element for an iterable section.
Definition iterable_sections.h:244
GNSS auxiliary data callback structure.
Definition hl78xx_apis.h:1019

Register a callback structure for GNSS auxiliary data published.

Parameters
_devDevice pointer
_callbackThe callback function

◆ GNSS_DT_AUX_DATA_CALLBACK_DEFINE

#define GNSS_DT_AUX_DATA_CALLBACK_DEFINE ( _node_id,
_callback )

#include <hl78xx_apis.h>

Value:
_CONCAT_4(_hl78xx_gnss_aux_data_callback_, \
DT_DEP_ORD(_node_id), _, _callback)) = { \
.dev = DEVICE_DT_GET(_node_id), \
.callback = _callback, \
}
#define DEVICE_DT_GET(node_id)
Get a device reference from a devicetree node identifier.
Definition device.h:317
#define DT_DEP_ORD(node_id)
Get a node's dependency ordinal.
Definition ordinals.h:25

Register a callback structure for GNSS auxiliary data published.

Parameters
_node_idDevice tree node identifier
_callbackThe callback function

◆ HL78XX_AT_MONITOR

#define HL78XX_AT_MONITOR ( name,
_filter,
_handler,
... )

#include <hl78xx_apis.h>

Value:
.filter = _filter, \
.handler = _handler, \
.next = NULL, \
.flags = { \
.direct = false, \
.paused = HL78XX_MONITOR_INITIAL_PAUSED(__VA_ARGS__), \
}}
#define HL78XX_MONITOR_INITIAL_PAUSED(...)
Resolve the optional monitor initial state argument.
Definition hl78xx_apis.h:152
#define NULL
Definition iar_missing_defs.h:20
AT monitor entry structure.
Definition hl78xx_apis.h:1166

Define an AT monitor to receive parsed unsolicited AT notifications in the system workqueue thread.

Parameters
nameThe monitor name.
_filterExact unsolicited AT match pattern to receive, or HL78XX_AT_MONITOR_ANY to receive all parsed notifications.
_handlerThe monitor callback.
...Optional monitor initial state (HL78XX_MONITOR_ACTIVE or HL78XX_MONITOR_PAUSED). The default initial state of a monitor is active.

◆ HL78XX_AT_MONITOR_ANY

#define HL78XX_AT_MONITOR_ANY   NULL

#include <hl78xx_apis.h>

Monitor any parsed unsolicited AT notification.

◆ HL78XX_AT_MONITOR_DIRECT

#define HL78XX_AT_MONITOR_DIRECT ( name,
_filter,
_handler,
... )

#include <hl78xx_apis.h>

Value:
.filter = _filter, \
.handler = _handler, \
.next = NULL, \
.flags = { \
.direct = true, \
.paused = HL78XX_MONITOR_INITIAL_PAUSED(__VA_ARGS__), \
}}

Define an AT monitor to receive parsed unsolicited AT notifications directly in the HL78xx modem RX workqueue context.

Direct monitor callbacks run in the HL78xx modem RX workqueue context. Handlers should keep processing short and must avoid operations that could block modem receive processing for a long time.

Parameters
nameThe monitor name.
_filterExact unsolicited AT match pattern to receive, or HL78XX_AT_MONITOR_ANY to receive all parsed notifications.
_handlerThe monitor callback.
...Optional monitor initial state (HL78XX_MONITOR_ACTIVE or HL78XX_MONITOR_PAUSED). The default initial state of a monitor is active.

◆ HL78XX_CEREG_TIMER_STR_LEN

#define HL78XX_CEREG_TIMER_STR_LEN   9

#include <hl78xx_apis.h>

Maximum length of CEREG timer string.

◆ HL78XX_CTZEU_UTIME_MAX_LEN

#define HL78XX_CTZEU_UTIME_MAX_LEN   32

#include <hl78xx_apis.h>

Recommended buffer size for extracted +CTZEU universal time strings.

◆ HL78XX_EVT_MONITOR

#define HL78XX_EVT_MONITOR ( name,
_handler,
... )

#include <hl78xx_apis.h>

Value:
.handler = _handler, \
.next = NULL, \
.flags = { \
.direct = false, \
.paused = HL78XX_MONITOR_INITIAL_PAUSED(__VA_ARGS__), \
}}
Event monitor entry structure.
Definition hl78xx_apis.h:1227

Define an Event monitor to receive notifications in the system workqueue thread.

Parameters
nameThe monitor name.
_handlerThe monitor callback.
...Optional monitor initial state (HL78XX_MONITOR_ACTIVE or HL78XX_MONITOR_PAUSED). The default initial state of a monitor is active.

◆ HL78XX_MODEM_AT_CME_ERROR

#define HL78XX_MODEM_AT_CME_ERROR   2

#include <hl78xx_apis.h>

Modem response type for +CME ERROR responses returned by public AT helpers.

◆ HL78XX_MODEM_AT_CMS_ERROR

#define HL78XX_MODEM_AT_CMS_ERROR   3

#include <hl78xx_apis.h>

Modem response type for +CMS ERROR responses returned by public AT helpers.

◆ HL78XX_MODEM_AT_ERROR

#define HL78XX_MODEM_AT_ERROR   1

#include <hl78xx_apis.h>

Modem response type for generic ERROR responses returned by public AT helpers.

◆ HL78XX_MONITOR_ACTIVE

#define HL78XX_MONITOR_ACTIVE   false

#include <hl78xx_apis.h>

Initial active state for HL78xx monitors.

Use this as the optional state argument when defining a monitor that should start in the active state.

◆ HL78XX_MONITOR_INITIAL_PAUSED

#define HL78XX_MONITOR_INITIAL_PAUSED ( ...)

#include <hl78xx_apis.h>

Value:
COND_CODE_1(IS_EMPTY(__VA_ARGS__), (false), (__VA_ARGS__))
#define COND_CODE_1(_flag, _if_1_code, _else_code)
Insert code depending on whether _flag expands to 1 or not.
Definition util_macro.h:209
#define IS_EMPTY(...)
Check if a macro has a replacement expression.
Definition util_macro.h:332

Resolve the optional monitor initial state argument.

If no optional state argument is provided, the monitor starts active. Otherwise, the provided state value is used.

Parameters
...Optional monitor initial state, either HL78XX_MONITOR_ACTIVE or HL78XX_MONITOR_PAUSED.

◆ HL78XX_MONITOR_PAUSED

#define HL78XX_MONITOR_PAUSED   true

#include <hl78xx_apis.h>

Initial paused state for HL78xx monitors.

Use this as the optional state argument when defining a monitor that should start paused.

◆ HL78XX_NETWORK_ADDRESS_MAX_LEN

#define HL78XX_NETWORK_ADDRESS_MAX_LEN   46

#include <hl78xx_apis.h>

Maximum length of network address string.

◆ MDM_APN_MAX_LENGTH

#define MDM_APN_MAX_LENGTH   64

#include <hl78xx_apis.h>

Maximum length of APN string.

◆ MDM_HL78XX_CME_ERROR_STRING

#define MDM_HL78XX_CME_ERROR_STRING   "+CME ERROR: "

#include <hl78xx_apis.h>

Prefix for CME (Mobile Equipment) error responses, typically followed by an error code.

◆ MDM_HL78XX_CMS_ERROR_STRING

#define MDM_HL78XX_CMS_ERROR_STRING   "+CMS ERROR: "

#include <hl78xx_apis.h>

Prefix for CMS (Message Service) error responses, typically related to SMS operations.

◆ MDM_HL78XX_CONNECT_STRING

#define MDM_HL78XX_CONNECT_STRING   "CONNECT"

#include <hl78xx_apis.h>

Response string indicating a successful data connection has been established.

◆ MDM_HL78XX_DESIRED_VERSION_STRING

#define MDM_HL78XX_DESIRED_VERSION_STRING

#include <hl78xx_apis.h>

Value:
(sizeof(CONFIG_MODEM_HL78XX_DESIRED_FW_VERSION) > 1 \
? CONFIG_MODEM_HL78XX_DESIRED_FW_VERSION \
: "HL7812.5.7.4.0")

Desired firmware version string.

◆ MDM_HL78XX_EOF_PATTERN

#define MDM_HL78XX_EOF_PATTERN   "--EOF--Pattern--"

#include <hl78xx_apis.h>

Pattern used to indicate end-of-file or completion of data transmission.

◆ MDM_HL78XX_ERROR_STRING

#define MDM_HL78XX_ERROR_STRING   "ERROR"

#include <hl78xx_apis.h>

Generic error response string indicating command failure.

◆ MDM_HL78XX_NO_CARRIER_STRING

#define MDM_HL78XX_NO_CARRIER_STRING   "NO CARRIER"

#include <hl78xx_apis.h>

Response string indicating the connection has been lost or terminated.

◆ MDM_HL78XX_OK_STRING

#define MDM_HL78XX_OK_STRING   "OK"

#include <hl78xx_apis.h>

Standard response string indicating successful execution of an AT command.

◆ MDM_HL78XX_TERMINATION_PATTERN

#define MDM_HL78XX_TERMINATION_PATTERN   "+++"

#include <hl78xx_apis.h>

Escape/termination sequence used to exit data mode and return to command mode.

◆ MDM_ICCID_LENGTH

#define MDM_ICCID_LENGTH   22

#include <hl78xx_apis.h>

Maximum length of modem ICCID string.

◆ MDM_IMEI_LENGTH

#define MDM_IMEI_LENGTH   16

#include <hl78xx_apis.h>

Maximum length of modem IMEI string.

◆ MDM_IMSI_LENGTH

#define MDM_IMSI_LENGTH   23

#include <hl78xx_apis.h>

Maximum length of modem IMSI string.

◆ MDM_MANUFACTURER_LENGTH

#define MDM_MANUFACTURER_LENGTH   20

#include <hl78xx_apis.h>

Maximum length of modem manufacturer string.

◆ MDM_MAX_CERT_LENGTH

#define MDM_MAX_CERT_LENGTH   4096

#include <hl78xx_apis.h>

Maximum length of certificate.

◆ MDM_MAX_HOSTNAME_LEN

#define MDM_MAX_HOSTNAME_LEN   128

#include <hl78xx_apis.h>

Maximum length of hostname.

◆ MDM_MODEL_LENGTH

#define MDM_MODEL_LENGTH   32

#include <hl78xx_apis.h>

Maximum length of modem model string.

◆ MDM_REVISION_LENGTH

#define MDM_REVISION_LENGTH   64

#include <hl78xx_apis.h>

Maximum length of modem revision string.

◆ MDM_SERIAL_NUMBER_LENGTH

#define MDM_SERIAL_NUMBER_LENGTH   32

#include <hl78xx_apis.h>

Maximum length of serial number string.

◆ PAUSED

#define PAUSED   1

#include <hl78xx_apis.h>

Monitor is paused.

Typedef Documentation

◆ hl78xx_api_configure_networks

typedef int(* hl78xx_api_configure_networks) (const struct device *dev, const struct hl78xx_network *networks, uint8_t size)

#include <hl78xx_apis.h>

API function pointer for configuring networks.

Parameters
devCellular network device instance
networksArray of network configurations
sizeNumber of networks in array
Returns
0 on success, negative errno on failure

◆ hl78xx_api_get_modem_info

typedef int(* hl78xx_api_get_modem_info) (const struct device *dev, const enum cellular_modem_info_type type, char *info, size_t size)

#include <hl78xx_apis.h>

API function pointer for getting modem information.

Parameters
devCellular network device instance
typeType of modem information
infoBuffer to store information string
sizeSize of info buffer
Returns
0 on success, negative errno on failure

◆ hl78xx_api_get_phone_functionality

typedef int(* hl78xx_api_get_phone_functionality) (const struct device *dev, enum hl78xx_phone_functionality *functionality)

#include <hl78xx_apis.h>

API for get phone functionality.

◆ hl78xx_api_get_registration_status

typedef int(* hl78xx_api_get_registration_status) (const struct device *dev, enum cellular_access_technology tech, enum cellular_registration_status *status)

#include <hl78xx_apis.h>

API for getting registration status.

◆ hl78xx_api_get_signal

typedef int(* hl78xx_api_get_signal) (const struct device *dev, const enum cellular_signal_type type, int16_t *value)

#include <hl78xx_apis.h>

API for getting network signal strength.

◆ hl78xx_api_get_supported_networks

typedef int(* hl78xx_api_get_supported_networks) (const struct device *dev, const struct hl78xx_network **networks, uint8_t *size)

#include <hl78xx_apis.h>

API function pointer for getting supported networks.

Parameters
devCellular network device instance
networksPointer to receive network array
sizePointer to receive array size
Returns
0 on success, negative errno on failure

◆ hl78xx_api_send_at_cmd

typedef int(* hl78xx_api_send_at_cmd) (const struct device *dev, const char *cmd, uint16_t cmd_size, const struct modem_chat_match *response_matches, uint16_t matches_size)

#include <hl78xx_apis.h>

API for get phone functionality.

◆ hl78xx_api_set_phone_functionality

typedef int(* hl78xx_api_set_phone_functionality) (const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)

#include <hl78xx_apis.h>

API function pointer for setting phone functionality.

Parameters
devCellular network device instance
functionalityPhone functionality mode
resetWhether to reset modem
Returns
0 on success, negative errno on failure

◆ hl78xx_at_monitor_handler_t

typedef void(* hl78xx_at_monitor_handler_t) (const struct hl78xx_at_notification *notif, struct hl78xx_at_monitor_entry *mon)

#include <hl78xx_apis.h>

AT monitor handler function type.

User callback for receiving parsed unsolicited AT notifications.

Parameters
notifPointer to the parsed AT notification.
monPointer to the monitor entry that received the notification.

◆ hl78xx_at_monitor_release_t

typedef void(* hl78xx_at_monitor_release_t) (struct hl78xx_at_monitor_entry *mon)

#include <hl78xx_apis.h>

AT monitor release function type.

Called when an AT monitor entry is released and no longer referenced.

Parameters
monPointer to the monitor entry being released.

◆ hl78xx_evt_monitor_dispatcher_t

typedef void(* hl78xx_evt_monitor_dispatcher_t) (struct hl78xx_evt *notif)

#include <hl78xx_apis.h>

Event monitor dispatcher function type.

Called to dispatch events to registered monitors

Parameters
notifPointer to the event notification

◆ hl78xx_evt_monitor_handler_t

typedef void(* hl78xx_evt_monitor_handler_t) (struct hl78xx_evt *notif, struct hl78xx_evt_monitor_entry *mon)

#include <hl78xx_apis.h>

Event monitor handler function type.

User callback for receiving event notifications

Parameters
notifPointer to the event notification
monPointer to the monitor entry that received the event

◆ hl78xx_evt_monitor_release_t

typedef void(* hl78xx_evt_monitor_release_t) (struct hl78xx_evt_monitor_entry *mon)

#include <hl78xx_apis.h>

Event monitor release function type.

Called when an event monitor entry is released and no longer referenced.

Parameters
monPointer to the monitor entry being released

◆ hl78xx_gnss_aux_data_callback_t

typedef void(* hl78xx_gnss_aux_data_callback_t) (const struct device *dev, const struct hl78xx_gnss_nmea_aux_data *aux_data, uint16_t size)

#include <hl78xx_apis.h>

GNSS auxiliary data callback function type.

Parameters
devPointer to the GNSS device
aux_dataPointer to auxiliary NMEA data structure
sizeSize of the auxiliary data

◆ hl78xx_runtime_band_provider_t

typedef bool(* hl78xx_runtime_band_provider_t) (const struct device *dev, enum hl78xx_cell_rat_mode rat, uint16_t *band, void *user_data)

#include <hl78xx_apis.h>

Callback used to supply an optional runtime band override for a RAT.

The modem driver stays agnostic to how callers store or derive runtime band choices. When a provider is registered, hl78xx_band_cfg() asks for an override band for the requested RAT and falls back to Kconfig defaults when none is supplied.

Parameters
devCellular network device instance.
ratRAT currently being configured.
bandOutput band number, written only when the callback returns true.
user_dataOpaque caller-owned context passed at registration time.
Returns
true when a valid runtime band override exists for rat.

Enumeration Type Documentation

◆ gnss_position_events

#include <hl78xx_apis.h>

GNSS position events (eventType = 3).

Position fix status reported by the modem

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
Enumerator
GNSS_FIX_LOST_OR_UNAVAILABLE 

0 — The GNSS fix is lost or not available yet

GNSS_ESTIMATED_POSITION_AVAILABLE 

1 — An estimated GNSS (predicted) position is available

GNSS_2D_POSITION_AVAILABLE 

2 — A 2-dimensional GNSS position is available

GNSS_3D_POSITION_AVAILABLE 

3 — A 3-dimensional position is available

GNSS_FIX_CHANGED_TO_INVALID 

4 — GNSS fix has been changed to invalid position

◆ hl78xx_agnss_days

#include <hl78xx_apis.h>

Number of days of predicted assistance data to download (write command) or number of days before it expires (read command).

Only these values are accepted by the AT+GNSSAD=1,<days> command

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE 
.
Enumerator
HL78XX_AGNSS_DAYS_1 

Request 1 day of A-GNSS assistance data.

HL78XX_AGNSS_DAYS_2 

Request 2 days of A-GNSS assistance data.

HL78XX_AGNSS_DAYS_3 

Request 3 days of A-GNSS assistance data.

HL78XX_AGNSS_DAYS_7 

Request 7 days of A-GNSS assistance data.

HL78XX_AGNSS_DAYS_14 

Request 14 days of A-GNSS assistance data.

HL78XX_AGNSS_DAYS_28 

Request 28 days of A-GNSS assistance data.

◆ hl78xx_agnss_mode

#include <hl78xx_apis.h>

A-GNSS assistance data validity mode.

Mode value returned by AT+GNSSAD? read command or used by write command

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE 
.
Enumerator
HL78XX_AGNSS_MODE_INVALID 

Data is not valid (read) / Delete data (write).

HL78XX_AGNSS_MODE_VALID 

Data is valid (read) / Download data (write).

◆ hl78xx_cell_rat_mode

#include <hl78xx_apis.h>

Cellular radio access technologies.

Supported radio access technology modes for HL78xx modem

Enumerator
HL78XX_RAT_CAT_M1 

LTE Cat-M1 radio access technology.

HL78XX_RAT_NB1 

NB-IoT radio access technology.

HL78XX_RAT_GSM 

GSM radio access technology (HL7812 only).

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_12 
.
HL78XX_RAT_NBNTN 

NB-IoT Non-Terrestrial Network (HL7812 FW R6+).

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_12_FW_R6 
.
HL78XX_RAT_MODE_AUTO 

Automatic RAT selection mode.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_AUTORAT 
.
HL78XX_RAT_MODE_NONE 

No RAT mode.

HL78XX_RAT_COUNT 

Number of valid RAT modes.

◆ hl78xx_edrx_event

#include <hl78xx_apis.h>

eDRX event types

Types of eDRX events reported by the modem

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_EDRX 
.
Enumerator
HL78XX_EDRX_EVENT_IDLE_EXIT 

Modem exited eDRX idle mode.

HL78XX_EDRX_EVENT_IDLE_ENTER 

Modem entered eDRX idle mode.

HL78XX_EDRX_EVENT_IDLE_NONE 

No eDRX event.

◆ hl78xx_event_status

#include <hl78xx_apis.h>

GNSS event status.

Status codes for GNSS operations

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
Enumerator
HL78XX_STATUS_FAILED 

Operation failed.

HL78XX_STATUS_SUCCESS 

Operation succeeded.

◆ hl78xx_evt_type

#include <hl78xx_apis.h>

HL78xx event types.

Asynchronous event notifications from the HL78xx modem

Enumerator
HL78XX_LTE_RAT_UPDATE 

LTE Radio Access Technology changed.

HL78XX_LTE_REGISTRATION_STAT_UPDATE 

LTE network registration status changed.

HL78XX_LTE_SIM_REGISTRATION 

SIM registration status changed.

HL78XX_LTE_MODEM_STARTUP 

Modem startup completed.

HL78XX_LTE_FOTA_UPDATE_STATUS 

FOTA update status changed.

HL78XX_LTE_DNS_READY 

DNS resolution path completed and modem is ready for data transmission.

HL78XX_LTE_AT_CMD_READY 

The AT command interface is ready for application use.

HL78XX_LTE_PHONE_FUNCTIONALITY_UPDATE 

Phone functionality changed (+CFUN).

HL78XX_LTE_CTZEU_UPDATE 

Extended timezone and universal time update (+CTZEU).

HL78XX_GNSS_ENGINE_READY 

GNSS engine initialized and ready.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
HL78XX_GNSS_EVENT_INIT 

GNSS engine initialization event.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
HL78XX_GNSS_EVENT_START 

GNSS search started.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
HL78XX_GNSS_EVENT_STOP 

GNSS search stopped.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
HL78XX_GNSS_EVENT_POSITION 

GNSS position fix obtained.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
HL78XX_GNSS_EVENT_START_BLOCKED 

GNSS start failed because LTE is active (shared RF path).

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
HL78XX_GNSS_EVENT_SEARCH_TIMEOUT 

GNSS search timeout expired.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
HL78XX_GNSS_EVENT_MODE_EXITED 

GNSS mode exited - modem is now in airplane mode, user can decide next step.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
HL78XX_EDRX_IDLE_UPDATE 

eDRX idle mode entered

Attention
Available only when the following Kconfig options are enabled:
CONFIG_MODEM_HL78XX_LOW_POWER_MODE 
,
CONFIG_MODEM_HL78XX_EDRX 
.
HL78XX_LTE_PSMEV_UPDATE 

Modem PSM event update.

Attention
Available only when the following Kconfig options are enabled:
CONFIG_MODEM_HL78XX_LOW_POWER_MODE 
,
CONFIG_MODEM_HL78XX_PSM 
.
HL78XX_POWER_DOWN_UPDATE 

Modem power-down event update.

Attention
Available only when the following Kconfig options are enabled:
CONFIG_MODEM_HL78XX_LOW_POWER_MODE 
,
CONFIG_MODEM_HL78XX_POWER_DOWN 
.
HL78XX_VGPIO_LOW 

VGPIO pin went LOW.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_LOW_POWER_MODE 
.
HL78XX_VGPIO_HIGH 

VGPIO pin went HIGH.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_LOW_POWER_MODE 
.
HL78XX_GPIO6_LOW 

GPIO6 pin went LOW indicating sleep or power-down entry.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_LOW_POWER_MODE 
.
HL78XX_GPIO6_HIGH 

GPIO6 pin went HIGH indicating wake from sleep or power-down.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_LOW_POWER_MODE 
.
HL78XX_CELLMEAS_UPDATE 

Cellular measurement update.

HL78XX_EVT_TYPE_COUNT 

Event type count.

◆ hl78xx_gnss_event_type

#include <hl78xx_apis.h>

GNSS event type.

Types of GNSS events reported by the modem

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
Enumerator
HL78XX_GNSSEV_INITIALISATION 

GNSS engine initialization event.

HL78XX_GNSSEV_START 

GNSS search start event.

HL78XX_GNSSEV_STOP 

GNSS search stop event.

HL78XX_GNSSEV_POSITION 

GNSS position fix event.

◆ hl78xx_kselacq_rat

#include <hl78xx_apis.h>

Raw AT+KSELACQ PRL RAT entries.

These values follow the modem command syntax directly and are not the same numeric encoding as enum hl78xx_cell_rat_mode.

Enumerator
HL78XX_KSELACQ_RAT_CLEAR 

Clear PRL and disable automatic RAT switching.

HL78XX_KSELACQ_RAT_CAT_M1 

PRL entry for Cat-M1.

HL78XX_KSELACQ_RAT_NB1 

PRL entry for NB-IoT.

HL78XX_KSELACQ_RAT_GSM 

PRL entry for GSM.

Supported only on HL7812.

◆ hl78xx_modem_info_type

#include <hl78xx_apis.h>

Cellular modem info type.

Types of modem information that can be queried

Enumerator
HL78XX_MODEM_INFO_SERIAL_NUMBER 

Modem Serial Number.

HL78XX_MODEM_INFO_CURRENT_BAUD_RATE 

Current Baud Rate.

HL78XX_MODEM_INFO_FW_VERSION 

Firmware version.

◆ hl78xx_modem_restart_mode

#include <hl78xx_apis.h>

Driver-managed modem restart modes.

Enumerator
HL78XX_MODEM_RESTART_HARD 

Restart the modem with the dedicated reset pin.

HL78XX_MODEM_RESTART_SOFT 

Restart the modem by issuing AT+CFUN=4,1.

◆ hl78xx_module_status

#include <hl78xx_apis.h>

Module status codes.

Status codes returned by AT+CPIN? indicating SIM and module state

Enumerator
HL78XX_MODULE_READY 

Module is ready to receive commands for the TE.

No access code is required.

HL78XX_MODULE_WAITING_FOR_ACCESS_CODE 

Module is waiting for an access code.

Use AT+CPIN? to determine it.

HL78XX_MODULE_SIM_NOT_PRESENT 

SIM card is not present.

HL78XX_MODULE_SIMLOCK 

Module is in "SIMlock" state.

HL78XX_MODULE_UNRECOVERABLE_ERROR 

Unrecoverable error.

HL78XX_MODULE_UNKNOWN_STATE 

Unknown state.

HL78XX_MODULE_INACTIVE_SIM 

Inactive SIM.

◆ hl78xx_network_info_type

#include <hl78xx_apis.h>

Cached network information types.

Enumerator
HL78XX_NETWORK_INFO_APN 

Access Point Name.

HL78XX_NETWORK_INFO_CURRENT_RAT 

Current Radio Access Technology.

HL78XX_NETWORK_INFO_NETWORK_OPERATOR_LONG_ALPHA 

Network Operator name in long alphanumeric format.

HL78XX_NETWORK_INFO_NETWORK_OPERATOR_SHORT_ALPHA 

Network Operator name in short alphanumeric format.

HL78XX_NETWORK_INFO_NETWORK_OPERATOR_NUMERIC 

Network Operator name in numeric format.

HL78XX_NETWORK_INFO_OPERATOR_FORMAT 

Current operator format from +COPS.

HL78XX_NETWORK_INFO_TAC 

Tracking area code from +CEREG.

HL78XX_NETWORK_INFO_MCC 

Mobile country code parsed from numeric operator.

HL78XX_NETWORK_INFO_MNC 

Mobile network code parsed from numeric operator.

HL78XX_NETWORK_INFO_CELL_ID 

Cell ID from +CEREG.

HL78XX_NETWORK_INFO_IP_ADDRESS 

PDP IP address.

HL78XX_NETWORK_INFO_DNS_PRIMARY 

Primary DNS address.

HL78XX_NETWORK_INFO_ACTIVE_BAND 

Active band number from AT+KBND?

decoded from the bitmap.

HL78XX_NETWORK_INFO_SINR 

Signal-to-Interference-plus-Noise Ratio from the last +KCELLMEAS URC.

◆ hl78xx_operator_format

#include <hl78xx_apis.h>

Network operator format options.

Enumerator
HL78XX_OPERATOR_FORMAT_LONG_ALPHANUMERIC 

Long alphanumeric operator name format (AT+COPS format 0).

HL78XX_OPERATOR_FORMAT_SHORT_ALPHANUMERIC 

Short alphanumeric operator name format (AT+COPS format 1).

HL78XX_OPERATOR_FORMAT_NUMERIC 

Numeric operator name format / MCC-MNC (AT+COPS format 2).

◆ hl78xx_phone_functionality

#include <hl78xx_apis.h>

Phone functionality modes.

AT+CFUN command modes for controlling modem operational state

Enumerator
HL78XX_SIM_POWER_OFF 

SIM and modem powered off (minimum functionality).

HL78XX_FULLY_FUNCTIONAL 

Full functionality, modem operational.

HL78XX_AIRPLANE 

Airplane mode, RF transmitters disabled.

◆ hl78xx_power_down_response

#include <hl78xx_apis.h>

Application responses to a pending power-down request.

These values control how the driver handles the stage-2 shutdown work after HL78XX_POWER_DOWN_UPDATE is dispatched with POWER_DOWN_EVENT_ENTER.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_POWER_DOWN 
.
Enumerator
HL78XX_POWER_DOWN_RESPONSE_IMMEDIATE 

Proceed with shutdown as soon as the driver workqueue can run it.

HL78XX_POWER_DOWN_RESPONSE_RESCHEDULE 

Extend the shutdown grace period from now by a caller-supplied timeout.

◆ hl78xx_psmev_event

#include <hl78xx_apis.h>

PSM event types.

Types of Power Saving Mode events reported by the modem

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_PSM 
.
Enumerator
HL78XX_PSM_EVENT_EXIT 

Modem exited PSM mode.

HL78XX_PSM_EVENT_ENTER 

Modem entered PSM mode.

HL78XX_PSM_EVENT_NONE 

No PSM event.

◆ hl78xx_sim_slot

#include <hl78xx_apis.h>

External SIM slot selection driven by the optional SIM-switch GPIO.

Slot 1 maps to a logical low on the SIM-switch GPIO, and slot 2 maps to a logical high. Devicetree polarity flags still apply to the physical pin.

Enumerator
HL78XX_SIM_SLOT_1 

Select SIM slot 1 (logical low).

HL78XX_SIM_SLOT_2 

Select SIM slot 2 (logical high).

◆ nmea_output_port

#include <hl78xx_apis.h>

NMEA output port options.

Port selection for GNSS NMEA sentence output from the modem

Enumerator
NMEA_OUTPUT_NONE 

0x00 — NMEA frames are not output

NMEA_OUTPUT_USB_NMEA_PORT 

0x01 — NMEA frames are output on dedicated NMEA port over USB

NMEA_OUTPUT_UART1 

0x03 — NMEA frames are output on UART1

NMEA_OUTPUT_SAME_PORT 

0x04 — NMEA frames are output on the same port the +GNSSNMEA was received on

NMEA_OUTPUT_CMUX_DLC1 

0x05 — NMEA frames are output on CMUX DLC1

NMEA_OUTPUT_CMUX_DLC2 

0x06 — NMEA frames are output on CMUX DLC2

NMEA_OUTPUT_CMUX_DLC3 

0x07 — NMEA frames are output on CMUX DLC3

NMEA_OUTPUT_CMUX_DLC4 

0x08 — NMEA frames are output on CMUX DLC4

◆ power_down_event

#include <hl78xx_apis.h>

Power down event types.

Types of power down events reported by the modem

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_POWER_DOWN 
.
Enumerator
POWER_DOWN_EVENT_ENTER 

Power down event: Modem is entering power down mode.

POWER_DOWN_EVENT_EXIT 

Power down event: Modem is exiting power down mode.

POWER_DOWN_EVENT_NONE 

No power down event.

◆ wdsi_indication

#include <hl78xx_apis.h>

Device Services Indications (+WDSI).

Enum representing AirVantage Device Services Indications

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_AIRVANTAGE 
.
Enumerator
WDSI_BOOTSTRAP_CREDENTIALS_PRESENT 

Raised at startup if credentials for Bootstrap Server are present.

WDSI_USER_AGREEMENT_REQUEST 

Device requests user agreement to connect to AirVantage.

WDSI_FIRMWARE_DOWNLOAD_REQUEST 

AirVantage requests device to download firmware package.

WDSI_FIRMWARE_INSTALL_REQUEST 

AirVantage requests device to install firmware package.

WDSI_AUTHENTICATION_START 

Starting authentication with Bootstrap or DM Server.

WDSI_AUTHENTICATION_FAILED 

Authentication failed.

WDSI_AUTHENTICATION_SUCCESS 

Authentication succeeded, starting session.

WDSI_CONNECTION_DENIED 

Connection denied by server.

WDSI_DM_SESSION_CLOSED 

DM session closed.

WDSI_FIRMWARE_AVAILABLE 

Firmware package available for download.

WDSI_FIRMWARE_DOWNLOADED 

Firmware package downloaded and stored.

WDSI_FIRMWARE_DOWNLOAD_ISSUE 

Firmware download issue, reason indicated by subcode.

WDSI_PACKAGE_VERIFIED_CERTIFIED 

Package verified and certified.

WDSI_PACKAGE_VERIFIED_NOT_CERTIFIED 

Package verified but not certified.

WDSI_FIRMWARE_UPDATE_START 

Starting firmware update.

WDSI_FIRMWARE_UPDATE_FAILED 

Firmware update failed.

WDSI_FIRMWARE_UPDATE_SUCCESS 

Firmware updated successfully.

WDSI_DOWNLOAD_IN_PROGRESS 

Download in progress, percentage indicated.

WDSI_SESSION_STARTED 

Session started with Bootstrap server (+WDSI: 23,0) or DM server (+WDSI: 23,1).

Function Documentation

◆ hl78xx_access_tech_to_rat()

enum hl78xx_cell_rat_mode hl78xx_access_tech_to_rat ( enum cellular_access_technology access_tech)

#include <hl78xx_apis.h>

Convert standard cellular access technology to HL78xx RAT mode.

Parameters
access_techStandard cellular access technology.
Returns
Corresponding HL78xx RAT mode.

◆ hl78xx_api_func_get_modem_info()

int hl78xx_api_func_get_modem_info ( const struct device * dev,
enum hl78xx_modem_info_type type,
void * info,
size_t size )

#include <hl78xx_apis.h>

Get vendor-specific modem information (internal implementation).

Internal function to retrieve HL78xx-specific modem information. Users should call hl78xx_get_modem_info() instead.

Parameters
devCellular network device instance
typeType of the modem info to retrieve
infoPointer to store the modem info
sizeSize of the info buffer
Returns
0 if successful, negative errno on failure

◆ hl78xx_api_func_get_modem_info_standard()

int hl78xx_api_func_get_modem_info_standard ( const struct device * dev,
enum cellular_modem_info_type type,
char * info,
size_t size )

#include <hl78xx_apis.h>

Get standard (Zephyr cellular API) modem information from cache.

Reads identity fields cached by the driver during the init script. Does NOT issue any AT command and is safe to call from any context.

Parameters
devCellular network device instance
typeZephyr cellular modem info type
infoBuffer to store the info string
sizeBuffer size in bytes
Returns
0 on success, -ENOTSUP if type not handled, negative errno on failure

◆ hl78xx_api_func_get_network_info()

int hl78xx_api_func_get_network_info ( const struct device * dev,
enum hl78xx_network_info_type type,
void * info,
size_t size )

#include <hl78xx_apis.h>

Get cached vendor-specific network information.

Internal function to retrieve HL78xx-specific network information. Users should call hl78xx_get_network_info() instead.

Parameters
devCellular network device instance
typeType of the network info to retrieve
infoPointer to store the network info
sizeSize of the info buffer
Returns
0 if successful, negative errno on failure

◆ hl78xx_api_func_get_phone_functionality()

int hl78xx_api_func_get_phone_functionality ( const struct device * dev,
enum hl78xx_phone_functionality * functionality )

#include <hl78xx_apis.h>

Get phone functionality mode (internal implementation).

Internal function to query the modem's phone functionality mode. Users should call hl78xx_get_phone_functionality() instead.

Parameters
devCellular network device instance
functionalityPointer to store the current phone functionality mode
Returns
0 if successful, negative errno on failure

◆ hl78xx_api_func_get_prl()

int hl78xx_api_func_get_prl ( const struct device * dev,
struct kselacq_syntax * kselacq_rats )

#include <hl78xx_apis.h>

Get the current Preferred RAT List.

Retrieves the current raw AT+KSELACQ PRL values from the modem cache.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_AUTORAT 
.
Parameters
devCellular network device instance
kselacq_ratsPointer to store the current PRL entries
Returns
0 if successful, negative errno on failure

◆ hl78xx_api_func_get_rsrp_validity()

int hl78xx_api_func_get_rsrp_validity ( const struct device * dev,
bool * is_valid )

#include <hl78xx_apis.h>

Check whether the current RSRP meets the configured minimum threshold.

Uses the driver's standard signal query path and compares the returned RSRP in dBm against CONFIG_MODEM_MIN_ALLOWED_SIGNAL_STRENGTH.

Parameters
devCellular network device instance
is_validOutput flag set to true when the threshold is met
Returns
0 on success, negative errno on failure

◆ hl78xx_api_func_get_rsrq_validity()

int hl78xx_api_func_get_rsrq_validity ( const struct device * dev,
bool * is_valid )

#include <hl78xx_apis.h>

Check whether the current RSRQ meets the configured minimum threshold.

Uses the driver's standard signal query path and compares the returned RSRQ in dB against CONFIG_MODEM_MIN_ALLOWED_SIGNAL_QUALITY.

Parameters
devCellular network device instance
is_validOutput flag set to true when the threshold is met
Returns
0 on success, negative errno on failure

◆ hl78xx_api_func_get_signal()

int hl78xx_api_func_get_signal ( const struct device * dev,
const enum cellular_signal_type type,
int16_t * value )

#include <hl78xx_apis.h>

Get network signal strength (internal implementation).

Internal function to retrieve cellular signal strength metrics. Users should use the standard cellular API instead.

Parameters
devCellular network device instance
typeType of the signal to retrieve (RSSI, RSRP, RSRQ, etc.)
valuePointer to store the signal value
Returns
0 if successful, negative errno on failure

◆ hl78xx_api_func_get_sinr_validity()

int hl78xx_api_func_get_sinr_validity ( const struct device * dev,
bool * is_valid )

#include <hl78xx_apis.h>

Check whether the current SINR meets the configured minimum threshold.

Uses the cached +KCELLMEAS-derived SINR value and compares it in dB against CONFIG_MODEM_MIN_ALLOWED_SINR.

Parameters
devCellular network device instance
is_validOutput flag set to true when the threshold is met
Returns
0 on success, negative errno on failure

◆ hl78xx_api_func_modem_dynamic_cmd_send()

int hl78xx_api_func_modem_dynamic_cmd_send ( const struct device * dev,
const char * cmd,
uint16_t cmd_size,
const struct modem_chat_match * response_matches,
uint16_t matches_size )

#include <hl78xx_apis.h>

Send dynamic AT command (internal implementation).

Internal function to send arbitrary AT commands to the modem. Users should call hl78xx_modem_cmd_send() instead.

Parameters
devCellular network device instance
cmdAT command to send
cmd_sizeSize of the AT command
response_matchesExpected response patterns
matches_sizeNumber of response patterns
Returns
0 if successful, negative errno on failure

◆ hl78xx_api_func_restart()

int hl78xx_api_func_restart ( const struct device * dev,
enum hl78xx_modem_restart_mode mode )

#include <hl78xx_apis.h>

Request a driver-managed modem restart.

Hard restart enters the reset-pin state-machine path. Soft restart enters a driver-owned AT+CFUN=4,1 path and waits for the modem restart indication before re-running initialization.

Soft restart requires the modem chat path to be active. If the modem is in sleep, idle, or power-off transition states, the call returns -EAGAIN. If the soft-reset request cannot be issued or the modem never reports the restart indication, the driver falls back to the full restart path when hardware restart control is available.

Parameters
devCellular network device instance.
modeRequested restart mode.
Return values
0on success.
-EINVALif dev or mode is invalid.
-ENOTSUPif hard restart is requested but no reset GPIO is configured.
-EAGAINif a soft restart is requested while the modem is not ready to accept AT commands.
-EBUSYif another restart is already in progress.

◆ hl78xx_api_func_set_network_operator_format()

int hl78xx_api_func_set_network_operator_format ( const struct device * dev,
enum hl78xx_operator_format format )

#include <hl78xx_apis.h>

Set the +COPS network operator format.

Parameters
devCellular network device instance
formatDesired operator format to set
Returns
0 if successful, negative errno on failure

◆ hl78xx_api_func_set_phone_functionality()

int hl78xx_api_func_set_phone_functionality ( const struct device * dev,
enum hl78xx_phone_functionality functionality,
bool reset )

#include <hl78xx_apis.h>

Set phone functionality mode (internal implementation).

Internal function to set the modem's phone functionality mode. Users should call hl78xx_set_phone_functionality() instead.

Parameters
devCellular network device instance
functionalityPhone functionality mode to set
resetIf true, the modem will be reset as part of applying the functionality change.
Returns
0 if successful, negative errno on failure

◆ hl78xx_api_func_set_prl()

int hl78xx_api_func_set_prl ( const struct device * dev,
const struct kselacq_syntax kselacq_rats )

#include <hl78xx_apis.h>

Set a new Preferred RAT List through AT+KSELACQ.

Sends AT+KSELACQ=0,<rat1>,<rat2>,<rat3> immediately, updates the driver's cached PRL values, and does not force an immediate modem restart.

Duplicate RAT entries are allowed to bias the modem's search order. To clear the PRL and disable automatic RAT switching, pass rat1/rat2/rat3 as HL78XX_KSELACQ_RAT_CLEAR; the driver emits AT+KSELACQ=0,0 for that case.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_AUTORAT 
.
Parameters
devCellular network device instance
kselacq_ratsRaw AT+KSELACQ PRL entries to set
Returns
0 if successful, negative errno on failure

◆ hl78xx_at_monitor_pause()

void hl78xx_at_monitor_pause ( struct hl78xx_at_monitor_entry * mon)
inlinestatic

#include <hl78xx_apis.h>

Pause AT monitor.

Pause monitor mon from receiving parsed unsolicited AT notifications.

Parameters
monThe monitor to pause.

◆ hl78xx_at_monitor_register()

int hl78xx_at_monitor_register ( struct hl78xx_at_monitor_entry * mon)

#include <hl78xx_apis.h>

Register an AT monitor.

Adds a runtime monitor to the list of registered AT monitors. The monitor entry must not already be registered and must not have outstanding runtime references from a previous registration.

Monitor entries should be zero-initialized before first registration.

Parameters
monPointer to the monitor entry to register.
Returns
0 on success.
-EINVAL if mon is NULL.
-EALREADY if mon is already registered.
-EBUSY if mon still has outstanding runtime references.
-ENOMEM if the maximum number of runtime monitors is reached.

◆ hl78xx_at_monitor_resume()

void hl78xx_at_monitor_resume ( struct hl78xx_at_monitor_entry * mon)
inlinestatic

#include <hl78xx_apis.h>

Resume AT monitor.

Resume forwarding parsed unsolicited AT notifications to monitor mon.

Parameters
monThe monitor to resume.

◆ hl78xx_at_monitor_unregister()

int hl78xx_at_monitor_unregister ( struct hl78xx_at_monitor_entry * mon)

#include <hl78xx_apis.h>

Unregister an AT monitor.

Removes a runtime monitor from future dispatch snapshots. This function does not wait for callbacks that are already in progress or for snapshots that already captured the monitor entry.

If the monitor entry is dynamically allocated, the caller must not free or reuse it immediately after this function returns. Instead, provide a release callback in the monitor entry and free the entry from that callback. The release callback is invoked after the final runtime reference is dropped.

This function may be called from a monitor callback.

Parameters
monPointer to the monitor entry to unregister.
Returns
0 on success.
-EINVAL if mon is NULL.
-ENOENT if mon is not registered.

◆ hl78xx_edrx_get_time_to_sleep()

int hl78xx_edrx_get_time_to_sleep ( const struct device * dev)

#include <hl78xx_apis.h>

Get the remaining time for the modem to go in eDRX idle state.

Attention
Available only when the following Kconfig options are enabled:
CONFIG_MODEM_HL78XX_LOW_POWER_MODE 
,
CONFIG_MODEM_HL78XX_EDRX 
.
Parameters
devPointer to the modem device
Returns
Remaining time in milliseconds, or negative errno on failure

◆ hl78xx_enter_gnss_mode()

int hl78xx_enter_gnss_mode ( const struct device * dev)

#include <hl78xx_apis.h>

Enter GNSS mode.

Switches modem from LTE mode to GNSS mode. The exact transition depends on the modem's current power state:

Without low-power mode (default / airplane mode path):

  1. Carrier off (notify app, close sockets)
  2. Put modem in airplane mode (AT+CFUN=4)
  3. Initialize GNSS engine
  4. Fire HL78XX_GNSS_ENGINE_READY event when complete

With low-power mode (PSM path):

  1. Mark GNSS as pending
  2. Wait for modem to enter PSM sleep (PSMEV:1)
  3. Wake modem (UART only - LTE stays hibernating)
  4. Initialize GNSS engine (no CFUN=4 needed, RF path already free)
  5. Fire HL78XX_GNSS_ENGINE_READY event when complete

Per HL78xx GNSS App Note 5.3: "GNSS can be used in PSM mode" because the LTE modem is unavailable and the shared RF Rx path is free.

After entering GNSS mode, call hl78xx_queue_gnss_search() to start fix acquisition.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
Parameters
devPointer to the modem device
Returns
0 on success, negative errno on failure

◆ hl78xx_evt_monitor_pause()

void hl78xx_evt_monitor_pause ( struct hl78xx_evt_monitor_entry * mon)
inlinestatic

#include <hl78xx_apis.h>

Pause monitor.

Pause monitor mon from receiving notifications.

Parameters
monThe monitor to pause.

◆ hl78xx_evt_monitor_register()

int hl78xx_evt_monitor_register ( struct hl78xx_evt_monitor_entry * mon)

#include <hl78xx_apis.h>

Register an event monitor.

Adds a runtime monitor to the list of registered event monitors. The monitor entry must not already be registered and must not have outstanding runtime references from a previous registration.

Monitor entries should be zero-initialized before first registration.

Parameters
monPointer to the monitor entry to register.
Returns
0 on success.
-EINVAL if mon is NULL.
-EALREADY if mon is already registered.
-EBUSY if mon still has outstanding runtime references.
-ENOMEM if the maximum number of runtime monitors is reached.

◆ hl78xx_evt_monitor_resume()

void hl78xx_evt_monitor_resume ( struct hl78xx_evt_monitor_entry * mon)
inlinestatic

#include <hl78xx_apis.h>

Resume monitor.

Resume forwarding notifications to monitor mon.

Parameters
monThe monitor to resume.

◆ hl78xx_evt_monitor_unregister()

int hl78xx_evt_monitor_unregister ( struct hl78xx_evt_monitor_entry * mon)

#include <hl78xx_apis.h>

Unregister an event monitor.

Removes a runtime monitor from future dispatch snapshots. This function does not wait for callbacks that are already in progress or for snapshots that already captured the monitor entry.

If the monitor entry is dynamically allocated, the caller must not free or reuse it immediately after this function returns. Instead, provide a release callback in the monitor entry and free the entry from that callback. The release callback is invoked after the final runtime reference is dropped.

This function may be called from a monitor callback.

Parameters
monPointer to the monitor entry to unregister.
Returns
0 on success.
-EINVAL if mon is NULL.
-ENOENT if mon is not registered.

◆ hl78xx_evt_notif_handler_set()

int hl78xx_evt_notif_handler_set ( hl78xx_evt_monitor_dispatcher_t handler)

#include <hl78xx_apis.h>

Set the event notification handler for HL78xx modem events.

Registers a callback handler to receive asynchronous event notifications from the HL78xx modem, such as network registration changes, GNSS updates, or other modem-generated events.

Parameters
handlerFunction pointer to the event monitor callback. Pass NULL to clear the existing handler.
Return values
0on success.
-EINVALif the handler parameter is invalid.

◆ hl78xx_exit_gnss_mode()

int hl78xx_exit_gnss_mode ( const struct device * dev)

#include <hl78xx_apis.h>

Exit GNSS mode and return to LTE mode.

Switches modem from GNSS mode back to LTE mode. This will:

  1. Stop any active GNSS search
  2. Fire HL78XX_GNSS_EVENT_MODE_EXITED event

After the event fires, the next step depends on the power mode:

  • Airplane mode: User must call hl78xx_api_func_set_phone_functionality(dev, HL78XX_FULLY_FUNCTIONAL, ...) to restore LTE.
  • PSM mode: The driver automatically transitions back to AWAIT_REGISTERED and the modem will re-register to LTE.
    • - LOW-POWER-PSM mode: User does not need to do anything, the modem will automatically transition back to LTE registration after the kcellmeasure or socket data transmission starts.
Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
Parameters
devPointer to the modem device
Returns
0 on success, -EALREADY if not in GNSS mode, negative errno on failure

◆ hl78xx_get_modem_info()

int hl78xx_get_modem_info ( const struct device * dev,
const enum hl78xx_modem_info_type type,
void * info,
size_t size )
inlinestatic

#include <hl78xx_apis.h>

Get modem info for the device.

Parameters
devCellular network device instance
typeType of the modem info requested
infoInfo string destination
sizeInfo string size
Return values
0if successful.
-ENOTSUPif API is not supported by cellular network device.
-ENODATAif modem does not provide info requested
Negativeerrno-code from chat module otherwise.

◆ hl78xx_get_network_info()

int hl78xx_get_network_info ( const struct device * dev,
enum hl78xx_network_info_type type,
void * info,
size_t size )
inlinestatic

#include <hl78xx_apis.h>

Get cached network info for the device.

Parameters
devCellular network device instance
typeType of the network info requested
infoInfo destination buffer
sizeSize of the destination buffer
Return values
0if successful.
-ENOTSUPif the type is not supported.
-ENODATAif the modem does not provide the requested info.
Negativeerrno-code from chat module otherwise.

◆ hl78xx_get_phone_functionality()

int hl78xx_get_phone_functionality ( const struct device * dev,
enum hl78xx_phone_functionality * functionality )
inlinestatic

#include <hl78xx_apis.h>

Get the current phone functionality mode of the modem.

Queries the modem to retrieve its current operational mode, such as full functionality, airplane mode, or minimum functionality.

Parameters
devPointer to the modem device instance.
functionalityPointer to store the retrieved functionality mode. (see enum hl78xx_phone_functionality)
Return values
0on success.
-EINVALif the input parameters are invalid.
-EIOif the modem fails to respond or returns an error.

◆ hl78xx_get_rsrp_validity()

int hl78xx_get_rsrp_validity ( const struct device * dev,
bool * is_valid )
inlinestatic

#include <hl78xx_apis.h>

Check whether the current RSRP meets the configured threshold.

Parameters
devCellular network device instance
is_validOutput flag set to true when the threshold is met
Return values
0on success.
Negativeerrno-code on failure.

◆ hl78xx_get_rsrq_validity()

int hl78xx_get_rsrq_validity ( const struct device * dev,
bool * is_valid )
inlinestatic

#include <hl78xx_apis.h>

Check whether the current RSRQ meets the configured threshold.

Parameters
devCellular network device instance
is_validOutput flag set to true when the threshold is met
Return values
0on success.
Negativeerrno-code on failure.

◆ hl78xx_get_sinr_validity()

int hl78xx_get_sinr_validity ( const struct device * dev,
bool * is_valid )
inlinestatic

#include <hl78xx_apis.h>

Check whether the current SINR meets the configured threshold.

Parameters
devCellular network device instance
is_validOutput flag set to true when the threshold is met
Return values
0on success.
Negativeerrno-code on failure.

◆ hl78xx_gnss_assist_data_delete()

int hl78xx_gnss_assist_data_delete ( const struct device * dev)

#include <hl78xx_apis.h>

Delete A-GNSS assistance data.

Deletes any stored assistance data from the modem using AT+GNSSAD=0 command.

Attention
Available only when the following Kconfig options are enabled:
CONFIG_HL78XX_GNSS 
,
CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE 
.
Parameters
devPointer to the GNSS device
Returns
0 on success, negative errno on failure

◆ hl78xx_gnss_assist_data_download()

int hl78xx_gnss_assist_data_download ( const struct device * dev,
enum hl78xx_agnss_days days )

#include <hl78xx_apis.h>

Download A-GNSS assistance data.

Initiates download of predicted assistance data from the network using AT+GNSSAD=1,<days> command. Requires active network connection.

Attention
Available only when the following Kconfig options are enabled:
CONFIG_HL78XX_GNSS 
,
CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE 
.
Parameters
devPointer to the GNSS device
daysNumber of days of prediction data to download. Valid values: 1, 2, 3, 7, 14, 28
Returns
0 on success, -EINVAL for invalid days value, negative errno on failure

◆ hl78xx_gnss_assist_data_get_status()

int hl78xx_gnss_assist_data_get_status ( const struct device * dev,
struct hl78xx_agnss_status * status )

#include <hl78xx_apis.h>

Get A-GNSS assistance data status.

Queries the modem for A-GNSS assistance data validity and expiry using AT+GNSSAD? command.

Attention
Available only when the following Kconfig options are enabled:
CONFIG_HL78XX_GNSS 
,
CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE 
.
Parameters
devPointer to the GNSS device
statusPointer to structure to receive the status
Returns
0 on success, negative errno on failure

◆ hl78xx_gnss_get_latest_known_fix()

int hl78xx_gnss_get_latest_known_fix ( const struct device * dev)

#include <hl78xx_apis.h>

Get the latest known GNSS fix from the modem.

Queries the modem for the last known position using AT+GNSSLOC? Result is delivered via GNSS data callback.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
Parameters
devPointer to the GNSS device
Returns
0 on success, -EBUSY if another script is running, other negative errno on failure

◆ hl78xx_gnss_set_nmea_output()

int hl78xx_gnss_set_nmea_output ( const struct device * dev,
enum nmea_output_port port )

#include <hl78xx_apis.h>

Set NMEA output port for GNSS.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
Parameters
devPointer to the GNSS device
portNMEA output port configuration
Returns
0 on success, -EBUSY if GNSS search is active, negative errno on failure

◆ hl78xx_gnss_set_search_timeout()

int hl78xx_gnss_set_search_timeout ( const struct device * dev,
uint32_t timeout_ms )

#include <hl78xx_apis.h>

Set GNSS search timeout.

If a GNSS search is already active, the remaining timeout is replaced from the moment this function is called. Setting timeout_ms to 0 disables the active search timeout.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
Parameters
devPointer to the GNSS device
timeout_msTimeout in milliseconds (0 = no timeout)
Returns
0 on success, negative errno on failure

◆ hl78xx_modem_at_cmd()

int hl78xx_modem_at_cmd ( const struct device * dev,
char * response,
size_t response_size,
const char * cmd )

#include <hl78xx_apis.h>

Send a pre-formatted AT command and copy the whole modem response into a caller-supplied buffer.

Callers must format the command string first with snprintf() when variable arguments are needed. The response buffer receives the full modem response collected by the driver.

Parameters
devCellular network device instance
responseOutput buffer for the whole modem response
response_sizeOutput buffer size
cmdAT command string to send
Returns
0 on success, positive encoded modem error, or negative errno on failure

◆ hl78xx_modem_at_err()

int hl78xx_modem_at_err ( int error)
inlinestatic

#include <hl78xx_apis.h>

Return the modem CME/CMS error code encoded in hl78xx_modem_at_send/cmd.

Parameters
errorReturn value from hl78xx_modem_at_send() or hl78xx_modem_at_cmd().
Returns
Encoded modem error value, or 0 for generic ERROR responses.

◆ hl78xx_modem_at_err_type()

int hl78xx_modem_at_err_type ( int error)
inlinestatic

#include <hl78xx_apis.h>

Return the modem error type encoded in hl78xx_modem_at_send/cmd return values.

Parameters
errorReturn value from hl78xx_modem_at_send() or hl78xx_modem_at_cmd().
Return values
HL78XX_MODEM_AT_ERRORfor ERROR responses.
HL78XX_MODEM_AT_CME_ERRORfor +CME ERROR responses.
HL78XX_MODEM_AT_CMS_ERRORfor +CMS ERROR responses.

◆ hl78xx_modem_at_send()

int hl78xx_modem_at_send ( const struct device * dev,
const char * cmd )

#include <hl78xx_apis.h>

Send a pre-formatted AT command to the modem.

Returns 0 on OK responses, a positive encoded modem error on ERROR/+CME ERROR/+CMS ERROR responses, and a negative errno on transport failure. Callers must format the command string first with snprintf() when variable arguments are needed.

Parameters
devCellular network device instance
cmdAT command string to send
Returns
0 on success, positive encoded modem error, or negative errno on failure

◆ hl78xx_modem_cmd_send()

int hl78xx_modem_cmd_send ( const struct device * dev,
const char * cmd,
uint16_t cmd_size,
const struct modem_chat_match * response_matches,
uint16_t matches_size )
inlinestatic

#include <hl78xx_apis.h>

Send an AT command to the modem and wait for a matched response.

Transmits the specified AT command to the modem and waits for a response that matches one of the expected patterns defined in the response match table.

Parameters
devPointer to the modem device instance.
cmdPointer to the AT command string to be sent.
cmd_sizeLength of the AT command string in bytes.
response_matchesPointer to an array of expected response patterns. (see struct modem_chat_match)
matches_sizeNumber of response patterns in the array.
Return values
0on successful command transmission and response match.
-EINVALif any parameter is invalid.
-ETIMEDOUTif the modem did not respond in the expected time.
-EIOon communication failure or if response did not match.

◆ hl78xx_parse_rsrp()

int hl78xx_parse_rsrp ( uint8_t rsrp,
int16_t * value )
inlinestatic

#include <hl78xx_apis.h>

Convert raw RSRP value from the modem to dBm.

Parses the Reference Signal Received Power (RSRP) value reported by the modem and converts it into a corresponding signal strength in dBm, typically based on 3GPP TS 36.133 specifications.

Parameters
rsrpRaw RSRP value (commonly in the range 0–97, or 255 if unknown).
valuePointer to store the converted RSRP in dBm.
Return values
0on successful conversion.
-EINVALif the RSRP value is out of range or represents an unknown value.

◆ hl78xx_parse_rsrq()

int hl78xx_parse_rsrq ( uint8_t rsrq,
int16_t * value )
inlinestatic

#include <hl78xx_apis.h>

Convert raw RSRQ value from the modem to dB.

Parses the Reference Signal Received Quality (RSRQ) value provided by the modem and converts it into a signal quality measurement in decibels (dB), as specified by 3GPP TS 36.133.

Parameters
rsrqRaw RSRQ value (typically 0–34, or 255 if unknown).
valuePointer to store the converted RSRQ in dB.
Return values
0on successful conversion.
-EINVALif the RSRQ value is out of valid range or indicates unknown.

◆ hl78xx_parse_rssi()

int hl78xx_parse_rssi ( uint8_t rssi,
int16_t * value )
inlinestatic

#include <hl78xx_apis.h>

Convert raw RSSI value from the modem to dBm.

Parses the RSSI value reported by the modem (typically from an AT command response) and converts it to a corresponding signal strength in dBm, as defined by 3GPP TS 27.007.

Parameters
rssiRaw RSSI value (0–31 or 99 for not known or not detectable).
valuePointer to store the converted RSSI in dBm.
Return values
0on successful conversion.
-EINVALif the RSSI value is out of valid range or unsupported.

◆ hl78xx_power_down_cancel()

int hl78xx_power_down_cancel ( const struct device * dev)

#include <hl78xx_apis.h>

Cancel a pending stage-1 HL78xx shutdown timer.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_POWER_DOWN 
.
Parameters
devPointer to the HL78xx modem device.
Returns
0 on success, -EINVAL for invalid arguments, or -ENOENT if no stage-1 shutdown timer is pending.

◆ hl78xx_power_down_confirm()

void hl78xx_power_down_confirm ( const struct device * dev)

#include <hl78xx_apis.h>

Confirm that application cleanup is complete and the modem may proceed with physical shutdown.

If no shutdown is pending this call is a no-op.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_POWER_DOWN 
.
Parameters
devPointer to the HL78xx modem device.

◆ hl78xx_power_down_respond()

int hl78xx_power_down_respond ( const struct device * dev,
enum hl78xx_power_down_response response,
uint32_t timeout_s )

#include <hl78xx_apis.h>

Respond to a pending HL78XX power-down update.

Call this after receiving HL78XX_POWER_DOWN_UPDATE with POWER_DOWN_EVENT_ENTER. Use HL78XX_POWER_DOWN_RESPONSE_IMMEDIATE to allow the modem to proceed with physical shutdown right away, or HL78XX_POWER_DOWN_RESPONSE_RESCHEDULE to extend the shutdown grace period by timeout_s seconds from the time of this call.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_POWER_DOWN 
.
Parameters
devPointer to the HL78xx modem device.
responseRequested handling of the pending shutdown.
timeout_sNew grace period in seconds when response is HL78XX_POWER_DOWN_RESPONSE_RESCHEDULE. Ignored otherwise.
Returns
0 on success, -EINVAL for invalid arguments, or -ENOENT if no application-controlled shutdown is pending.

◆ hl78xx_power_down_trigger()

int hl78xx_power_down_trigger ( const struct device * dev,
k_timeout_t delay )

#include <hl78xx_apis.h>

Trigger the HL78xx shutdown process after a caller-supplied delay.

This overrides any currently pending stage-1 power-down delay. Pass K_NO_WAIT to dispatch HL78XX_POWER_DOWN_UPDATE immediately, or a relative delay such as K_SECONDS(5) to start the graceful shutdown flow later.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_POWER_DOWN 
.
Parameters
devPointer to the HL78xx modem device.
delayDelay before stage-1 power-down notification runs.
Returns
0 on success or -EINVAL for invalid arguments.

◆ hl78xx_queue_gnss_search()

int hl78xx_queue_gnss_search ( const struct device * dev)

#include <hl78xx_apis.h>

Queue a GNSS position search.

Starts GNSS satellite search to obtain a position fix. Must be called after hl78xx_enter_gnss_mode().

Attention
Available only when the following Kconfig option is enabled:
CONFIG_HL78XX_GNSS 
.
Parameters
devPointer to the GNSS device
Returns
0 on success, negative errno on failure

◆ hl78xx_rat_to_access_tech()

enum cellular_access_technology hl78xx_rat_to_access_tech ( enum hl78xx_cell_rat_mode rat_mode)

#include <hl78xx_apis.h>

Convert HL78xx RAT mode to standard cellular API.

Maps HL78xx-specific radio access technology enum to the standard Zephyr cellular API access technology enum.

Parameters
rat_modeHL78xx RAT mode
Returns
Corresponding cellular_access_technology value

◆ hl78xx_restart_modem()

int hl78xx_restart_modem ( const struct device * dev,
enum hl78xx_modem_restart_mode mode )
inlinestatic

#include <hl78xx_apis.h>

Request a driver-managed modem restart.

Parameters
devPointer to the modem device instance.
modeRestart mode to execute.
Return values
0on success.
Negativeerrno-code on failure.

◆ hl78xx_set_active_sim()

int hl78xx_set_active_sim ( const struct device * dev,
enum hl78xx_sim_slot sim_slot )

#include <hl78xx_apis.h>

Select the active external SIM slot.

This only drives the optional mdm-sim-switch-gpios line exposed by the modem devicetree node. It does not perform any modem state transition or restart sequence, so callers should switch SIMs only when the modem is in a safe state for the attached hardware.

Parameters
devPointer to the modem device.
sim_slotSIM slot to select. Only slot 1 and slot 2 are supported.
Returns
0 on success.
-EINVAL if dev or sim_slot is invalid.
-ENOTSUP if the modem SIM-switch GPIO is not configured in devicetree.
Negative errno from the GPIO driver on failure.

◆ hl78xx_set_phone_functionality()

int hl78xx_set_phone_functionality ( const struct device * dev,
enum hl78xx_phone_functionality functionality,
bool reset )
inlinestatic

#include <hl78xx_apis.h>

Set the modem phone functionality mode.

Configures the operational state of the modem (e.g., full, airplane, or minimum functionality). Optionally, the modem can be reset during this transition.

Parameters
devPointer to the modem device instance.
functionalityDesired phone functionality mode to be set. (e.g., full, airplane, minimum – see enum hl78xx_phone_functionality)
resetIf true, the modem will be reset as part of applying the functionality change.
Return values
0on success.
-EINVALif an invalid parameter is passed.
-EIOon communication or command failure with the modem.

◆ hl78xx_set_prl()

int hl78xx_set_prl ( const struct device * dev,
struct kselacq_syntax prl )
inlinestatic

#include <hl78xx_apis.h>

Set a new raw AT+KSELACQ Preferred RAT List.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_AUTORAT 
.
Parameters
devPointer to the modem device instance.
prlPreferred RAT List expressed as raw AT+KSELACQ values.
Return values
0on success.
-EINVALif the inputs are invalid.
Negativeerrno on modem command failure.

◆ hl78xx_set_runtime_band_provider()

int hl78xx_set_runtime_band_provider ( const struct device * dev,
hl78xx_runtime_band_provider_t provider,
void * user_data )

#include <hl78xx_apis.h>

Register or clear a runtime band provider for the driver.

When a provider is registered, hl78xx_band_cfg() may use its per-RAT band override instead of the default Kconfig bitmap. Passing NULL clears the provider.

Parameters
devCellular network device instance.
providerCallback invoked to obtain a runtime band override.
user_dataOpaque context passed back to provider.
Returns
0 on success, negative errno on failure.

◆ hl78xx_set_wake_pin_high()

int hl78xx_set_wake_pin_high ( const struct device * dev)

#include <hl78xx_apis.h>

Drive the modem WAKE pin high.

This directly maps to gpio_pin_set_dt(&config->mdm_gpio_wake, 1) inside the driver.

Parameters
devPointer to the modem device.
Returns
0 on success.
-EINVAL if dev is invalid.
-ENOTSUP if the modem WAKE GPIO is not configured in devicetree.
Negative errno from the GPIO driver on failure.

◆ hl78xx_set_wake_pin_low()

int hl78xx_set_wake_pin_low ( const struct device * dev)

#include <hl78xx_apis.h>

Drive the modem WAKE pin low.

This directly maps to gpio_pin_set_dt(&config->mdm_gpio_wake, 0) inside the driver.

Parameters
devPointer to the modem device.
Returns
0 on success.
-EINVAL if dev is invalid.
-ENOTSUP if the modem WAKE GPIO is not configured in devicetree.
Negative errno from the GPIO driver on failure.

◆ hl78xx_start_airvantage_dm_session()

int hl78xx_start_airvantage_dm_session ( const struct device * dev)

#include <hl78xx_apis.h>

Start an AirVantage Device Management (DM) session.

Initiates a connection to the Sierra Wireless AirVantage server for device management operations.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_AIRVANTAGE 
.
Parameters
devPointer to the modem device
Returns
0 on success, negative errno on failure

◆ hl78xx_stop_airvantage_dm_session()

int hl78xx_stop_airvantage_dm_session ( const struct device * dev)

#include <hl78xx_apis.h>

Stop an AirVantage Device Management (DM) session.

Terminates the active connection to the AirVantage server.

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_AIRVANTAGE 
.
Parameters
devPointer to the modem device
Returns
0 on success, negative errno on failure

◆ hl78xx_wakeup_modem()

int hl78xx_wakeup_modem ( const struct device * dev)

#include <hl78xx_apis.h>

Wake the modem from PSM sleep.

Sends a wakeup signal to the modem, triggering the RESUME event in the driver state machine. The modem will re-open the UART bus and proceed to either GNSS (if a GNSS request is pending in post-PSM mode) or LTE registration (AWAIT_REGISTERED).

This is the user-facing API for the POST-PSM GNSS workflow:

  1. hl78xx_enter_gnss_mode() — queues GNSS, modem enters PSM
  2. (modem sleeps, waits for user trigger)
  3. hl78xx_wakeup_modem() — wakes the modem, GNSS runs before LTE
  4. GNSS completes, modem returns to LTE registration

Can also be used independently of GNSS to wake the modem for any purpose (e.g. sending data earlier than the next PSM cycle).

Attention
Available only when the following Kconfig option is enabled:
CONFIG_MODEM_HL78XX_LOW_POWER_MODE 
.
Parameters
devPointer to the modem device
Returns
0 on success
-EALREADY if modem is not in sleep state
-EINVAL if dev is invalid