Zephyr API Documentation 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 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_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 }
 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  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_CELLMEAS_UPDATE , HL78XX_EVT_TYPE_COUNT
}
 HL78xx event types. 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_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_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_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.

Detailed Description

Sierra Wireless HL78xx cellular modems.

Macro Definition Documentation

◆ ACTIVE

#define ACTIVE   0

#include <zephyr/drivers/modem/hl78xx_apis.h>

Monitor is active, default.

◆ CESQ_RSRP_MAX

#define CESQ_RSRP_MAX   (97)

#include <zephyr/drivers/modem/hl78xx_apis.h>

Maximum valid RSRP code returned by AT+CESQ command.

◆ CESQ_RSRP_TO_DB

#define CESQ_RSRP_TO_DB ( v)

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/hl78xx_apis.h>

Unknown RSRP value returned by AT+CESQ command.

◆ CESQ_RSRQ_MAX

#define CESQ_RSRQ_MAX   (34)

#include <zephyr/drivers/modem/hl78xx_apis.h>

Maximum valid RSRQ code returned by AT+CESQ command.

◆ CESQ_RSRQ_TO_DB

#define CESQ_RSRQ_TO_DB ( v)

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/hl78xx_apis.h>

Unknown RSRQ value returned by AT+CESQ command.

◆ CSQ_RSSI_MAX

#define CSQ_RSSI_MAX   (31)

#include <zephyr/drivers/modem/hl78xx_apis.h>

Maximum valid RSSI code returned by AT+CSQ command.

◆ CSQ_RSSI_TO_DB

#define CSQ_RSSI_TO_DB ( v)

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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:242
GNSS auxiliary data callback structure.
Definition hl78xx_apis.h:987

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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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:148
AT monitor entry structure.
Definition hl78xx_apis.h:1148

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 <zephyr/drivers/modem/hl78xx_apis.h>

Monitor any parsed unsolicited AT notification.

◆ HL78XX_AT_MONITOR_DIRECT

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

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/hl78xx_apis.h>

Maximum length of CEREG timer string.

◆ HL78XX_CTZEU_UTIME_MAX_LEN

#define HL78XX_CTZEU_UTIME_MAX_LEN   32

#include <zephyr/drivers/modem/hl78xx_apis.h>

Recommended buffer size for extracted +CTZEU universal time strings.

◆ HL78XX_EVT_MONITOR

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

#include <zephyr/drivers/modem/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:1209

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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/hl78xx_apis.h>

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

◆ HL78XX_MONITOR_ACTIVE

#define HL78XX_MONITOR_ACTIVE   false

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/hl78xx_apis.h>

Maximum length of network address string.

◆ MDM_APN_MAX_LENGTH

#define MDM_APN_MAX_LENGTH   64

#include <zephyr/drivers/modem/hl78xx_apis.h>

Maximum length of APN string.

◆ MDM_HL78XX_CME_ERROR_STRING

#define MDM_HL78XX_CME_ERROR_STRING   "+CME ERROR: "

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/hl78xx_apis.h>

Response string indicating a successful data connection has been established.

◆ MDM_HL78XX_EOF_PATTERN

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

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/hl78xx_apis.h>

Generic error response string indicating command failure.

◆ MDM_HL78XX_NO_CARRIER_STRING

#define MDM_HL78XX_NO_CARRIER_STRING   "NO CARRIER"

#include <zephyr/drivers/modem/hl78xx_apis.h>

Response string indicating the connection has been lost or terminated.

◆ MDM_HL78XX_OK_STRING

#define MDM_HL78XX_OK_STRING   "OK"

#include <zephyr/drivers/modem/hl78xx_apis.h>

Standard response string indicating successful execution of an AT command.

◆ MDM_HL78XX_TERMINATION_PATTERN

#define MDM_HL78XX_TERMINATION_PATTERN   "+++"

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/hl78xx_apis.h>

Maximum length of modem ICCID string.

◆ MDM_IMEI_LENGTH

#define MDM_IMEI_LENGTH   16

#include <zephyr/drivers/modem/hl78xx_apis.h>

Maximum length of modem IMEI string.

◆ MDM_IMSI_LENGTH

#define MDM_IMSI_LENGTH   23

#include <zephyr/drivers/modem/hl78xx_apis.h>

Maximum length of modem IMSI string.

◆ MDM_MANUFACTURER_LENGTH

#define MDM_MANUFACTURER_LENGTH   20

#include <zephyr/drivers/modem/hl78xx_apis.h>

Maximum length of modem manufacturer string.

◆ MDM_MAX_CERT_LENGTH

#define MDM_MAX_CERT_LENGTH   4096

#include <zephyr/drivers/modem/hl78xx_apis.h>

Maximum length of certificate.

◆ MDM_MAX_HOSTNAME_LEN

#define MDM_MAX_HOSTNAME_LEN   128

#include <zephyr/drivers/modem/hl78xx_apis.h>

Maximum length of hostname.

◆ MDM_MODEL_LENGTH

#define MDM_MODEL_LENGTH   32

#include <zephyr/drivers/modem/hl78xx_apis.h>

Maximum length of modem model string.

◆ MDM_REVISION_LENGTH

#define MDM_REVISION_LENGTH   64

#include <zephyr/drivers/modem/hl78xx_apis.h>

Maximum length of modem revision string.

◆ MDM_SERIAL_NUMBER_LENGTH

#define MDM_SERIAL_NUMBER_LENGTH   32

#include <zephyr/drivers/modem/hl78xx_apis.h>

Maximum length of serial number string.

◆ PAUSED

#define PAUSED   1

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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

◆ hl78xx_agnss_days

#include <zephyr/drivers/modem/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

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 <zephyr/drivers/modem/hl78xx_apis.h>

A-GNSS assistance data validity mode.

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

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 <zephyr/drivers/modem/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_MODE_NONE 

No RAT mode.

HL78XX_RAT_COUNT 

Number of valid RAT modes.

◆ hl78xx_evt_type

#include <zephyr/drivers/modem/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_CELLMEAS_UPDATE 

Cellular measurement update.

HL78XX_EVT_TYPE_COUNT 

Event type count.

◆ hl78xx_kselacq_rat

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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_restart_mode

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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_sim_slot

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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

Function Documentation

◆ hl78xx_access_tech_to_rat()

enum hl78xx_cell_rat_mode hl78xx_access_tech_to_rat ( enum cellular_access_technology access_tech)

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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_rsrp_validity()

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

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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_at_monitor_pause()

void hl78xx_at_monitor_pause ( struct hl78xx_at_monitor_entry * mon)
inlinestatic

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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_evt_monitor_pause()

void hl78xx_evt_monitor_pause ( struct hl78xx_evt_monitor_entry * mon)
inlinestatic

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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_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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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_modem_at_cmd()

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

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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_rat_to_access_tech()

enum cellular_access_technology hl78xx_rat_to_access_tech ( enum hl78xx_cell_rat_mode rat_mode)

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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_runtime_band_provider()

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

#include <zephyr/drivers/modem/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 <zephyr/drivers/modem/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 <zephyr/drivers/modem/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.