|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
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. | |
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. | |
Sierra Wireless HL78xx cellular modems.
| #define ACTIVE 0 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Monitor is active, default.
| #define CESQ_RSRP_MAX (97) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum valid RSRP code returned by AT+CESQ command.
| #define CESQ_RSRP_TO_DB | ( | v | ) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Convert CESQ RSRP value to dBm.
| v | RSRP value (0-97) |
| #define CESQ_RSRP_UNKNOWN (255) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Unknown RSRP value returned by AT+CESQ command.
| #define CESQ_RSRQ_MAX (34) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum valid RSRQ code returned by AT+CESQ command.
| #define CESQ_RSRQ_TO_DB | ( | v | ) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Convert CESQ RSRQ value to dB.
| v | RSRQ value (0-34) |
| #define CESQ_RSRQ_UNKNOWN (255) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Unknown RSRQ value returned by AT+CESQ command.
| #define CSQ_RSSI_MAX (31) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum valid RSSI code returned by AT+CSQ command.
| #define CSQ_RSSI_TO_DB | ( | v | ) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Convert CSQ RSSI value to dBm.
| v | RSSI value (0-31) |
| #define CSQ_RSSI_UNKNOWN (99) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Unknown RSSI value returned by AT+CSQ command.
| #define GNSS_AUX_DATA_CALLBACK_DEFINE | ( | _dev, | |
| _callback ) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Register a callback structure for GNSS auxiliary data published.
| _dev | Device pointer |
| _callback | The callback function |
| #define GNSS_DT_AUX_DATA_CALLBACK_DEFINE | ( | _node_id, | |
| _callback ) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Register a callback structure for GNSS auxiliary data published.
| _node_id | Device tree node identifier |
| _callback | The callback function |
| #define HL78XX_AT_MONITOR | ( | name, | |
| _filter, | |||
| _handler, | |||
| ... ) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Define an AT monitor to receive parsed unsolicited AT notifications in the system workqueue thread.
| name | The monitor name. |
| _filter | Exact unsolicited AT match pattern to receive, or HL78XX_AT_MONITOR_ANY to receive all parsed notifications. |
| _handler | The monitor callback. |
| ... | Optional monitor initial state (HL78XX_MONITOR_ACTIVE or HL78XX_MONITOR_PAUSED). The default initial state of a monitor is active. |
| #define HL78XX_AT_MONITOR_ANY NULL |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Monitor any parsed unsolicited AT notification.
| #define HL78XX_AT_MONITOR_DIRECT | ( | name, | |
| _filter, | |||
| _handler, | |||
| ... ) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
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.
| name | The monitor name. |
| _filter | Exact unsolicited AT match pattern to receive, or HL78XX_AT_MONITOR_ANY to receive all parsed notifications. |
| _handler | The monitor callback. |
| ... | Optional monitor initial state (HL78XX_MONITOR_ACTIVE or HL78XX_MONITOR_PAUSED). The default initial state of a monitor is active. |
| #define HL78XX_CEREG_TIMER_STR_LEN 9 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum length of CEREG timer string.
| #define HL78XX_CTZEU_UTIME_MAX_LEN 32 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Recommended buffer size for extracted +CTZEU universal time strings.
| #define HL78XX_EVT_MONITOR | ( | name, | |
| _handler, | |||
| ... ) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Define an Event monitor to receive notifications in the system workqueue thread.
| name | The monitor name. |
| _handler | The monitor callback. |
| ... | Optional monitor initial state (HL78XX_MONITOR_ACTIVE or HL78XX_MONITOR_PAUSED). The default initial state of a monitor is active. |
| #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.
| #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.
| #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.
| #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.
| #define HL78XX_MONITOR_INITIAL_PAUSED | ( | ... | ) |
#include <zephyr/drivers/modem/hl78xx_apis.h>
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.
| ... | Optional monitor initial state, either HL78XX_MONITOR_ACTIVE or 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.
| #define HL78XX_NETWORK_ADDRESS_MAX_LEN 46 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum length of network address string.
| #define MDM_APN_MAX_LENGTH 64 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum length of APN 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.
| #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.
| #define MDM_HL78XX_CONNECT_STRING "CONNECT" |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Response string indicating a successful data connection has been established.
| #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.
| #define MDM_HL78XX_ERROR_STRING "ERROR" |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Generic error response string indicating command failure.
| #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.
| #define MDM_HL78XX_OK_STRING "OK" |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Standard response string indicating successful execution of an AT command.
| #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.
| #define MDM_ICCID_LENGTH 22 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum length of modem ICCID string.
| #define MDM_IMEI_LENGTH 16 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum length of modem IMEI string.
| #define MDM_IMSI_LENGTH 23 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum length of modem IMSI string.
| #define MDM_MANUFACTURER_LENGTH 20 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum length of modem manufacturer string.
| #define MDM_MAX_CERT_LENGTH 4096 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum length of certificate.
| #define MDM_MAX_HOSTNAME_LEN 128 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum length of hostname.
| #define MDM_MODEL_LENGTH 32 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum length of modem model string.
| #define MDM_REVISION_LENGTH 64 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum length of modem revision string.
| #define MDM_SERIAL_NUMBER_LENGTH 32 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Maximum length of serial number string.
| #define PAUSED 1 |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Monitor is paused.
| 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.
| dev | Cellular network device instance |
| networks | Array of network configurations |
| size | Number of networks in array |
| 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.
| dev | Cellular network device instance |
| type | Type of modem information |
| info | Buffer to store information string |
| size | Size of info buffer |
| 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.
| 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.
| 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.
| 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.
| dev | Cellular network device instance |
| networks | Pointer to receive network array |
| size | Pointer to receive array size |
| 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.
| 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.
| dev | Cellular network device instance |
| functionality | Phone functionality mode |
| reset | Whether to reset modem |
| 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.
| notif | Pointer to the parsed AT notification. |
| mon | Pointer to the monitor entry that received the notification. |
| 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.
| mon | Pointer to the monitor entry being released. |
| 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
| notif | Pointer to the event notification |
| 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
| notif | Pointer to the event notification |
| mon | Pointer to the monitor entry that received the event |
| 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.
| mon | Pointer to the monitor entry being released |
| 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.
| dev | Pointer to the GNSS device |
| aux_data | Pointer to auxiliary NMEA data structure |
| size | Size of the auxiliary data |
| 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.
| dev | Cellular network device instance. |
| rat | RAT currently being configured. |
| band | Output band number, written only when the callback returns true. |
| user_data | Opaque caller-owned context passed at registration time. |
rat. | enum 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
| enum 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). |
| enum 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. |
| enum hl78xx_evt_type |
#include <zephyr/drivers/modem/hl78xx_apis.h>
HL78xx event types.
Asynchronous event notifications from the HL78xx modem
| enum 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.
#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. |
#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. |
| enum hl78xx_module_status |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Module status codes.
Status codes returned by AT+CPIN? indicating SIM and module state
#include <zephyr/drivers/modem/hl78xx_apis.h>
Cached network information types.
#include <zephyr/drivers/modem/hl78xx_apis.h>
Network operator format options.
#include <zephyr/drivers/modem/hl78xx_apis.h>
Phone functionality modes.
AT+CFUN command modes for controlling modem operational state
| enum 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). |
| enum nmea_output_port |
#include <zephyr/drivers/modem/hl78xx_apis.h>
NMEA output port options.
Port selection for GNSS NMEA sentence output from the modem
| 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.
| access_tech | Standard cellular access technology. |
| 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.
| dev | Cellular network device instance |
| type | Type of the modem info to retrieve |
| info | Pointer to store the modem info |
| size | Size of the info buffer |
| 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.
| dev | Cellular network device instance |
| type | Zephyr cellular modem info type |
| info | Buffer to store the info string |
| size | Buffer size in bytes |
| 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.
| dev | Cellular network device instance |
| type | Type of the network info to retrieve |
| info | Pointer to store the network info |
| size | Size of the info buffer |
| 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.
| dev | Cellular network device instance |
| functionality | Pointer to store the current phone functionality mode |
#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.
| dev | Cellular network device instance |
| is_valid | Output flag set to true when the threshold is met |
#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.
| dev | Cellular network device instance |
| is_valid | Output flag set to true when the threshold is met |
| 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.
| dev | Cellular network device instance |
| type | Type of the signal to retrieve (RSSI, RSRP, RSRQ, etc.) |
| value | Pointer to store the signal value |
#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.
| dev | Cellular network device instance |
| is_valid | Output flag set to true when the threshold is met |
| 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.
| dev | Cellular network device instance |
| cmd | AT command to send |
| cmd_size | Size of the AT command |
| response_matches | Expected response patterns |
| matches_size | Number of response patterns |
| 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.
| dev | Cellular network device instance. |
| mode | Requested restart mode. |
| 0 | on success. |
| -EINVAL | if dev or mode is invalid. |
| -ENOTSUP | if hard restart is requested but no reset GPIO is configured. |
| -EAGAIN | if a soft restart is requested while the modem is not ready to accept AT commands. |
| -EBUSY | if another restart is already in progress. |
| 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.
| dev | Cellular network device instance |
| format | Desired operator format to set |
| 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.
| dev | Cellular network device instance |
| functionality | Phone functionality mode to set |
| reset | If true, the modem will be reset as part of applying the functionality change. |
|
inlinestatic |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Pause AT monitor.
Pause monitor mon from receiving parsed unsolicited AT notifications.
| mon | The monitor to pause. |
| 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.
| mon | Pointer to the monitor entry to register. |
mon is NULL. mon is already registered. mon still has outstanding runtime references.
|
inlinestatic |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Resume AT monitor.
Resume forwarding parsed unsolicited AT notifications to monitor mon.
| mon | The monitor to resume. |
| 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.
| mon | Pointer to the monitor entry to unregister. |
mon is NULL. mon is not registered.
|
inlinestatic |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Pause monitor.
Pause monitor mon from receiving notifications.
| mon | The monitor to pause. |
| 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.
| mon | Pointer to the monitor entry to register. |
mon is NULL. mon is already registered. mon still has outstanding runtime references.
|
inlinestatic |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Resume monitor.
Resume forwarding notifications to monitor mon.
| mon | The monitor to resume. |
| 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.
| mon | Pointer to the monitor entry to unregister. |
mon is NULL. mon is not registered. | 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.
| handler | Function pointer to the event monitor callback. Pass NULL to clear the existing handler. |
| 0 | on success. |
| -EINVAL | if the handler parameter is invalid. |
|
inlinestatic |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Get modem info for the device.
| dev | Cellular network device instance |
| type | Type of the modem info requested |
| info | Info string destination |
| size | Info string size |
| 0 | if successful. |
| -ENOTSUP | if API is not supported by cellular network device. |
| -ENODATA | if modem does not provide info requested |
| Negative | errno-code from chat module otherwise. |
|
inlinestatic |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Get cached network info for the device.
| dev | Cellular network device instance |
| type | Type of the network info requested |
| info | Info destination buffer |
| size | Size of the destination buffer |
| 0 | if successful. |
| -ENOTSUP | if the type is not supported. |
| -ENODATA | if the modem does not provide the requested info. |
| Negative | errno-code from chat module otherwise. |
|
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.
| dev | Pointer to the modem device instance. |
| functionality | Pointer to store the retrieved functionality mode. (see enum hl78xx_phone_functionality) |
| 0 | on success. |
| -EINVAL | if the input parameters are invalid. |
| -EIO | if the modem fails to respond or returns an error. |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Check whether the current RSRP meets the configured threshold.
| dev | Cellular network device instance |
| is_valid | Output flag set to true when the threshold is met |
| 0 | on success. |
| Negative | errno-code on failure. |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Check whether the current RSRQ meets the configured threshold.
| dev | Cellular network device instance |
| is_valid | Output flag set to true when the threshold is met |
| 0 | on success. |
| Negative | errno-code on failure. |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Check whether the current SINR meets the configured threshold.
| dev | Cellular network device instance |
| is_valid | Output flag set to true when the threshold is met |
| 0 | on success. |
| Negative | errno-code on failure. |
| 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.
| dev | Cellular network device instance |
| response | Output buffer for the whole modem response |
| response_size | Output buffer size |
| cmd | AT command string to send |
|
inlinestatic |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Return the modem CME/CMS error code encoded in hl78xx_modem_at_send/cmd.
| error | Return value from hl78xx_modem_at_send() or hl78xx_modem_at_cmd(). |
|
inlinestatic |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Return the modem error type encoded in hl78xx_modem_at_send/cmd return values.
| error | Return value from hl78xx_modem_at_send() or hl78xx_modem_at_cmd(). |
| HL78XX_MODEM_AT_ERROR | for ERROR responses. |
| HL78XX_MODEM_AT_CME_ERROR | for +CME ERROR responses. |
| HL78XX_MODEM_AT_CMS_ERROR | for +CMS ERROR responses. |
| 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.
| dev | Cellular network device instance |
| cmd | AT command string to send |
|
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.
| dev | Pointer to the modem device instance. |
| cmd | Pointer to the AT command string to be sent. |
| cmd_size | Length of the AT command string in bytes. |
| response_matches | Pointer to an array of expected response patterns. (see struct modem_chat_match) |
| matches_size | Number of response patterns in the array. |
| 0 | on successful command transmission and response match. |
| -EINVAL | if any parameter is invalid. |
| -ETIMEDOUT | if the modem did not respond in the expected time. |
| -EIO | on communication failure or if response did not match. |
#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.
| rsrp | Raw RSRP value (commonly in the range 0–97, or 255 if unknown). |
| value | Pointer to store the converted RSRP in dBm. |
| 0 | on successful conversion. |
| -EINVAL | if the RSRP value is out of range or represents an unknown value. |
#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.
| rsrq | Raw RSRQ value (typically 0–34, or 255 if unknown). |
| value | Pointer to store the converted RSRQ in dB. |
| 0 | on successful conversion. |
| -EINVAL | if the RSRQ value is out of valid range or indicates unknown. |
#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.
| rssi | Raw RSSI value (0–31 or 99 for not known or not detectable). |
| value | Pointer to store the converted RSSI in dBm. |
| 0 | on successful conversion. |
| -EINVAL | if the RSSI value is out of valid range or unsupported. |
| 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.
| rat_mode | HL78xx RAT mode |
|
inlinestatic |
#include <zephyr/drivers/modem/hl78xx_apis.h>
Request a driver-managed modem restart.
| dev | Pointer to the modem device instance. |
| mode | Restart mode to execute. |
| 0 | on success. |
| Negative | errno-code on failure. |
| 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.
| dev | Pointer to the modem device. |
| sim_slot | SIM slot to select. Only slot 1 and slot 2 are supported. |
dev or sim_slot is invalid.
|
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.
| dev | Pointer to the modem device instance. |
| functionality | Desired phone functionality mode to be set. (e.g., full, airplane, minimum – see enum hl78xx_phone_functionality) |
| reset | If true, the modem will be reset as part of applying the functionality change. |
| 0 | on success. |
| -EINVAL | if an invalid parameter is passed. |
| -EIO | on communication or command failure with the modem. |
| 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.
| dev | Cellular network device instance. |
| provider | Callback invoked to obtain a runtime band override. |
| user_data | Opaque context passed back to provider. |
| 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.
| dev | Pointer to the modem device. |
dev is invalid. | 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.
| dev | Pointer to the modem device. |
dev is invalid.