13#ifndef ZEPHYR_INCLUDE_DRIVERS_HL78XX_APIS_H_
14#define ZEPHYR_INCLUDE_DRIVERS_HL78XX_APIS_H_
37#define CSQ_RSSI_UNKNOWN (99)
39#define CSQ_RSSI_MAX (31)
41#define CESQ_RSRP_UNKNOWN (255)
43#define CESQ_RSRP_MAX (97)
45#define CESQ_RSRQ_UNKNOWN (255)
47#define CESQ_RSRQ_MAX (34)
50#define HL78XX_MODEM_AT_ERROR 1
52#define HL78XX_MODEM_AT_CME_ERROR 2
54#define HL78XX_MODEM_AT_CMS_ERROR 3
61#define CSQ_RSSI_TO_DB(v) (-113 + (2 * (v)))
67#define CESQ_RSRP_TO_DB(v) (-141 + (v))
73#define CESQ_RSRQ_TO_DB(v) (((v) == 0U) ? -21 : (-20 + ((v) / 2)))
80#define MDM_MANUFACTURER_LENGTH 20
82#define MDM_MODEL_LENGTH 32
84#define MDM_REVISION_LENGTH 64
86#define MDM_IMEI_LENGTH 16
88#define MDM_IMSI_LENGTH 23
90#define MDM_ICCID_LENGTH 22
92#define MDM_APN_MAX_LENGTH 64
94#define MDM_MAX_CERT_LENGTH 4096
96#define MDM_MAX_HOSTNAME_LEN 128
98#define MDM_SERIAL_NUMBER_LENGTH 32
100#define HL78XX_CTZEU_UTIME_MAX_LEN 32
102#define HL78XX_CEREG_TIMER_STR_LEN 9
104#define HL78XX_NETWORK_ADDRESS_MAX_LEN 46
106#define MDM_HL78XX_EOF_PATTERN "--EOF--Pattern--"
108#define MDM_HL78XX_TERMINATION_PATTERN "+++"
110#define MDM_HL78XX_CONNECT_STRING "CONNECT"
112#define MDM_HL78XX_NO_CARRIER_STRING "NO CARRIER"
114#define MDM_HL78XX_CME_ERROR_STRING "+CME ERROR: "
116#define MDM_HL78XX_CMS_ERROR_STRING "+CMS ERROR: "
118#define MDM_HL78XX_ERROR_STRING "ERROR"
120#define MDM_HL78XX_OK_STRING "OK"
128#define HL78XX_MONITOR_ACTIVE false
136#define HL78XX_MONITOR_PAUSED true
147#define HL78XX_MONITOR_INITIAL_PAUSED(...) \
148 COND_CODE_1(IS_EMPTY(__VA_ARGS__), (false), (__VA_ARGS__))
160#define HL78XX_EVT_MONITOR(name, _handler, ...) \
161 static STRUCT_SECTION_ITERABLE(hl78xx_evt_monitor_entry, name) = { \
162 .handler = _handler, \
166 .paused = HL78XX_MONITOR_INITIAL_PAUSED(__VA_ARGS__), \
170#define HL78XX_AT_MONITOR_ANY NULL
183#define HL78XX_AT_MONITOR(name, _filter, _handler, ...) \
184 static STRUCT_SECTION_ITERABLE(hl78xx_at_monitor_entry, name) = { \
186 .handler = _handler, \
190 .paused = HL78XX_MONITOR_INITIAL_PAUSED(__VA_ARGS__), \
207#define HL78XX_AT_MONITOR_DIRECT(name, _filter, _handler, ...) \
208 static STRUCT_SECTION_ITERABLE(hl78xx_at_monitor_entry, name) = { \
210 .handler = _handler, \
214 .paused = HL78XX_MONITOR_INITIAL_PAUSED(__VA_ARGS__), \
227#ifdef CONFIG_MODEM_HL78XX_12
230#ifdef CONFIG_MODEM_HL78XX_12_FW_R6
235#ifdef CONFIG_MODEM_HL78XX_AUTORAT
237 HL78XX_RAT_MODE_AUTO,
503#if defined(CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE) || defined(__DOXYGEN__)
555#ifdef CONFIG_MODEM_HL78XX_LOW_POWER_MODE
556#ifdef CONFIG_MODEM_HL78XX_POWER_DOWN
562enum power_down_event {
564 POWER_DOWN_EVENT_ENTER = 0,
566 POWER_DOWN_EVENT_EXIT,
568 POWER_DOWN_EVENT_NONE,
577enum hl78xx_power_down_response {
579 HL78XX_POWER_DOWN_RESPONSE_IMMEDIATE = 0,
581 HL78XX_POWER_DOWN_RESPONSE_RESCHEDULE,
585#ifdef CONFIG_MODEM_HL78XX_EDRX
591enum hl78xx_edrx_event {
593 HL78XX_EDRX_EVENT_IDLE_EXIT = 0,
595 HL78XX_EDRX_EVENT_IDLE_ENTER,
597 HL78XX_EDRX_EVENT_IDLE_NONE,
600#ifdef CONFIG_MODEM_HL78XX_PSM
606enum hl78xx_psmev_event {
608 HL78XX_PSM_EVENT_EXIT = 0,
610 HL78XX_PSM_EVENT_ENTER,
612 HL78XX_PSM_EVENT_NONE,
688#ifdef CONFIG_HL78XX_GNSS
690 HL78XX_GNSS_ENGINE_READY,
692 HL78XX_GNSS_EVENT_INIT,
694 HL78XX_GNSS_EVENT_START,
696 HL78XX_GNSS_EVENT_STOP,
698 HL78XX_GNSS_EVENT_POSITION,
700 HL78XX_GNSS_EVENT_START_BLOCKED,
702 HL78XX_GNSS_EVENT_SEARCH_TIMEOUT,
704 HL78XX_GNSS_EVENT_MODE_EXITED,
706#ifdef CONFIG_MODEM_HL78XX_LOW_POWER_MODE
707#ifdef CONFIG_MODEM_HL78XX_EDRX
709 HL78XX_EDRX_IDLE_UPDATE,
711#ifdef CONFIG_MODEM_HL78XX_PSM
713 HL78XX_LTE_PSMEV_UPDATE,
715#ifdef CONFIG_MODEM_HL78XX_POWER_DOWN
717 HL78XX_POWER_DOWN_UPDATE,
733#ifdef CONFIG_MODEM_HL78XX_AIRVANTAGE
739enum wdsi_indication {
741 WDSI_BOOTSTRAP_CREDENTIALS_PRESENT = 0,
743 WDSI_USER_AGREEMENT_REQUEST = 1,
745 WDSI_FIRMWARE_DOWNLOAD_REQUEST = 2,
747 WDSI_FIRMWARE_INSTALL_REQUEST = 3,
749 WDSI_AUTHENTICATION_START = 4,
751 WDSI_AUTHENTICATION_FAILED = 5,
753 WDSI_AUTHENTICATION_SUCCESS = 6,
755 WDSI_CONNECTION_DENIED = 7,
757 WDSI_DM_SESSION_CLOSED = 8,
759 WDSI_FIRMWARE_AVAILABLE = 9,
761 WDSI_FIRMWARE_DOWNLOADED = 10,
763 WDSI_FIRMWARE_DOWNLOAD_ISSUE = 11,
765 WDSI_PACKAGE_VERIFIED_CERTIFIED = 12,
767 WDSI_PACKAGE_VERIFIED_NOT_CERTIFIED = 13,
769 WDSI_FIRMWARE_UPDATE_START = 14,
771 WDSI_FIRMWARE_UPDATE_FAILED = 15,
773 WDSI_FIRMWARE_UPDATE_SUCCESS = 16,
775 WDSI_DOWNLOAD_IN_PROGRESS = 18,
777 WDSI_SESSION_STARTED = 23
781#ifdef CONFIG_HL78XX_GNSS
787enum hl78xx_gnss_event_type {
789 HL78XX_GNSSEV_INITIALISATION = 0,
791 HL78XX_GNSSEV_START = 1,
793 HL78XX_GNSSEV_STOP = 2,
795 HL78XX_GNSSEV_POSITION = 3
802enum hl78xx_event_status {
804 HL78XX_STATUS_FAILED = 0,
806 HL78XX_STATUS_SUCCESS = 1
813enum gnss_position_events {
815 GNSS_FIX_LOST_OR_UNAVAILABLE = 0,
817 GNSS_ESTIMATED_POSITION_AVAILABLE = 1,
819 GNSS_2D_POSITION_AVAILABLE = 2,
821 GNSS_3D_POSITION_AVAILABLE = 3,
823 GNSS_FIX_CHANGED_TO_INVALID = 4
843#ifdef CONFIG_MODEM_HL78XX_AIRVANTAGE
845 enum wdsi_indication wdsi_indication;
847#ifdef CONFIG_HL78XX_GNSS
849 enum hl78xx_event_status event_status;
851 enum gnss_position_events position_event;
853#ifdef CONFIG_MODEM_HL78XX_LOW_POWER_MODE
854#ifdef CONFIG_MODEM_HL78XX_PSM
856 enum hl78xx_psmev_event psm_event;
858#ifdef CONFIG_MODEM_HL78XX_EDRX
860 enum hl78xx_edrx_event edrx_event;
862#ifdef CONFIG_MODEM_HL78XX_POWER_DOWN
864 enum power_down_event power_down_event;
1012#define GNSS_AUX_DATA_CALLBACK_DEFINE(_dev, _callback) \
1013 static const STRUCT_SECTION_ITERABLE(hl78xx_gnss_aux_data_callback, \
1014 _hl78xx_gnss_aux_data_callback__##_callback) = { \
1016 .callback = _callback, \
1024#define GNSS_DT_AUX_DATA_CALLBACK_DEFINE(_node_id, _callback) \
1025 static const STRUCT_SECTION_ITERABLE(hl78xx_gnss_aux_data_callback, \
1026 _CONCAT_4(_hl78xx_gnss_aux_data_callback_, \
1027 DT_DEP_ORD(_node_id), _, _callback)) = { \
1028 .dev = DEVICE_DT_GET(_node_id), \
1029 .callback = _callback, \
1306 void *info,
size_t size);
1337 void *info,
size_t size);
1385#ifdef CONFIG_MODEM_HL78XX_AUTORAT
1400int hl78xx_api_func_set_prl(
const struct device *dev,
const struct kselacq_syntax kselacq_rats);
1557#ifdef CONFIG_MODEM_HL78XX_AUTORAT
1570 return hl78xx_api_func_set_prl(dev, prl);
1669 return (error & 0x00ff0000U) >> 16;
1681 return (error & 0xff00ffffU);
1930#ifdef CONFIG_MODEM_HL78XX_AIRVANTAGE
1940int hl78xx_start_airvantage_dm_session(
const struct device *dev);
1950int hl78xx_stop_airvantage_dm_session(
const struct device *dev);
1999#ifdef CONFIG_MODEM_HL78XX_LOW_POWER_MODE
2022int hl78xx_wakeup_modem(
const struct device *dev);
2024#ifdef CONFIG_MODEM_HL78XX_EDRX
2031int hl78xx_edrx_get_time_to_sleep(
const struct device *dev);
2035#ifdef CONFIG_HL78XX_GNSS
2063int hl78xx_enter_gnss_mode(
const struct device *dev);
2085int hl78xx_exit_gnss_mode(
const struct device *dev);
2096int hl78xx_queue_gnss_search(
const struct device *dev);
2114int hl78xx_gnss_set_search_timeout(
const struct device *dev,
uint32_t timeout_ms);
2125int hl78xx_gnss_get_latest_known_fix(
const struct device *dev);
2127#ifdef CONFIG_HL78XX_GNSS_SUPPORT_ASSISTED_MODE
2138int hl78xx_gnss_assist_data_get_status(
const struct device *dev,
2163int hl78xx_gnss_assist_data_delete(
const struct device *dev);
2168#ifdef CONFIG_MODEM_HL78XX_POWER_DOWN
2191int hl78xx_power_down_cancel(
const struct device *dev);
2210int hl78xx_power_down_respond(
const struct device *dev,
enum hl78xx_power_down_response response,
2221void hl78xx_power_down_confirm(
const struct device *dev);
Main header file for cellular modem driver API.
long atomic_t
Atomic integer variable.
Definition atomic_types.h:31
cellular_access_technology
Cellular access technologies (3GPP TS 27.007 AcT).
Definition cellular.h:37
cellular_registration_status
Cellular registration status (3GPP TS 27.007).
Definition cellular.h:113
cellular_signal_type
Cellular signal type.
Definition cellular.h:90
cellular_modem_info_type
Cellular modem info type.
Definition cellular.h:97
static void cmd(uint32_t command)
Execute a display list command by co-processor engine.
Definition ft8xx_reference_api.h:153
int(* hl78xx_api_configure_networks)(const struct device *dev, const struct hl78xx_network *networks, uint8_t size)
API function pointer for configuring networks.
Definition hl78xx_apis.h:1040
#define CESQ_RSRP_UNKNOWN
Unknown RSRP value returned by AT+CESQ command.
Definition hl78xx_apis.h:41
int hl78xx_at_monitor_register(struct hl78xx_at_monitor_entry *mon)
Register an AT monitor.
static int hl78xx_get_sinr_validity(const struct device *dev, bool *is_valid)
Check whether the current SINR meets the configured threshold.
Definition hl78xx_apis.h:1552
int hl78xx_api_func_get_sinr_validity(const struct device *dev, bool *is_valid)
Check whether the current SINR meets the configured minimum threshold.
static int hl78xx_parse_rsrq(uint8_t rsrq, int16_t *value)
Convert raw RSRQ value from the modem to dB.
Definition hl78xx_apis.h:1756
hl78xx_sim_slot
External SIM slot selection driven by the optional SIM-switch GPIO.
Definition hl78xx_apis.h:314
#define HL78XX_CEREG_TIMER_STR_LEN
Maximum length of CEREG timer string.
Definition hl78xx_apis.h:102
int hl78xx_at_monitor_unregister(struct hl78xx_at_monitor_entry *mon)
Unregister an AT monitor.
static int hl78xx_modem_at_err(int error)
Return the modem CME/CMS error code encoded in hl78xx_modem_at_send/cmd.
Definition hl78xx_apis.h:1679
#define HL78XX_NETWORK_ADDRESS_MAX_LEN
Maximum length of network address string.
Definition hl78xx_apis.h:104
static void hl78xx_at_monitor_resume(struct hl78xx_at_monitor_entry *mon)
Resume AT monitor.
Definition hl78xx_apis.h:1810
hl78xx_cell_rat_mode
Cellular radio access technologies.
Definition hl78xx_apis.h:222
static int hl78xx_restart_modem(const struct device *dev, enum hl78xx_modem_restart_mode mode)
Request a driver-managed modem restart.
Definition hl78xx_apis.h:1605
hl78xx_operator_format
Network operator format options.
Definition hl78xx_apis.h:368
#define CESQ_RSRP_TO_DB(v)
Convert CESQ RSRP value to dBm.
Definition hl78xx_apis.h:67
hl78xx_phone_functionality
Phone functionality modes.
Definition hl78xx_apis.h:299
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.
int hl78xx_modem_at_send(const struct device *dev, const char *cmd)
Send a pre-formatted AT command to the modem.
void(* hl78xx_at_monitor_release_t)(struct hl78xx_at_monitor_entry *mon)
AT monitor release function type.
Definition hl78xx_apis.h:1137
#define CESQ_RSRQ_TO_DB(v)
Convert CESQ RSRQ value to dB.
Definition hl78xx_apis.h:73
hl78xx_network_info_type
Cached network information types.
Definition hl78xx_apis.h:416
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.
Definition hl78xx_apis.h:1073
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).
hl78xx_modem_restart_mode
Driver-managed modem restart modes.
Definition hl78xx_apis.h:324
int hl78xx_evt_monitor_register(struct hl78xx_evt_monitor_entry *mon)
Register an event monitor.
static int hl78xx_get_rsrp_validity(const struct device *dev, bool *is_valid)
Check whether the current RSRP meets the configured threshold.
Definition hl78xx_apis.h:1526
#define MDM_MODEL_LENGTH
Maximum length of modem model string.
Definition hl78xx_apis.h:82
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.
Definition hl78xx_apis.h:1051
#define CSQ_RSSI_TO_DB(v)
Convert CSQ RSSI value to dBm.
Definition hl78xx_apis.h:61
void(* hl78xx_evt_monitor_release_t)(struct hl78xx_evt_monitor_entry *mon)
Event monitor release function type.
Definition hl78xx_apis.h:1199
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_get_signal)(const struct device *dev, const enum cellular_signal_type type, int16_t *value)
API for getting network signal strength.
Definition hl78xx_apis.h:1056
int(* hl78xx_api_set_phone_functionality)(const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)
API function pointer for setting phone functionality.
Definition hl78xx_apis.h:1085
#define CESQ_RSRQ_MAX
Maximum valid RSRQ code returned by AT+CESQ command.
Definition hl78xx_apis.h:47
hl78xx_agnss_mode
A-GNSS assistance data validity mode.
Definition hl78xx_apis.h:509
int hl78xx_set_wake_pin_low(const struct device *dev)
Drive the modem WAKE pin low.
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.
Definition hl78xx_apis.h:1094
int hl78xx_evt_notif_handler_set(hl78xx_evt_monitor_dispatcher_t handler)
Set the event notification handler for HL78xx modem events.
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.
Definition hl78xx_apis.h:290
hl78xx_evt_type
HL78xx event types.
Definition hl78xx_apis.h:669
static int hl78xx_parse_rsrp(uint8_t rsrp, int16_t *value)
Convert raw RSRP value from the modem to dBm.
Definition hl78xx_apis.h:1723
#define CSQ_RSSI_UNKNOWN
Unknown RSSI value returned by AT+CSQ command.
Definition hl78xx_apis.h:37
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.
Definition hl78xx_apis.h:990
void(* hl78xx_at_monitor_handler_t)(const struct hl78xx_at_notification *notif, struct hl78xx_at_monitor_entry *mon)
AT monitor handler function type.
Definition hl78xx_apis.h:1127
#define CESQ_RSRQ_UNKNOWN
Unknown RSRQ value returned by AT+CESQ command.
Definition hl78xx_apis.h:45
int hl78xx_set_active_sim(const struct device *dev, enum hl78xx_sim_slot sim_slot)
Select the active external SIM slot.
static int hl78xx_parse_rssi(uint8_t rssi, int16_t *value)
Convert raw RSSI value from the modem to dBm.
Definition hl78xx_apis.h:1695
void(* hl78xx_evt_monitor_handler_t)(struct hl78xx_evt *notif, struct hl78xx_evt_monitor_entry *mon)
Event monitor handler function type.
Definition hl78xx_apis.h:1189
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.
Definition hl78xx_apis.h:1068
int hl78xx_api_func_set_phone_functionality(const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)
Set phone functionality mode (internal implementation).
hl78xx_modem_info_type
Cellular modem info type.
Definition hl78xx_apis.h:358
static void hl78xx_at_monitor_pause(struct hl78xx_at_monitor_entry *mon)
Pause AT monitor.
Definition hl78xx_apis.h:1798
#define CSQ_RSSI_MAX
Maximum valid RSSI code returned by AT+CSQ command.
Definition hl78xx_apis.h:39
static void hl78xx_evt_monitor_resume(struct hl78xx_evt_monitor_entry *mon)
Resume monitor.
Definition hl78xx_apis.h:1786
int(* hl78xx_api_get_phone_functionality)(const struct device *dev, enum hl78xx_phone_functionality *functionality)
API for get phone functionality.
Definition hl78xx_apis.h:1090
static int hl78xx_get_rsrq_validity(const struct device *dev, bool *is_valid)
Check whether the current RSRQ meets the configured threshold.
Definition hl78xx_apis.h:1539
hl78xx_module_status
Module status codes.
Definition hl78xx_apis.h:336
int hl78xx_api_func_set_network_operator_format(const struct device *dev, enum hl78xx_operator_format format)
Set the +COPS network operator format.
static int hl78xx_modem_at_err_type(int error)
Return the modem error type encoded in hl78xx_modem_at_send/cmd return values.
Definition hl78xx_apis.h:1667
nmea_output_port
NMEA output port options.
Definition hl78xx_apis.h:484
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.
Definition hl78xx_apis.h:1491
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_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.
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_api_func_get_phone_functionality(const struct device *dev, enum hl78xx_phone_functionality *functionality)
Get phone functionality mode (internal implementation).
#define CESQ_RSRP_MAX
Maximum valid RSRP code returned by AT+CESQ command.
Definition hl78xx_apis.h:43
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_restart(const struct device *dev, enum hl78xx_modem_restart_mode mode)
Request a driver-managed modem restart.
int hl78xx_api_func_get_rsrp_validity(const struct device *dev, bool *is_valid)
Check whether the current RSRP meets the configured minimum threshold.
void(* hl78xx_evt_monitor_dispatcher_t)(struct hl78xx_evt *notif)
Event monitor dispatcher function type.
Definition hl78xx_apis.h:1179
static void hl78xx_evt_monitor_pause(struct hl78xx_evt_monitor_entry *mon)
Pause monitor.
Definition hl78xx_apis.h:1775
int hl78xx_set_wake_pin_high(const struct device *dev)
Drive the modem WAKE pin high.
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_api_func_get_signal(const struct device *dev, const enum cellular_signal_type type, int16_t *value)
Get network signal strength (internal implementation).
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.
Definition hl78xx_apis.h:1648
hl78xx_agnss_days
Number of days of predicted assistance data to download (write command) or number of days before it e...
Definition hl78xx_apis.h:522
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.
Definition hl78xx_apis.h:1511
static int hl78xx_set_phone_functionality(const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)
Set the modem phone functionality mode.
Definition hl78xx_apis.h:1589
hl78xx_kselacq_rat
Raw AT+KSELACQ PRL RAT entries.
Definition hl78xx_apis.h:251
int hl78xx_evt_monitor_unregister(struct hl78xx_evt_monitor_entry *mon)
Unregister an event monitor.
static int hl78xx_get_phone_functionality(const struct device *dev, enum hl78xx_phone_functionality *functionality)
Get the current phone functionality mode of the modem.
Definition hl78xx_apis.h:1625
enum cellular_access_technology hl78xx_rat_to_access_tech(enum hl78xx_cell_rat_mode rat_mode)
Convert HL78xx RAT mode to standard cellular API.
@ HL78XX_SIM_SLOT_2
Select SIM slot 2 (logical high).
Definition hl78xx_apis.h:318
@ HL78XX_SIM_SLOT_1
Select SIM slot 1 (logical low).
Definition hl78xx_apis.h:316
@ HL78XX_RAT_MODE_NONE
No RAT mode.
Definition hl78xx_apis.h:240
@ HL78XX_RAT_COUNT
Number of valid RAT modes.
Definition hl78xx_apis.h:242
@ HL78XX_RAT_NB1
NB-IoT radio access technology.
Definition hl78xx_apis.h:226
@ HL78XX_RAT_CAT_M1
LTE Cat-M1 radio access technology.
Definition hl78xx_apis.h:224
@ HL78XX_OPERATOR_FORMAT_SHORT_ALPHANUMERIC
Short alphanumeric operator name format (AT+COPS format 1).
Definition hl78xx_apis.h:372
@ HL78XX_OPERATOR_FORMAT_LONG_ALPHANUMERIC
Long alphanumeric operator name format (AT+COPS format 0).
Definition hl78xx_apis.h:370
@ HL78XX_OPERATOR_FORMAT_NUMERIC
Numeric operator name format / MCC-MNC (AT+COPS format 2).
Definition hl78xx_apis.h:374
@ HL78XX_SIM_POWER_OFF
SIM and modem powered off (minimum functionality).
Definition hl78xx_apis.h:301
@ HL78XX_AIRPLANE
Airplane mode, RF transmitters disabled.
Definition hl78xx_apis.h:305
@ HL78XX_FULLY_FUNCTIONAL
Full functionality, modem operational.
Definition hl78xx_apis.h:303
@ HL78XX_NETWORK_INFO_CELL_ID
Cell ID from +CEREG.
Definition hl78xx_apis.h:436
@ HL78XX_NETWORK_INFO_TAC
Tracking area code from +CEREG.
Definition hl78xx_apis.h:430
@ HL78XX_NETWORK_INFO_MCC
Mobile country code parsed from numeric operator.
Definition hl78xx_apis.h:432
@ HL78XX_NETWORK_INFO_IP_ADDRESS
PDP IP address.
Definition hl78xx_apis.h:438
@ HL78XX_NETWORK_INFO_DNS_PRIMARY
Primary DNS address.
Definition hl78xx_apis.h:440
@ HL78XX_NETWORK_INFO_SINR
Signal-to-Interference-plus-Noise Ratio from the last +KCELLMEAS URC.
Definition hl78xx_apis.h:444
@ HL78XX_NETWORK_INFO_APN
Access Point Name.
Definition hl78xx_apis.h:418
@ HL78XX_NETWORK_INFO_OPERATOR_FORMAT
Current operator format from +COPS.
Definition hl78xx_apis.h:428
@ HL78XX_NETWORK_INFO_ACTIVE_BAND
Active band number from AT+KBND?
Definition hl78xx_apis.h:442
@ HL78XX_NETWORK_INFO_NETWORK_OPERATOR_SHORT_ALPHA
Network Operator name in short alphanumeric format.
Definition hl78xx_apis.h:424
@ HL78XX_NETWORK_INFO_MNC
Mobile network code parsed from numeric operator.
Definition hl78xx_apis.h:434
@ HL78XX_NETWORK_INFO_NETWORK_OPERATOR_LONG_ALPHA
Network Operator name in long alphanumeric format.
Definition hl78xx_apis.h:422
@ HL78XX_NETWORK_INFO_NETWORK_OPERATOR_NUMERIC
Network Operator name in numeric format.
Definition hl78xx_apis.h:426
@ HL78XX_NETWORK_INFO_CURRENT_RAT
Current Radio Access Technology.
Definition hl78xx_apis.h:420
@ HL78XX_MODEM_RESTART_HARD
Restart the modem with the dedicated reset pin.
Definition hl78xx_apis.h:326
@ HL78XX_MODEM_RESTART_SOFT
Restart the modem by issuing AT+CFUN=4,1.
Definition hl78xx_apis.h:328
@ HL78XX_AGNSS_MODE_INVALID
Data is not valid (read) / Delete data (write).
Definition hl78xx_apis.h:511
@ HL78XX_AGNSS_MODE_VALID
Data is valid (read) / Download data (write).
Definition hl78xx_apis.h:513
@ HL78XX_LTE_REGISTRATION_STAT_UPDATE
LTE network registration status changed.
Definition hl78xx_apis.h:673
@ HL78XX_LTE_RAT_UPDATE
LTE Radio Access Technology changed.
Definition hl78xx_apis.h:671
@ HL78XX_LTE_AT_CMD_READY
The AT command interface is ready for application use.
Definition hl78xx_apis.h:683
@ HL78XX_EVT_TYPE_COUNT
Event type count.
Definition hl78xx_apis.h:731
@ HL78XX_LTE_FOTA_UPDATE_STATUS
FOTA update status changed.
Definition hl78xx_apis.h:679
@ HL78XX_LTE_MODEM_STARTUP
Modem startup completed.
Definition hl78xx_apis.h:677
@ HL78XX_LTE_SIM_REGISTRATION
SIM registration status changed.
Definition hl78xx_apis.h:675
@ HL78XX_LTE_DNS_READY
DNS resolution path completed and modem is ready for data transmission.
Definition hl78xx_apis.h:681
@ HL78XX_CELLMEAS_UPDATE
Cellular measurement update.
Definition hl78xx_apis.h:729
@ HL78XX_LTE_PHONE_FUNCTIONALITY_UPDATE
Phone functionality changed (+CFUN).
Definition hl78xx_apis.h:685
@ HL78XX_LTE_CTZEU_UPDATE
Extended timezone and universal time update (+CTZEU).
Definition hl78xx_apis.h:687
@ HL78XX_MODEM_INFO_CURRENT_BAUD_RATE
Current Baud Rate.
Definition hl78xx_apis.h:362
@ HL78XX_MODEM_INFO_SERIAL_NUMBER
Modem Serial Number.
Definition hl78xx_apis.h:360
@ HL78XX_MODULE_SIM_NOT_PRESENT
SIM card is not present.
Definition hl78xx_apis.h:342
@ HL78XX_MODULE_READY
Module is ready to receive commands for the TE.
Definition hl78xx_apis.h:338
@ HL78XX_MODULE_UNRECOVERABLE_ERROR
Unrecoverable error.
Definition hl78xx_apis.h:346
@ HL78XX_MODULE_INACTIVE_SIM
Inactive SIM.
Definition hl78xx_apis.h:350
@ HL78XX_MODULE_WAITING_FOR_ACCESS_CODE
Module is waiting for an access code.
Definition hl78xx_apis.h:340
@ HL78XX_MODULE_UNKNOWN_STATE
Unknown state.
Definition hl78xx_apis.h:348
@ HL78XX_MODULE_SIMLOCK
Module is in "SIMlock" state.
Definition hl78xx_apis.h:344
@ NMEA_OUTPUT_CMUX_DLC2
0x06 — NMEA frames are output on CMUX DLC2
Definition hl78xx_apis.h:496
@ NMEA_OUTPUT_CMUX_DLC4
0x08 — NMEA frames are output on CMUX DLC4
Definition hl78xx_apis.h:500
@ NMEA_OUTPUT_SAME_PORT
0x04 — NMEA frames are output on the same port the +GNSSNMEA was received on
Definition hl78xx_apis.h:492
@ NMEA_OUTPUT_NONE
0x00 — NMEA frames are not output
Definition hl78xx_apis.h:486
@ NMEA_OUTPUT_UART1
0x03 — NMEA frames are output on UART1
Definition hl78xx_apis.h:490
@ NMEA_OUTPUT_CMUX_DLC1
0x05 — NMEA frames are output on CMUX DLC1
Definition hl78xx_apis.h:494
@ NMEA_OUTPUT_USB_NMEA_PORT
0x01 — NMEA frames are output on dedicated NMEA port over USB
Definition hl78xx_apis.h:488
@ NMEA_OUTPUT_CMUX_DLC3
0x07 — NMEA frames are output on CMUX DLC3
Definition hl78xx_apis.h:498
@ HL78XX_AGNSS_DAYS_1
Request 1 day of A-GNSS assistance data.
Definition hl78xx_apis.h:524
@ HL78XX_AGNSS_DAYS_3
Request 3 days of A-GNSS assistance data.
Definition hl78xx_apis.h:528
@ HL78XX_AGNSS_DAYS_7
Request 7 days of A-GNSS assistance data.
Definition hl78xx_apis.h:530
@ HL78XX_AGNSS_DAYS_14
Request 14 days of A-GNSS assistance data.
Definition hl78xx_apis.h:532
@ HL78XX_AGNSS_DAYS_28
Request 28 days of A-GNSS assistance data.
Definition hl78xx_apis.h:534
@ HL78XX_AGNSS_DAYS_2
Request 2 days of A-GNSS assistance data.
Definition hl78xx_apis.h:526
@ HL78XX_KSELACQ_RAT_CAT_M1
PRL entry for Cat-M1.
Definition hl78xx_apis.h:255
@ HL78XX_KSELACQ_RAT_NB1
PRL entry for NB-IoT.
Definition hl78xx_apis.h:257
@ HL78XX_KSELACQ_RAT_GSM
PRL entry for GSM.
Definition hl78xx_apis.h:259
@ HL78XX_KSELACQ_RAT_CLEAR
Clear PRL and disable automatic RAT switching.
Definition hl78xx_apis.h:253
#define EINVAL
Invalid argument.
Definition errno.h:60
flags
Definition parser.h:97
#define bool
Definition stdbool.h:13
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__INT32_TYPE__ int32_t
Definition stdint.h:74
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT64_TYPE__ int64_t
Definition stdint.h:75
__INT16_TYPE__ int16_t
Definition stdint.h:73
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
A-GNSS assistance data status structure.
Definition hl78xx_apis.h:543
uint8_t days
Days remaining before expiry (1-28), valid only when mode=1.
Definition hl78xx_apis.h:547
uint8_t hours
Hours remaining before expiry (0-23), valid only when mode=1.
Definition hl78xx_apis.h:549
uint8_t minutes
Minutes remaining before expiry (0-59), valid only when mode=1.
Definition hl78xx_apis.h:551
enum hl78xx_agnss_mode mode
Validity mode: 0 = invalid/empty, 1 = valid.
Definition hl78xx_apis.h:545
AT monitor entry structure.
Definition hl78xx_apis.h:1145
const char * filter
Exact unsolicited AT match pattern to monitor, or NULL for all.
Definition hl78xx_apis.h:1147
struct hl78xx_at_monitor_entry * next
Link for runtime list.
Definition hl78xx_apis.h:1153
struct k_work release_work
Work item used to defer release out of unregister/dispatch context.
Definition hl78xx_apis.h:1157
uint8_t paused
Monitor is paused.
Definition hl78xx_apis.h:1161
const hl78xx_at_monitor_handler_t handler
Monitor callback function.
Definition hl78xx_apis.h:1149
struct hl78xx_at_monitor_entry::@123314375256277045305202074155231060013037303316 flags
Monitor flags.
atomic_t refcnt
Reference count for list membership and in-flight dispatch snapshots.
Definition hl78xx_apis.h:1155
uint8_t direct
Dispatch directly in HL78xx modem RX workqueue context.
Definition hl78xx_apis.h:1163
hl78xx_at_monitor_release_t release
Optional callback invoked when the final runtime reference is dropped.
Definition hl78xx_apis.h:1151
Parsed unsolicited AT notification payload.
Definition hl78xx_apis.h:1105
const char *const * argv
Parsed arguments, where argv[0] is the exact matched token.
Definition hl78xx_apis.h:1109
const char * pattern
Canonical unsolicited match pattern from the driver table.
Definition hl78xx_apis.h:1107
uint16_t argc
Number of parsed arguments.
Definition hl78xx_apis.h:1111
Parsed +CTZEU update payload.
Definition hl78xx_apis.h:651
int64_t date_time_ms
Parsed universal time in UTC Unix epoch milliseconds.
Definition hl78xx_apis.h:659
struct tm utc_time
Parsed universal time in broken-down UTC form.
Definition hl78xx_apis.h:661
int tz
Local timezone offset from GMT in quarter-hours, including DST adjustment.
Definition hl78xx_apis.h:653
bool has_utime
Universal time field is present in the notification.
Definition hl78xx_apis.h:657
int dst
Daylight saving indicator reported by the modem (0, 1, or 2).
Definition hl78xx_apis.h:655
Cached +CEREG/+CREG registration details.
Definition hl78xx_apis.h:380
bool has_active_time
Active time field is present.
Definition hl78xx_apis.h:404
enum cellular_registration_status reg_status
Registration status from +CEREG/+CREG.
Definition hl78xx_apis.h:382
bool has_cell_id
Parsed cell ID is present.
Definition hl78xx_apis.h:388
uint32_t cell_id
Cell ID from +CEREG/+CREG.
Definition hl78xx_apis.h:390
bool has_tac
Parsed tracking area code is present.
Definition hl78xx_apis.h:384
char tau[9]
Raw TAU timer string.
Definition hl78xx_apis.h:410
bool has_rat_mode
Parsed RAT mode is present.
Definition hl78xx_apis.h:392
int cause_type
Registration reject cause type.
Definition hl78xx_apis.h:398
char active_time[9]
Raw active time timer string.
Definition hl78xx_apis.h:406
bool has_cause_type
Cause type is present.
Definition hl78xx_apis.h:396
bool has_reject_cause
Reject cause is present.
Definition hl78xx_apis.h:400
enum hl78xx_cell_rat_mode rat_mode
RAT mode derived from +CEREG/+CREG AcT.
Definition hl78xx_apis.h:394
uint32_t tac
Tracking area code from +CEREG/+CREG.
Definition hl78xx_apis.h:386
bool has_tau
TAU field is present.
Definition hl78xx_apis.h:408
int reject_cause
Registration reject cause value.
Definition hl78xx_apis.h:402
Event monitor entry structure.
Definition hl78xx_apis.h:1206
atomic_t refcnt
Reference count for list membership and in-flight dispatch snapshots.
Definition hl78xx_apis.h:1214
uint8_t direct
Dispatch in ISR context.
Definition hl78xx_apis.h:1222
hl78xx_evt_monitor_release_t release
Optional callback invoked when the final runtime reference is dropped.
Definition hl78xx_apis.h:1210
uint8_t paused
Monitor is paused.
Definition hl78xx_apis.h:1220
struct hl78xx_evt_monitor_entry * next
Link for runtime list.
Definition hl78xx_apis.h:1212
struct k_work release_work
Work item used to defer release callback execution.
Definition hl78xx_apis.h:1216
struct hl78xx_evt_monitor_entry::@057227043005254143162172265347206127102114032147 flags
Monitor flags.
const hl78xx_evt_monitor_handler_t handler
Monitor callback function.
Definition hl78xx_apis.h:1208
HL78xx event structure.
Definition hl78xx_apis.h:833
enum hl78xx_evt_type type
Event type.
Definition hl78xx_apis.h:835
bool status
Boolean status value.
Definition hl78xx_apis.h:872
union hl78xx_evt::@245116247166211205273371261316135324040054344202 content
Event content (depends on type).
struct k_cellmeas_signal_info cellmeas
Cellular measurement event content.
Definition hl78xx_apis.h:868
struct hl78xx_ctzeu_update ctzeu
Full +CTZEU update payload.
Definition hl78xx_apis.h:870
int value
Integer value.
Definition hl78xx_apis.h:874
enum hl78xx_cell_rat_mode rat_mode
Radio access technology mode (for HL78XX_LTE_RAT_UPDATE).
Definition hl78xx_apis.h:842
enum cellular_registration_status reg_status
Network registration status (for HL78XX_LTE_REGISTRATION_STAT_UPDATE).
Definition hl78xx_apis.h:840
GNSS auxiliary data callback structure.
Definition hl78xx_apis.h:999
hl78xx_gnss_aux_data_callback_t callback
Callback called when GNSS auxiliary data is published.
Definition hl78xx_apis.h:1003
const struct device * dev
Filter callback to GNSS data from this device if not NULL.
Definition hl78xx_apis.h:1001
Container for all GNSS auxiliary NMEA data.
Definition hl78xx_apis.h:960
struct nmea_match_epu_data epu
EPU sentence data (HL78xx proprietary position/velocity error).
Definition hl78xx_apis.h:966
struct nmea_match_gsa_data gsa
GSA sentence data (DOP and fix type).
Definition hl78xx_apis.h:962
struct nmea_match_gst_data gst
GST sentence data (pseudorange error statistics).
Definition hl78xx_apis.h:964
Cached network information.
Definition hl78xx_apis.h:470
char ip_address[46]
IP address.
Definition hl78xx_apis.h:474
struct hl78xx_network_operator operator_info
Cached network operator information.
Definition hl78xx_apis.h:472
char dns_primary[46]
Primary DNS server.
Definition hl78xx_apis.h:476
Cached network operator information.
Definition hl78xx_apis.h:450
bool has_mcc
MCC is available.
Definition hl78xx_apis.h:456
bool has_mnc
MNC is available.
Definition hl78xx_apis.h:460
bool has_operator
Operator is available.
Definition hl78xx_apis.h:452
uint16_t mnc
Mobile network code.
Definition hl78xx_apis.h:462
enum hl78xx_operator_format format
Current +COPS operator format.
Definition hl78xx_apis.h:464
uint16_t mcc
Mobile country code.
Definition hl78xx_apis.h:458
char operator_name[32]
Operator name in the currently selected +COPS format.
Definition hl78xx_apis.h:454
Cellular network structure.
Definition hl78xx_apis.h:632
enum hl78xx_cell_rat_mode technology
Cellular access technology.
Definition hl78xx_apis.h:634
uint16_t * bands
List of bands to enable.
Definition hl78xx_apis.h:640
uint16_t size
Size of bands array.
Definition hl78xx_apis.h:642
Cellular measurement signal information.
Definition hl78xx_apis.h:623
int16_t rsrp
Reference Signal Received Power (RSRP) in dBm.
Definition hl78xx_apis.h:625
Kernel timeout type.
Definition clock.h:65
A structure used to submit work.
Definition kernel.h:4600
KSELACQ RAT configuration syntax.
Definition hl78xx_apis.h:265
enum hl78xx_kselacq_rat rat2
Preferred RAT in PRL position 2, expressed as raw AT+KSELACQ value.
Definition hl78xx_apis.h:271
enum hl78xx_kselacq_rat rat3
Preferred RAT in PRL position 3, expressed as raw AT+KSELACQ value.
Definition hl78xx_apis.h:273
bool mode
0 = configure PRL, 1 = reserved.
Definition hl78xx_apis.h:267
enum hl78xx_kselacq_rat rat1
Preferred RAT in PRL position 1, expressed as raw AT+KSELACQ value.
Definition hl78xx_apis.h:269
Modem chat match.
Definition chat.h:47
Parsed EPU sentence data (HL78xx proprietary position error).
Definition hl78xx_apis.h:929
int64_t vel_east
East velocity error estimate (m/s).
Definition hl78xx_apis.h:947
int64_t vel_hdg
Heading velocity error estimate (m/s).
Definition hl78xx_apis.h:945
int64_t pos_alt
Altitude position error estimate (meters).
Definition hl78xx_apis.h:939
int64_t pos_2d
2D (horizontal) position error estimate (meters)
Definition hl78xx_apis.h:933
int64_t vel_2d
2D (horizontal) velocity error estimate (m/s)
Definition hl78xx_apis.h:943
int64_t vel_north
North velocity error estimate (m/s).
Definition hl78xx_apis.h:949
int64_t pos_lon
Longitude position error estimate (meters).
Definition hl78xx_apis.h:937
int64_t vel_up
Up (vertical) velocity error estimate (m/s).
Definition hl78xx_apis.h:951
int64_t vel_3d
3D velocity error estimate (m/s)
Definition hl78xx_apis.h:941
int64_t pos_3d
3D position error estimate (meters)
Definition hl78xx_apis.h:931
int64_t pos_lat
Latitude position error estimate (meters).
Definition hl78xx_apis.h:935
Parsed GSA sentence data (GNSS DOP and Active Satellites).
Definition hl78xx_apis.h:884
int64_t vdop
Vertical Dilution of Precision (scaled).
Definition hl78xx_apis.h:892
int64_t hdop
Horizontal Dilution of Precision (scaled).
Definition hl78xx_apis.h:890
int64_t pdop
Position Dilution of Precision (scaled).
Definition hl78xx_apis.h:888
int32_t fix_type
Fix type: 1=no fix, 2=2D fix, 3=3D fix.
Definition hl78xx_apis.h:886
Parsed GST sentence data (GNSS Pseudorange Error Statistics).
Definition hl78xx_apis.h:901
int64_t lat_err
Standard deviation of latitude error (meters).
Definition hl78xx_apis.h:915
int64_t alt_err
Standard deviation of altitude error (meters).
Definition hl78xx_apis.h:919
int64_t sd_major
Standard deviation of semi-major axis of error ellipse (meters).
Definition hl78xx_apis.h:909
int64_t lon_err
Standard deviation of longitude error (meters).
Definition hl78xx_apis.h:917
int64_t rms
RMS value of standard deviation of range inputs.
Definition hl78xx_apis.h:907
int64_t orient
Orientation of semi-major axis of error ellipse (degrees from true north).
Definition hl78xx_apis.h:913
uint32_t gst_utc
UTC time of associated position fix (HHMMSS format).
Definition hl78xx_apis.h:905
int64_t sd_minor
Standard deviation of semi-minor axis of error ellipse (meters).
Definition hl78xx_apis.h:911
int32_t i32
Reserved for internal use.
Definition hl78xx_apis.h:903