Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hl78xx_apis.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Netfeasa Ltd.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_DRIVERS_HL78XX_APIS_H_
14#define ZEPHYR_INCLUDE_DRIVERS_HL78XX_APIS_H_
15
16#include <zephyr/types.h>
17#include <zephyr/device.h>
18#include <zephyr/kernel.h>
19#include <errno.h>
20#include <stddef.h>
21#include <stdint.h>
22#include <time.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
36/* clang-format off */
38#define CSQ_RSSI_UNKNOWN (99)
40#define CSQ_RSSI_MAX (31)
42#define CESQ_RSRP_UNKNOWN (255)
44#define CESQ_RSRP_MAX (97)
46#define CESQ_RSRQ_UNKNOWN (255)
48#define CESQ_RSRQ_MAX (34)
49
51#define HL78XX_MODEM_AT_ERROR 1
53#define HL78XX_MODEM_AT_CME_ERROR 2
55#define HL78XX_MODEM_AT_CMS_ERROR 3
56
62#define CSQ_RSSI_TO_DB(v) (-113 + (2 * (v)))
68#define CESQ_RSRP_TO_DB(v) (-141 + (v))
74#define CESQ_RSRQ_TO_DB(v) (((v) == 0U) ? -21 : (-20 + ((v) / 2)))
75
77#define PAUSED 1
79#define ACTIVE 0
81#define MDM_MANUFACTURER_LENGTH 20
83#define MDM_MODEL_LENGTH 32
85#define MDM_REVISION_LENGTH 64
87#define MDM_IMEI_LENGTH 16
89#define MDM_IMSI_LENGTH 23
91#define MDM_ICCID_LENGTH 22
93#define MDM_APN_MAX_LENGTH 64
95#define MDM_MAX_CERT_LENGTH 4096
97#define MDM_MAX_HOSTNAME_LEN 128
99#define MDM_SERIAL_NUMBER_LENGTH 32
101#define HL78XX_CTZEU_UTIME_MAX_LEN 32
103#define HL78XX_CEREG_TIMER_STR_LEN 9
105#define HL78XX_NETWORK_ADDRESS_MAX_LEN 46
107#define MDM_HL78XX_EOF_PATTERN "--EOF--Pattern--"
109#define MDM_HL78XX_TERMINATION_PATTERN "+++"
111#define MDM_HL78XX_CONNECT_STRING "CONNECT"
113#define MDM_HL78XX_NO_CARRIER_STRING "NO CARRIER"
115#define MDM_HL78XX_CME_ERROR_STRING "+CME ERROR: "
117#define MDM_HL78XX_CMS_ERROR_STRING "+CMS ERROR: "
119#define MDM_HL78XX_ERROR_STRING "ERROR"
121#define MDM_HL78XX_OK_STRING "OK"
123#define MDM_HL78XX_DESIRED_VERSION_STRING \
124 (sizeof(CONFIG_MODEM_HL78XX_DESIRED_FW_VERSION) > 1 \
125 ? CONFIG_MODEM_HL78XX_DESIRED_FW_VERSION \
126 : "HL7812.5.7.4.0")
127
133#define HL78XX_MONITOR_ACTIVE false
134
141#define HL78XX_MONITOR_PAUSED true
142
152#define HL78XX_MONITOR_INITIAL_PAUSED(...) \
153 COND_CODE_1(IS_EMPTY(__VA_ARGS__), (false), (__VA_ARGS__))
154
155/* clang-format on */
156
165#define HL78XX_EVT_MONITOR(name, _handler, ...) \
166 static STRUCT_SECTION_ITERABLE(hl78xx_evt_monitor_entry, name) = { \
167 .handler = _handler, \
168 .next = NULL, \
169 .flags = { \
170 .direct = false, \
171 .paused = HL78XX_MONITOR_INITIAL_PAUSED(__VA_ARGS__), \
172 }}
173
175#define HL78XX_AT_MONITOR_ANY NULL
176
188#define HL78XX_AT_MONITOR(name, _filter, _handler, ...) \
189 static STRUCT_SECTION_ITERABLE(hl78xx_at_monitor_entry, name) = { \
190 .filter = _filter, \
191 .handler = _handler, \
192 .next = NULL, \
193 .flags = { \
194 .direct = false, \
195 .paused = HL78XX_MONITOR_INITIAL_PAUSED(__VA_ARGS__), \
196 }}
197
213#define HL78XX_AT_MONITOR_DIRECT(name, _filter, _handler, ...) \
214 static STRUCT_SECTION_ITERABLE(hl78xx_at_monitor_entry, name) = { \
215 .filter = _filter, \
216 .handler = _handler, \
217 .next = NULL, \
218 .flags = { \
219 .direct = true, \
220 .paused = HL78XX_MONITOR_INITIAL_PAUSED(__VA_ARGS__), \
221 }}
222
250
267
281
296typedef bool (*hl78xx_runtime_band_provider_t)(const struct device *dev,
297 enum hl78xx_cell_rat_mode rat, uint16_t *band,
298 void *user_data);
299
313
326
336
358
372
384
420
454
474
486
510
523
545
564
580
601
617
633
644
661
680
754
801
818
831
850
860
862 union {
867#if defined(CONFIG_MODEM_HL78XX_AIRVANTAGE) || defined(__DOXYGEN__)
872#endif /* CONFIG_MODEM_HL78XX_AIRVANTAGE */
873#if defined(CONFIG_HL78XX_GNSS) || defined(__DOXYGEN__)
878#endif /* CONFIG_HL78XX_GNSS */
879#if defined(CONFIG_MODEM_HL78XX_LOW_POWER_MODE) || defined(__DOXYGEN__)
880#if defined(CONFIG_MODEM_HL78XX_PSM) || defined(__DOXYGEN__)
883#endif /* CONFIG_MODEM_HL78XX_PSM */
884#if defined(CONFIG_MODEM_HL78XX_EDRX) || defined(__DOXYGEN__)
887#endif /* CONFIG_MODEM_HL78XX_EDRX */
888#if defined(CONFIG_MODEM_HL78XX_POWER_DOWN) || defined(__DOXYGEN__)
891#endif /* CONFIG_MODEM_HL78XX_POWER_DOWN */
892#endif /* CONFIG_MODEM_HL78XX_LOW_POWER_MODE */
898 bool status;
900 int value;
902};
903
920
947
979
994
1007struct modem_chat_match;
1008
1016typedef void (*hl78xx_gnss_aux_data_callback_t)(const struct device *dev,
1017 const struct hl78xx_gnss_nmea_aux_data *aux_data,
1018 uint16_t size);
1019
1031
1038#define GNSS_AUX_DATA_CALLBACK_DEFINE(_dev, _callback) \
1039 static const STRUCT_SECTION_ITERABLE(hl78xx_gnss_aux_data_callback, \
1040 _hl78xx_gnss_aux_data_callback__##_callback) = { \
1041 .dev = _dev, \
1042 .callback = _callback, \
1043 }
1044
1051#define GNSS_DT_AUX_DATA_CALLBACK_DEFINE(_node_id, _callback) \
1052 static const STRUCT_SECTION_ITERABLE(hl78xx_gnss_aux_data_callback, \
1053 _CONCAT_4(_hl78xx_gnss_aux_data_callback_, \
1054 DT_DEP_ORD(_node_id), _, _callback)) = { \
1055 .dev = DEVICE_DT_GET(_node_id), \
1056 .callback = _callback, \
1057 }
1058
1067typedef int (*hl78xx_api_configure_networks)(const struct device *dev,
1068 const struct hl78xx_network *networks, uint8_t size);
1069
1078typedef int (*hl78xx_api_get_supported_networks)(const struct device *dev,
1079 const struct hl78xx_network **networks,
1080 uint8_t *size);
1081
1083typedef int (*hl78xx_api_get_signal)(const struct device *dev, const enum cellular_signal_type type,
1084 int16_t *value);
1085
1095typedef int (*hl78xx_api_get_modem_info)(const struct device *dev,
1096 const enum cellular_modem_info_type type, char *info,
1097 size_t size);
1098
1100typedef int (*hl78xx_api_get_registration_status)(const struct device *dev,
1102 enum cellular_registration_status *status);
1103
1112typedef int (*hl78xx_api_set_phone_functionality)(const struct device *dev,
1113 enum hl78xx_phone_functionality functionality,
1114 bool reset);
1115
1117typedef int (*hl78xx_api_get_phone_functionality)(const struct device *dev,
1118 enum hl78xx_phone_functionality *functionality);
1119
1121typedef int (*hl78xx_api_send_at_cmd)(const struct device *dev, const char *cmd, uint16_t cmd_size,
1122 const struct modem_chat_match *response_matches,
1123 uint16_t matches_size);
1124
1134 const char *pattern;
1136 const char *const *argv;
1139};
1140
1145
1154typedef void (*hl78xx_at_monitor_handler_t)(const struct hl78xx_at_notification *notif,
1155 struct hl78xx_at_monitor_entry *mon);
1156
1165
1193
1198
1206typedef void (*hl78xx_evt_monitor_dispatcher_t)(struct hl78xx_evt *notif);
1207
1216typedef void (*hl78xx_evt_monitor_handler_t)(struct hl78xx_evt *notif,
1217 struct hl78xx_evt_monitor_entry *mon);
1218
1227
1252
1265 enum hl78xx_phone_functionality functionality,
1266 bool reset);
1267
1292
1304 enum hl78xx_phone_functionality *functionality);
1305
1317int hl78xx_api_func_get_signal(const struct device *dev, const enum cellular_signal_type type,
1318 int16_t *value);
1319
1333 void *info, size_t size);
1334
1348 enum cellular_modem_info_type type, char *info,
1349 size_t size);
1350
1364 void *info, size_t size);
1365
1376int hl78xx_api_func_get_rsrp_validity(const struct device *dev, bool *is_valid);
1377
1388int hl78xx_api_func_get_rsrq_validity(const struct device *dev, bool *is_valid);
1389
1400int hl78xx_api_func_get_sinr_validity(const struct device *dev, bool *is_valid);
1401
1410 enum hl78xx_operator_format format);
1411
1428int hl78xx_api_func_set_prl(const struct device *dev, const struct kselacq_syntax kselacq_rats);
1429
1441int hl78xx_api_func_get_prl(const struct device *dev, struct kselacq_syntax *kselacq_rats);
1442
1460int hl78xx_api_func_set_autorat_inhibit(const struct device *dev, bool inhibit);
1461
1475bool hl78xx_api_func_at_is_busy(const struct device *dev);
1476
1490 hl78xx_runtime_band_provider_t provider, void *user_data);
1491
1505int hl78xx_api_func_modem_dynamic_cmd_send(const struct device *dev, const char *cmd,
1506 uint16_t cmd_size,
1507 const struct modem_chat_match *response_matches,
1508 uint16_t matches_size);
1509
1522int hl78xx_modem_at_send(const struct device *dev, const char *cmd);
1523
1538int hl78xx_modem_at_cmd(const struct device *dev, char *response, size_t response_size,
1539 const char *cmd);
1540
1554static inline int hl78xx_get_modem_info(const struct device *dev,
1555 const enum hl78xx_modem_info_type type, void *info,
1556 size_t size)
1557{
1558 return hl78xx_api_func_get_modem_info(dev, type, info, size);
1559}
1560
1574static inline int hl78xx_get_network_info(const struct device *dev,
1575 enum hl78xx_network_info_type type, void *info,
1576 size_t size)
1577{
1578 return hl78xx_api_func_get_network_info(dev, type, info, size);
1579}
1580
1589static inline int hl78xx_get_rsrp_validity(const struct device *dev, bool *is_valid)
1590{
1591 return hl78xx_api_func_get_rsrp_validity(dev, is_valid);
1592}
1593
1602static inline int hl78xx_get_rsrq_validity(const struct device *dev, bool *is_valid)
1603{
1604 return hl78xx_api_func_get_rsrq_validity(dev, is_valid);
1605}
1606
1615static inline int hl78xx_get_sinr_validity(const struct device *dev, bool *is_valid)
1616{
1617 return hl78xx_api_func_get_sinr_validity(dev, is_valid);
1618}
1619
1632static inline int hl78xx_set_prl(const struct device *dev, struct kselacq_syntax prl)
1633{
1634 return hl78xx_api_func_set_prl(dev, prl);
1635}
1636
1648static inline int hl78xx_set_autorat_inhibit(const struct device *dev, bool inhibit)
1649{
1650 return hl78xx_api_func_set_autorat_inhibit(dev, inhibit);
1651}
1652
1662static inline bool hl78xx_at_is_busy(const struct device *dev)
1663{
1664 return hl78xx_api_func_at_is_busy(dev);
1665}
1666
1682static inline int hl78xx_set_phone_functionality(const struct device *dev,
1683 enum hl78xx_phone_functionality functionality,
1684 bool reset)
1685{
1686 return hl78xx_api_func_set_phone_functionality(dev, functionality, reset);
1687}
1688
1698static inline int hl78xx_restart_modem(const struct device *dev,
1699 enum hl78xx_modem_restart_mode mode)
1700{
1701 return hl78xx_api_func_restart(dev, mode);
1702}
1703
1718static inline int hl78xx_get_phone_functionality(const struct device *dev,
1719 enum hl78xx_phone_functionality *functionality)
1720{
1721 return hl78xx_api_func_get_phone_functionality(dev, functionality);
1722}
1723
1742static inline int hl78xx_modem_cmd_send(const struct device *dev, const char *cmd,
1743 uint16_t cmd_size,
1744 const struct modem_chat_match *response_matches,
1745 uint16_t matches_size)
1746{
1747
1748 return hl78xx_api_func_modem_dynamic_cmd_send(dev, cmd, cmd_size, response_matches,
1749 matches_size);
1750}
1751
1761static inline int hl78xx_modem_at_err_type(int error)
1762{
1763 return (error & 0x00ff0000U) >> 16;
1764}
1765
1773static inline int hl78xx_modem_at_err(int error)
1774{
1775 return (error & 0xff00ffffU);
1776}
1777
1790static inline int hl78xx_parse_rssi(uint8_t rssi, int16_t *value)
1791{
1792 /* AT+CSQ returns a response +CSQ: <rssi>,<ber> where:
1793 * - rssi is a integer from 0 to 31 whose values describes a signal strength
1794 * between -113 dBm for 0 and -51dbM for 31 or unknown for 99
1795 * - ber is an integer from 0 to 7 that describes the error rate, it can also
1796 * be 99 for an unknown error rate
1797 */
1798 if ((rssi == CSQ_RSSI_UNKNOWN) || (rssi > CSQ_RSSI_MAX)) {
1799 return -EINVAL;
1800 }
1801
1802 *value = (int16_t)CSQ_RSSI_TO_DB(rssi);
1803 return 0;
1804}
1805
1819static inline int hl78xx_parse_rsrp(uint8_t rsrp, int16_t *value)
1820{
1821 /* AT+CESQ returns a response
1822 * +CESQ: <rxlev>,<ber>,<rscp>,<ecn0>,<rsrq>,<rsrp> where:
1823 * rsrq is a integer from 0 to 34 whose values describes the Reference
1824 * Signal Receive Quality between -20 dB for 0 and -3 dB for 34
1825 * (0.5 dB steps), or unknown for 255
1826 * rsrp is an integer from 0 to 97 that describes the Reference Signal
1827 * Receive Power between below -140 dBm for 0 and -44 dBm for 97
1828 * (1 dBm steps), or unknown for 255. Return a conservative lower-bound
1829 * integer so threshold comparisons do not treat code 0 as valid for a
1830 * -140 dBm minimum.
1831 */
1832 if ((rsrp == CESQ_RSRP_UNKNOWN) || (rsrp > CESQ_RSRP_MAX)) {
1833 return -EINVAL;
1834 }
1835
1836 *value = (int16_t)CESQ_RSRP_TO_DB(rsrp);
1837 return 0;
1838}
1839
1853static inline int hl78xx_parse_rsrq(uint8_t rsrq, int16_t *value)
1854{
1855 /* AT+CESQ encodes RSRQ in 0.5 dB steps. Return a conservative integer dB
1856 * representative so code 0 stays below a -20 dB threshold.
1857 */
1858 if ((rsrq == CESQ_RSRQ_UNKNOWN) || (rsrq > CESQ_RSRQ_MAX)) {
1859 return -EINVAL;
1860 }
1861
1862 *value = (int16_t)CESQ_RSRQ_TO_DB(rsrq);
1863 return 0;
1864}
1865
1874{
1875 mon->flags.paused = true;
1876}
1877
1886{
1887 mon->flags.paused = false;
1888}
1889
1898{
1899 mon->flags.paused = true;
1900}
1901
1910{
1911 mon->flags.paused = false;
1912}
1913
1932
1954
1969
1988
2010
2021
2029
2042
2054
2067int hl78xx_set_wake_pin_low(const struct device *dev);
2068
2081int hl78xx_set_wake_pin_high(const struct device *dev);
2082
2099int hl78xx_set_active_sim(const struct device *dev, enum hl78xx_sim_slot sim_slot);
2100
2125int hl78xx_wakeup_modem(const struct device *dev);
2126
2136
2166int hl78xx_enter_gnss_mode(const struct device *dev);
2167
2190int hl78xx_exit_gnss_mode(const struct device *dev);
2191
2203int hl78xx_queue_gnss_search(const struct device *dev);
2204
2214int hl78xx_gnss_set_nmea_output(const struct device *dev, enum nmea_output_port port);
2215
2229int hl78xx_gnss_set_search_timeout(const struct device *dev, uint32_t timeout_ms);
2230
2239
2252
2266 struct hl78xx_agnss_status *status);
2267
2282
2295
2310int hl78xx_power_down_trigger(const struct device *dev, k_timeout_t delay);
2311
2322int hl78xx_power_down_cancel(const struct device *dev);
2323
2344 uint32_t timeout_s);
2345
2356void hl78xx_power_down_confirm(const struct device *dev);
2357
2358#ifdef __cplusplus
2359}
2360#endif
2361
2363
2364#endif /* ZEPHYR_INCLUDE_DRIVERS_HL78XX_APIS_H_ */
Main header file for cellular modem driver API.
APIs and macros for the Zephyr device model.
System error numbers.
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:39
cellular_registration_status
Cellular registration status (3GPP TS 27.007).
Definition cellular.h:117
cellular_signal_type
Cellular signal type.
Definition cellular.h:92
cellular_modem_info_type
Cellular modem info type.
Definition cellular.h:99
static void cmd(uint32_t command)
Execute a display list command by co-processor engine.
Definition ft8xx_reference_api.h:153
int hl78xx_gnss_get_latest_known_fix(const struct device *dev)
Get the latest known GNSS fix from the modem.
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:1067
#define CESQ_RSRP_UNKNOWN
Unknown RSRP value returned by AT+CESQ command.
Definition hl78xx_apis.h:42
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:1615
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:1853
hl78xx_sim_slot
External SIM slot selection driven by the optional SIM-switch GPIO.
Definition hl78xx_apis.h:320
#define HL78XX_CEREG_TIMER_STR_LEN
Maximum length of CEREG timer string.
Definition hl78xx_apis.h:103
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:1773
int hl78xx_api_func_set_autorat_inhibit(const struct device *dev, bool inhibit)
Inhibit the boot-time Auto-RAT PRL restore.
#define HL78XX_NETWORK_ADDRESS_MAX_LEN
Maximum length of network address string.
Definition hl78xx_apis.h:105
int hl78xx_gnss_get_search_timeout_remaining(const struct device *dev, uint32_t *timeout_ms)
Get the remaining GNSS search timeout.
int hl78xx_power_down_respond(const struct device *dev, enum hl78xx_power_down_response response, uint32_t timeout_s)
Respond to a pending HL78XX power-down update.
static void hl78xx_at_monitor_resume(struct hl78xx_at_monitor_entry *mon)
Resume AT monitor.
Definition hl78xx_apis.h:1909
hl78xx_cell_rat_mode
Cellular radio access technologies.
Definition hl78xx_apis.h:228
gnss_position_events
GNSS position events (eventType = 3).
Definition hl78xx_apis.h:838
void hl78xx_power_down_confirm(const struct device *dev)
Confirm that application cleanup is complete and the modem may proceed with physical shutdown.
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:1698
hl78xx_operator_format
Network operator format options.
Definition hl78xx_apis.h:376
#define CESQ_RSRP_TO_DB(v)
Convert CESQ RSRP value to dBm.
Definition hl78xx_apis.h:68
hl78xx_phone_functionality
Phone functionality modes.
Definition hl78xx_apis.h:305
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_edrx_get_time_to_sleep(const struct device *dev)
Get the remaining time for the modem to go in eDRX idle state.
int hl78xx_gnss_assist_data_delete(const struct device *dev)
Delete A-GNSS assistance data.
int hl78xx_modem_at_send(const struct device *dev, const char *cmd)
Send a pre-formatted AT command to the modem.
int hl78xx_gnss_assist_data_get_status(const struct device *dev, struct hl78xx_agnss_status *status)
Get A-GNSS assistance data status.
int hl78xx_exit_gnss_mode(const struct device *dev)
Exit GNSS mode and return to LTE mode.
int hl78xx_queue_gnss_search(const struct device *dev)
Queue a GNSS position search.
int hl78xx_api_func_get_prl(const struct device *dev, struct kselacq_syntax *kselacq_rats)
Get the current Preferred RAT List.
hl78xx_power_down_response
Application responses to a pending power-down request.
Definition hl78xx_apis.h:589
void(* hl78xx_at_monitor_release_t)(struct hl78xx_at_monitor_entry *mon)
AT monitor release function type.
Definition hl78xx_apis.h:1164
#define CESQ_RSRQ_TO_DB(v)
Convert CESQ RSRQ value to dB.
Definition hl78xx_apis.h:74
wdsi_indication
Device Services Indications (+WDSI).
Definition hl78xx_apis.h:761
hl78xx_network_info_type
Cached network information types.
Definition hl78xx_apis.h:424
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:1100
int hl78xx_gnss_set_nmea_output(const struct device *dev, enum nmea_output_port port)
Set NMEA output port for GNSS.
hl78xx_edrx_event
eDRX event types
Definition hl78xx_apis.h:609
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:330
power_down_event
Power down event types.
Definition hl78xx_apis.h:572
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:1589
#define MDM_MODEL_LENGTH
Maximum length of modem model string.
Definition hl78xx_apis.h:83
bool hl78xx_api_func_at_is_busy(const struct device *dev)
Report whether a modem chat script is currently executing.
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:1078
#define CSQ_RSSI_TO_DB(v)
Convert CSQ RSSI value to dBm.
Definition hl78xx_apis.h:62
void(* hl78xx_evt_monitor_release_t)(struct hl78xx_evt_monitor_entry *mon)
Event monitor release function type.
Definition hl78xx_apis.h:1226
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:1083
int hl78xx_wakeup_modem(const struct device *dev)
Wake the modem from PSM sleep.
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:1112
#define CESQ_RSRQ_MAX
Maximum valid RSRQ code returned by AT+CESQ command.
Definition hl78xx_apis.h:48
hl78xx_agnss_mode
A-GNSS assistance data validity mode.
Definition hl78xx_apis.h:517
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:1121
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:296
hl78xx_evt_type
HL78xx event types.
Definition hl78xx_apis.h:686
static int hl78xx_parse_rsrp(uint8_t rsrp, int16_t *value)
Convert raw RSRP value from the modem to dBm.
Definition hl78xx_apis.h:1819
#define CSQ_RSSI_UNKNOWN
Unknown RSSI value returned by AT+CSQ command.
Definition hl78xx_apis.h:38
int hl78xx_stop_airvantage_dm_session(const struct device *dev)
Stop an AirVantage Device Management (DM) session.
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:1016
hl78xx_gnss_event_type
GNSS event type.
Definition hl78xx_apis.h:808
int hl78xx_power_down_cancel(const struct device *dev)
Cancel a pending stage-1 HL78xx shutdown timer.
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:1154
#define CESQ_RSRQ_UNKNOWN
Unknown RSRQ value returned by AT+CESQ command.
Definition hl78xx_apis.h:46
hl78xx_event_status
GNSS event status.
Definition hl78xx_apis.h:825
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:1790
int hl78xx_enter_gnss_mode(const struct device *dev)
Enter GNSS mode.
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:1216
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:1095
int hl78xx_api_func_set_phone_functionality(const struct device *dev, enum hl78xx_phone_functionality functionality, bool reset)
Set phone functionality mode (internal implementation).
static int hl78xx_set_autorat_inhibit(const struct device *dev, bool inhibit)
Inhibit or allow the boot-time Auto-RAT PRL restore.
Definition hl78xx_apis.h:1648
hl78xx_modem_info_type
Cellular modem info type.
Definition hl78xx_apis.h:364
static void hl78xx_at_monitor_pause(struct hl78xx_at_monitor_entry *mon)
Pause AT monitor.
Definition hl78xx_apis.h:1897
#define CSQ_RSSI_MAX
Maximum valid RSSI code returned by AT+CSQ command.
Definition hl78xx_apis.h:40
static void hl78xx_evt_monitor_resume(struct hl78xx_evt_monitor_entry *mon)
Resume monitor.
Definition hl78xx_apis.h:1885
int(* hl78xx_api_get_phone_functionality)(const struct device *dev, enum hl78xx_phone_functionality *functionality)
API for get phone functionality.
Definition hl78xx_apis.h:1117
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:1602
hl78xx_module_status
Module status codes.
Definition hl78xx_apis.h:342
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:1761
nmea_output_port
NMEA output port options.
Definition hl78xx_apis.h:492
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:1554
int hl78xx_gnss_assist_data_download(const struct device *dev, enum hl78xx_agnss_days days)
Download A-GNSS assistance data.
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.
int hl78xx_power_down_trigger(const struct device *dev, k_timeout_t delay)
Trigger the HL78xx shutdown process after a caller-supplied delay.
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:44
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.
static bool hl78xx_at_is_busy(const struct device *dev)
Report whether a modem chat script is currently executing.
Definition hl78xx_apis.h:1662
int hl78xx_api_func_restart(const struct device *dev, enum hl78xx_modem_restart_mode mode)
Request a driver-managed modem restart.
static int hl78xx_set_prl(const struct device *dev, struct kselacq_syntax prl)
Set a new raw AT+KSELACQ Preferred RAT List.
Definition hl78xx_apis.h:1632
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:1206
static void hl78xx_evt_monitor_pause(struct hl78xx_evt_monitor_entry *mon)
Pause monitor.
Definition hl78xx_apis.h:1873
int hl78xx_gnss_set_search_timeout(const struct device *dev, uint32_t timeout_ms)
Set GNSS search timeout.
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:1742
hl78xx_psmev_event
PSM event types.
Definition hl78xx_apis.h:625
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:531
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:1574
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:1682
hl78xx_kselacq_rat
Raw AT+KSELACQ PRL RAT entries.
Definition hl78xx_apis.h:257
int hl78xx_start_airvantage_dm_session(const struct device *dev)
Start an AirVantage Device Management (DM) session.
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:1718
enum cellular_access_technology hl78xx_rat_to_access_tech(enum hl78xx_cell_rat_mode rat_mode)
Convert HL78xx RAT mode to standard cellular API.
int hl78xx_api_func_set_prl(const struct device *dev, const struct kselacq_syntax kselacq_rats)
Set a new Preferred RAT List through AT+KSELACQ.
@ HL78XX_SIM_SLOT_2
Select SIM slot 2 (logical high).
Definition hl78xx_apis.h:324
@ HL78XX_SIM_SLOT_1
Select SIM slot 1 (logical low).
Definition hl78xx_apis.h:322
@ HL78XX_RAT_NBNTN
NB-IoT Non-Terrestrial Network (HL7812 FW R6+).
Definition hl78xx_apis.h:240
@ HL78XX_RAT_MODE_NONE
No RAT mode.
Definition hl78xx_apis.h:246
@ HL78XX_RAT_GSM
GSM radio access technology (HL7812 only).
Definition hl78xx_apis.h:236
@ HL78XX_RAT_COUNT
Number of valid RAT modes.
Definition hl78xx_apis.h:248
@ HL78XX_RAT_NB1
NB-IoT radio access technology.
Definition hl78xx_apis.h:232
@ HL78XX_RAT_CAT_M1
LTE Cat-M1 radio access technology.
Definition hl78xx_apis.h:230
@ HL78XX_RAT_MODE_AUTO
Automatic RAT selection mode.
Definition hl78xx_apis.h:244
@ GNSS_2D_POSITION_AVAILABLE
2 — A 2-dimensional GNSS position is available
Definition hl78xx_apis.h:844
@ GNSS_ESTIMATED_POSITION_AVAILABLE
1 — An estimated GNSS (predicted) position is available
Definition hl78xx_apis.h:842
@ GNSS_FIX_LOST_OR_UNAVAILABLE
0 — The GNSS fix is lost or not available yet
Definition hl78xx_apis.h:840
@ GNSS_FIX_CHANGED_TO_INVALID
4 — GNSS fix has been changed to invalid position
Definition hl78xx_apis.h:848
@ GNSS_3D_POSITION_AVAILABLE
3 — A 3-dimensional position is available
Definition hl78xx_apis.h:846
@ HL78XX_OPERATOR_FORMAT_SHORT_ALPHANUMERIC
Short alphanumeric operator name format (AT+COPS format 1).
Definition hl78xx_apis.h:380
@ HL78XX_OPERATOR_FORMAT_LONG_ALPHANUMERIC
Long alphanumeric operator name format (AT+COPS format 0).
Definition hl78xx_apis.h:378
@ HL78XX_OPERATOR_FORMAT_NUMERIC
Numeric operator name format / MCC-MNC (AT+COPS format 2).
Definition hl78xx_apis.h:382
@ HL78XX_SIM_POWER_OFF
SIM and modem powered off (minimum functionality).
Definition hl78xx_apis.h:307
@ HL78XX_AIRPLANE
Airplane mode, RF transmitters disabled.
Definition hl78xx_apis.h:311
@ HL78XX_FULLY_FUNCTIONAL
Full functionality, modem operational.
Definition hl78xx_apis.h:309
@ HL78XX_POWER_DOWN_RESPONSE_ABORT
Abort the pending shutdown entirely: the application still owns the modem (an active search,...
Definition hl78xx_apis.h:599
@ HL78XX_POWER_DOWN_RESPONSE_RESCHEDULE
Extend the shutdown grace period from now by a caller-supplied timeout.
Definition hl78xx_apis.h:593
@ HL78XX_POWER_DOWN_RESPONSE_IMMEDIATE
Proceed with shutdown as soon as the driver workqueue can run it.
Definition hl78xx_apis.h:591
@ WDSI_FIRMWARE_DOWNLOAD_ISSUE
Firmware download issue, reason indicated by subcode.
Definition hl78xx_apis.h:785
@ WDSI_FIRMWARE_INSTALL_REQUEST
AirVantage requests device to install firmware package.
Definition hl78xx_apis.h:769
@ WDSI_FIRMWARE_UPDATE_FAILED
Firmware update failed.
Definition hl78xx_apis.h:793
@ WDSI_AUTHENTICATION_START
Starting authentication with Bootstrap or DM Server.
Definition hl78xx_apis.h:771
@ WDSI_FIRMWARE_UPDATE_SUCCESS
Firmware updated successfully.
Definition hl78xx_apis.h:795
@ WDSI_DM_SESSION_CLOSED
DM session closed.
Definition hl78xx_apis.h:779
@ WDSI_DOWNLOAD_IN_PROGRESS
Download in progress, percentage indicated.
Definition hl78xx_apis.h:797
@ WDSI_USER_AGREEMENT_REQUEST
Device requests user agreement to connect to AirVantage.
Definition hl78xx_apis.h:765
@ WDSI_BOOTSTRAP_CREDENTIALS_PRESENT
Raised at startup if credentials for Bootstrap Server are present.
Definition hl78xx_apis.h:763
@ WDSI_PACKAGE_VERIFIED_NOT_CERTIFIED
Package verified but not certified.
Definition hl78xx_apis.h:789
@ WDSI_AUTHENTICATION_SUCCESS
Authentication succeeded, starting session.
Definition hl78xx_apis.h:775
@ WDSI_FIRMWARE_UPDATE_START
Starting firmware update.
Definition hl78xx_apis.h:791
@ WDSI_AUTHENTICATION_FAILED
Authentication failed.
Definition hl78xx_apis.h:773
@ WDSI_SESSION_STARTED
Session started with Bootstrap server (+WDSI: 23,0) or DM server (+WDSI: 23,1).
Definition hl78xx_apis.h:799
@ WDSI_FIRMWARE_DOWNLOAD_REQUEST
AirVantage requests device to download firmware package.
Definition hl78xx_apis.h:767
@ WDSI_FIRMWARE_DOWNLOADED
Firmware package downloaded and stored.
Definition hl78xx_apis.h:783
@ WDSI_PACKAGE_VERIFIED_CERTIFIED
Package verified and certified.
Definition hl78xx_apis.h:787
@ WDSI_FIRMWARE_AVAILABLE
Firmware package available for download.
Definition hl78xx_apis.h:781
@ WDSI_CONNECTION_DENIED
Connection denied by server.
Definition hl78xx_apis.h:777
@ HL78XX_NETWORK_INFO_CELL_ID
Cell ID from +CEREG.
Definition hl78xx_apis.h:444
@ HL78XX_NETWORK_INFO_TAC
Tracking area code from +CEREG.
Definition hl78xx_apis.h:438
@ HL78XX_NETWORK_INFO_MCC
Mobile country code parsed from numeric operator.
Definition hl78xx_apis.h:440
@ HL78XX_NETWORK_INFO_IP_ADDRESS
PDP IP address.
Definition hl78xx_apis.h:446
@ HL78XX_NETWORK_INFO_DNS_PRIMARY
Primary DNS address.
Definition hl78xx_apis.h:448
@ HL78XX_NETWORK_INFO_SINR
Signal-to-Interference-plus-Noise Ratio from the last +KCELLMEAS URC.
Definition hl78xx_apis.h:452
@ HL78XX_NETWORK_INFO_APN
Access Point Name.
Definition hl78xx_apis.h:426
@ HL78XX_NETWORK_INFO_OPERATOR_FORMAT
Current operator format from +COPS.
Definition hl78xx_apis.h:436
@ HL78XX_NETWORK_INFO_ACTIVE_BAND
Active band number from AT+KBND?
Definition hl78xx_apis.h:450
@ HL78XX_NETWORK_INFO_NETWORK_OPERATOR_SHORT_ALPHA
Network Operator name in short alphanumeric format.
Definition hl78xx_apis.h:432
@ HL78XX_NETWORK_INFO_MNC
Mobile network code parsed from numeric operator.
Definition hl78xx_apis.h:442
@ HL78XX_NETWORK_INFO_NETWORK_OPERATOR_LONG_ALPHA
Network Operator name in long alphanumeric format.
Definition hl78xx_apis.h:430
@ HL78XX_NETWORK_INFO_NETWORK_OPERATOR_NUMERIC
Network Operator name in numeric format.
Definition hl78xx_apis.h:434
@ HL78XX_NETWORK_INFO_CURRENT_RAT
Current Radio Access Technology.
Definition hl78xx_apis.h:428
@ HL78XX_EDRX_EVENT_IDLE_EXIT
Modem exited eDRX idle mode.
Definition hl78xx_apis.h:611
@ HL78XX_EDRX_EVENT_IDLE_ENTER
Modem entered eDRX idle mode.
Definition hl78xx_apis.h:613
@ HL78XX_EDRX_EVENT_IDLE_NONE
No eDRX event.
Definition hl78xx_apis.h:615
@ HL78XX_MODEM_RESTART_HARD
Restart the modem with the dedicated reset pin.
Definition hl78xx_apis.h:332
@ HL78XX_MODEM_RESTART_SOFT
Restart the modem by issuing AT+CFUN=4,1.
Definition hl78xx_apis.h:334
@ POWER_DOWN_EVENT_NONE
No power down event.
Definition hl78xx_apis.h:578
@ POWER_DOWN_EVENT_EXIT
Power down event: Modem is exiting power down mode.
Definition hl78xx_apis.h:576
@ POWER_DOWN_EVENT_ENTER
Power down event: Modem is entering power down mode.
Definition hl78xx_apis.h:574
@ HL78XX_AGNSS_MODE_INVALID
Data is not valid (read) / Delete data (write).
Definition hl78xx_apis.h:519
@ HL78XX_AGNSS_MODE_VALID
Data is valid (read) / Download data (write).
Definition hl78xx_apis.h:521
@ HL78XX_GNSS_EVENT_INIT
GNSS engine initialization event.
Definition hl78xx_apis.h:708
@ HL78XX_LTE_PSMEV_UPDATE
Modem PSM event update.
Definition hl78xx_apis.h:732
@ HL78XX_LTE_REGISTRATION_STAT_UPDATE
LTE network registration status changed.
Definition hl78xx_apis.h:690
@ HL78XX_GPIO6_HIGH
GPIO6 pin went HIGH indicating wake from sleep or power-down.
Definition hl78xx_apis.h:748
@ HL78XX_LTE_RAT_UPDATE
LTE Radio Access Technology changed.
Definition hl78xx_apis.h:688
@ HL78XX_LTE_AT_CMD_READY
The AT command interface is ready for application use.
Definition hl78xx_apis.h:700
@ HL78XX_GNSS_EVENT_START_BLOCKED
GNSS start failed because LTE is active (shared RF path).
Definition hl78xx_apis.h:718
@ HL78XX_EVT_TYPE_COUNT
Event type count.
Definition hl78xx_apis.h:752
@ HL78XX_LTE_FOTA_UPDATE_STATUS
FOTA update status changed.
Definition hl78xx_apis.h:696
@ HL78XX_EDRX_IDLE_UPDATE
eDRX idle mode entered
Definition hl78xx_apis.h:728
@ HL78XX_GNSS_EVENT_START
GNSS search started.
Definition hl78xx_apis.h:710
@ HL78XX_GNSS_ENGINE_READY
GNSS engine initialized and ready.
Definition hl78xx_apis.h:706
@ HL78XX_VGPIO_HIGH
VGPIO pin went HIGH.
Definition hl78xx_apis.h:740
@ HL78XX_LTE_MODEM_STARTUP
Modem startup completed.
Definition hl78xx_apis.h:694
@ HL78XX_VGPIO_LOW
VGPIO pin went LOW.
Definition hl78xx_apis.h:738
@ HL78XX_LTE_SIM_REGISTRATION
SIM registration status changed.
Definition hl78xx_apis.h:692
@ HL78XX_LTE_DNS_READY
DNS resolution path completed and modem is ready for data transmission.
Definition hl78xx_apis.h:698
@ HL78XX_CELLMEAS_UPDATE
Cellular measurement update.
Definition hl78xx_apis.h:750
@ HL78XX_LTE_PHONE_FUNCTIONALITY_UPDATE
Phone functionality changed (+CFUN).
Definition hl78xx_apis.h:702
@ HL78XX_GNSS_EVENT_MODE_EXITED
GNSS mode exited - modem is now in airplane mode, user can decide next step.
Definition hl78xx_apis.h:724
@ HL78XX_GNSS_EVENT_SEARCH_TIMEOUT
GNSS search timeout expired.
Definition hl78xx_apis.h:720
@ HL78XX_GPIO6_LOW
GPIO6 pin went LOW indicating sleep or power-down entry.
Definition hl78xx_apis.h:744
@ HL78XX_LTE_CTZEU_UPDATE
Extended timezone and universal time update (+CTZEU).
Definition hl78xx_apis.h:704
@ HL78XX_GNSS_EVENT_STOP
GNSS search stopped.
Definition hl78xx_apis.h:712
@ HL78XX_GNSS_EVENT_POSITION
GNSS position fix obtained.
Definition hl78xx_apis.h:714
@ HL78XX_POWER_DOWN_UPDATE
Modem power-down event update.
Definition hl78xx_apis.h:736
@ HL78XX_GNSSEV_POSITION
GNSS position fix event.
Definition hl78xx_apis.h:816
@ HL78XX_GNSSEV_STOP
GNSS search stop event.
Definition hl78xx_apis.h:814
@ HL78XX_GNSSEV_START
GNSS search start event.
Definition hl78xx_apis.h:812
@ HL78XX_GNSSEV_INITIALISATION
GNSS engine initialization event.
Definition hl78xx_apis.h:810
@ HL78XX_STATUS_SUCCESS
Operation succeeded.
Definition hl78xx_apis.h:829
@ HL78XX_STATUS_FAILED
Operation failed.
Definition hl78xx_apis.h:827
@ HL78XX_MODEM_INFO_CURRENT_BAUD_RATE
Current Baud Rate.
Definition hl78xx_apis.h:368
@ HL78XX_MODEM_INFO_SERIAL_NUMBER
Modem Serial Number.
Definition hl78xx_apis.h:366
@ HL78XX_MODEM_INFO_FW_VERSION
Firmware version.
Definition hl78xx_apis.h:370
@ HL78XX_MODULE_SIM_NOT_PRESENT
SIM card is not present.
Definition hl78xx_apis.h:348
@ HL78XX_MODULE_READY
Module is ready to receive commands for the TE.
Definition hl78xx_apis.h:344
@ HL78XX_MODULE_UNRECOVERABLE_ERROR
Unrecoverable error.
Definition hl78xx_apis.h:352
@ HL78XX_MODULE_INACTIVE_SIM
Inactive SIM.
Definition hl78xx_apis.h:356
@ HL78XX_MODULE_WAITING_FOR_ACCESS_CODE
Module is waiting for an access code.
Definition hl78xx_apis.h:346
@ HL78XX_MODULE_UNKNOWN_STATE
Unknown state.
Definition hl78xx_apis.h:354
@ HL78XX_MODULE_SIMLOCK
Module is in "SIMlock" state.
Definition hl78xx_apis.h:350
@ NMEA_OUTPUT_CMUX_DLC2
0x06 — NMEA frames are output on CMUX DLC2
Definition hl78xx_apis.h:504
@ NMEA_OUTPUT_CMUX_DLC4
0x08 — NMEA frames are output on CMUX DLC4
Definition hl78xx_apis.h:508
@ NMEA_OUTPUT_SAME_PORT
0x04 — NMEA frames are output on the same port the +GNSSNMEA was received on
Definition hl78xx_apis.h:500
@ NMEA_OUTPUT_NONE
0x00 — NMEA frames are not output
Definition hl78xx_apis.h:494
@ NMEA_OUTPUT_UART1
0x03 — NMEA frames are output on UART1
Definition hl78xx_apis.h:498
@ NMEA_OUTPUT_CMUX_DLC1
0x05 — NMEA frames are output on CMUX DLC1
Definition hl78xx_apis.h:502
@ NMEA_OUTPUT_USB_NMEA_PORT
0x01 — NMEA frames are output on dedicated NMEA port over USB
Definition hl78xx_apis.h:496
@ NMEA_OUTPUT_CMUX_DLC3
0x07 — NMEA frames are output on CMUX DLC3
Definition hl78xx_apis.h:506
@ HL78XX_PSM_EVENT_EXIT
Modem exited PSM mode.
Definition hl78xx_apis.h:627
@ HL78XX_PSM_EVENT_ENTER
Modem entered PSM mode.
Definition hl78xx_apis.h:629
@ HL78XX_PSM_EVENT_NONE
No PSM event.
Definition hl78xx_apis.h:631
@ HL78XX_AGNSS_DAYS_1
Request 1 day of A-GNSS assistance data.
Definition hl78xx_apis.h:533
@ HL78XX_AGNSS_DAYS_3
Request 3 days of A-GNSS assistance data.
Definition hl78xx_apis.h:537
@ HL78XX_AGNSS_DAYS_7
Request 7 days of A-GNSS assistance data.
Definition hl78xx_apis.h:539
@ HL78XX_AGNSS_DAYS_14
Request 14 days of A-GNSS assistance data.
Definition hl78xx_apis.h:541
@ HL78XX_AGNSS_DAYS_28
Request 28 days of A-GNSS assistance data.
Definition hl78xx_apis.h:543
@ HL78XX_AGNSS_DAYS_2
Request 2 days of A-GNSS assistance data.
Definition hl78xx_apis.h:535
@ HL78XX_KSELACQ_RAT_CAT_M1
PRL entry for Cat-M1.
Definition hl78xx_apis.h:261
@ HL78XX_KSELACQ_RAT_NB1
PRL entry for NB-IoT.
Definition hl78xx_apis.h:263
@ HL78XX_KSELACQ_RAT_GSM
PRL entry for GSM.
Definition hl78xx_apis.h:265
@ HL78XX_KSELACQ_RAT_CLEAR
Clear PRL and disable automatic RAT switching.
Definition hl78xx_apis.h:259
#define EINVAL
Invalid argument.
Definition errno.h:61
Public kernel APIs.
flags
Definition parser.h:86
#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:543
A-GNSS assistance data status structure.
Definition hl78xx_apis.h:554
uint8_t days
Days remaining before expiry (1-28), valid only when mode=1.
Definition hl78xx_apis.h:558
uint8_t hours
Hours remaining before expiry (0-23), valid only when mode=1.
Definition hl78xx_apis.h:560
uint8_t minutes
Minutes remaining before expiry (0-59), valid only when mode=1.
Definition hl78xx_apis.h:562
enum hl78xx_agnss_mode mode
Validity mode: 0 = invalid/empty, 1 = valid.
Definition hl78xx_apis.h:556
AT monitor entry structure.
Definition hl78xx_apis.h:1172
const char * filter
Exact unsolicited AT match pattern to monitor, or NULL for all.
Definition hl78xx_apis.h:1174
struct hl78xx_at_monitor_entry * next
Link for runtime list.
Definition hl78xx_apis.h:1180
struct hl78xx_at_monitor_entry::@103016176163313070061134333340245207227156107011 flags
Monitor flags.
struct k_work release_work
Work item used to defer release out of unregister/dispatch context.
Definition hl78xx_apis.h:1184
uint8_t paused
Monitor is paused.
Definition hl78xx_apis.h:1188
const hl78xx_at_monitor_handler_t handler
Monitor callback function.
Definition hl78xx_apis.h:1176
atomic_t refcnt
Reference count for list membership and in-flight dispatch snapshots.
Definition hl78xx_apis.h:1182
uint8_t direct
Dispatch directly in HL78xx modem RX workqueue context.
Definition hl78xx_apis.h:1190
hl78xx_at_monitor_release_t release
Optional callback invoked when the final runtime reference is dropped.
Definition hl78xx_apis.h:1178
Parsed unsolicited AT notification payload.
Definition hl78xx_apis.h:1132
const char *const * argv
Parsed arguments, where argv[0] is the exact matched token.
Definition hl78xx_apis.h:1136
const char * pattern
Canonical unsolicited match pattern from the driver table.
Definition hl78xx_apis.h:1134
uint16_t argc
Number of parsed arguments.
Definition hl78xx_apis.h:1138
Parsed +CTZEU update payload.
Definition hl78xx_apis.h:668
int64_t date_time_ms
Parsed universal time in UTC Unix epoch milliseconds.
Definition hl78xx_apis.h:676
struct tm utc_time
Parsed universal time in broken-down UTC form.
Definition hl78xx_apis.h:678
int tz
Local timezone offset from GMT in quarter-hours, including DST adjustment.
Definition hl78xx_apis.h:670
bool has_utime
Universal time field is present in the notification.
Definition hl78xx_apis.h:674
int dst
Daylight saving indicator reported by the modem (0, 1, or 2).
Definition hl78xx_apis.h:672
Cached +CEREG/+CREG registration details.
Definition hl78xx_apis.h:388
bool has_active_time
Active time field is present.
Definition hl78xx_apis.h:412
enum cellular_registration_status reg_status
Registration status from +CEREG/+CREG.
Definition hl78xx_apis.h:390
bool has_cell_id
Parsed cell ID is present.
Definition hl78xx_apis.h:396
uint32_t cell_id
Cell ID from +CEREG/+CREG.
Definition hl78xx_apis.h:398
bool has_tac
Parsed tracking area code is present.
Definition hl78xx_apis.h:392
char tau[9]
Raw TAU timer string.
Definition hl78xx_apis.h:418
bool has_rat_mode
Parsed RAT mode is present.
Definition hl78xx_apis.h:400
int cause_type
Registration reject cause type.
Definition hl78xx_apis.h:406
char active_time[9]
Raw active time timer string.
Definition hl78xx_apis.h:414
bool has_cause_type
Cause type is present.
Definition hl78xx_apis.h:404
bool has_reject_cause
Reject cause is present.
Definition hl78xx_apis.h:408
enum hl78xx_cell_rat_mode rat_mode
RAT mode derived from +CEREG/+CREG AcT.
Definition hl78xx_apis.h:402
uint32_t tac
Tracking area code from +CEREG/+CREG.
Definition hl78xx_apis.h:394
bool has_tau
TAU field is present.
Definition hl78xx_apis.h:416
int reject_cause
Registration reject cause value.
Definition hl78xx_apis.h:410
Event monitor entry structure.
Definition hl78xx_apis.h:1233
atomic_t refcnt
Reference count for list membership and in-flight dispatch snapshots.
Definition hl78xx_apis.h:1241
uint8_t direct
Dispatch in ISR context.
Definition hl78xx_apis.h:1249
hl78xx_evt_monitor_release_t release
Optional callback invoked when the final runtime reference is dropped.
Definition hl78xx_apis.h:1237
uint8_t paused
Monitor is paused.
Definition hl78xx_apis.h:1247
struct hl78xx_evt_monitor_entry * next
Link for runtime list.
Definition hl78xx_apis.h:1239
struct k_work release_work
Work item used to defer release callback execution.
Definition hl78xx_apis.h:1243
const hl78xx_evt_monitor_handler_t handler
Monitor callback function.
Definition hl78xx_apis.h:1235
struct hl78xx_evt_monitor_entry::@057257214263213044053141035213063366342276164211 flags
Monitor flags.
HL78xx event structure.
Definition hl78xx_apis.h:857
enum hl78xx_evt_type type
Event type.
Definition hl78xx_apis.h:859
bool status
Boolean status value.
Definition hl78xx_apis.h:898
enum power_down_event power_down_event
Power-down event.
Definition hl78xx_apis.h:890
enum hl78xx_edrx_event edrx_event
eDRX event.
Definition hl78xx_apis.h:886
enum hl78xx_psmev_event psm_event
PSM event.
Definition hl78xx_apis.h:882
struct k_cellmeas_signal_info cellmeas
Cellular measurement event content.
Definition hl78xx_apis.h:894
struct hl78xx_ctzeu_update ctzeu
Full +CTZEU update payload.
Definition hl78xx_apis.h:896
enum hl78xx_event_status event_status
GNSS event status.
Definition hl78xx_apis.h:875
enum gnss_position_events position_event
GNSS position event type.
Definition hl78xx_apis.h:877
int value
Integer value.
Definition hl78xx_apis.h:900
enum hl78xx_cell_rat_mode rat_mode
Radio access technology mode (for HL78XX_LTE_RAT_UPDATE).
Definition hl78xx_apis.h:866
union hl78xx_evt::@213261367112170072133125351263244340324115255276 content
Event content (depends on type).
enum wdsi_indication wdsi_indication
AirVantage device service indication.
Definition hl78xx_apis.h:871
enum cellular_registration_status reg_status
Network registration status (for HL78XX_LTE_REGISTRATION_STAT_UPDATE).
Definition hl78xx_apis.h:864
GNSS auxiliary data callback structure.
Definition hl78xx_apis.h:1025
hl78xx_gnss_aux_data_callback_t callback
Callback called when GNSS auxiliary data is published.
Definition hl78xx_apis.h:1029
const struct device * dev
Filter callback to GNSS data from this device if not NULL.
Definition hl78xx_apis.h:1027
Container for all GNSS auxiliary NMEA data.
Definition hl78xx_apis.h:986
struct nmea_match_epu_data epu
EPU sentence data (HL78xx proprietary position/velocity error).
Definition hl78xx_apis.h:992
struct nmea_match_gsa_data gsa
GSA sentence data (DOP and fix type).
Definition hl78xx_apis.h:988
struct nmea_match_gst_data gst
GST sentence data (pseudorange error statistics).
Definition hl78xx_apis.h:990
Cached network information.
Definition hl78xx_apis.h:478
char ip_address[46]
IP address.
Definition hl78xx_apis.h:482
struct hl78xx_network_operator operator_info
Cached network operator information.
Definition hl78xx_apis.h:480
char dns_primary[46]
Primary DNS server.
Definition hl78xx_apis.h:484
Cached network operator information.
Definition hl78xx_apis.h:458
bool has_mcc
MCC is available.
Definition hl78xx_apis.h:464
bool has_mnc
MNC is available.
Definition hl78xx_apis.h:468
bool has_operator
Operator is available.
Definition hl78xx_apis.h:460
uint16_t mnc
Mobile network code.
Definition hl78xx_apis.h:470
enum hl78xx_operator_format format
Current +COPS operator format.
Definition hl78xx_apis.h:472
uint16_t mcc
Mobile country code.
Definition hl78xx_apis.h:466
char operator_name[32]
Operator name in the currently selected +COPS format.
Definition hl78xx_apis.h:462
Cellular network structure.
Definition hl78xx_apis.h:649
enum hl78xx_cell_rat_mode technology
Cellular access technology.
Definition hl78xx_apis.h:651
uint16_t * bands
List of bands to enable.
Definition hl78xx_apis.h:657
uint16_t size
Size of bands array.
Definition hl78xx_apis.h:659
Cellular measurement signal information.
Definition hl78xx_apis.h:640
int16_t rsrp
Reference Signal Received Power (RSRP) in dBm.
Definition hl78xx_apis.h:642
Kernel timeout type.
Definition clock.h:65
A structure used to submit work.
Definition kernel.h:4657
KSELACQ RAT configuration syntax.
Definition hl78xx_apis.h:271
enum hl78xx_kselacq_rat rat2
Preferred RAT in PRL position 2, expressed as raw AT+KSELACQ value.
Definition hl78xx_apis.h:277
enum hl78xx_kselacq_rat rat3
Preferred RAT in PRL position 3, expressed as raw AT+KSELACQ value.
Definition hl78xx_apis.h:279
bool mode
0 = configure PRL, 1 = reserved.
Definition hl78xx_apis.h:273
enum hl78xx_kselacq_rat rat1
Preferred RAT in PRL position 1, expressed as raw AT+KSELACQ value.
Definition hl78xx_apis.h:275
Modem chat match.
Definition chat.h:58
Parsed EPU sentence data (HL78xx proprietary position error).
Definition hl78xx_apis.h:955
int64_t vel_east
East velocity error estimate (m/s).
Definition hl78xx_apis.h:973
int64_t vel_hdg
Heading velocity error estimate (m/s).
Definition hl78xx_apis.h:971
int64_t pos_alt
Altitude position error estimate (meters).
Definition hl78xx_apis.h:965
int64_t pos_2d
2D (horizontal) position error estimate (meters)
Definition hl78xx_apis.h:959
int64_t vel_2d
2D (horizontal) velocity error estimate (m/s)
Definition hl78xx_apis.h:969
int64_t vel_north
North velocity error estimate (m/s).
Definition hl78xx_apis.h:975
int64_t pos_lon
Longitude position error estimate (meters).
Definition hl78xx_apis.h:963
int64_t vel_up
Up (vertical) velocity error estimate (m/s).
Definition hl78xx_apis.h:977
int64_t vel_3d
3D velocity error estimate (m/s)
Definition hl78xx_apis.h:967
int64_t pos_3d
3D position error estimate (meters)
Definition hl78xx_apis.h:957
int64_t pos_lat
Latitude position error estimate (meters).
Definition hl78xx_apis.h:961
Parsed GSA sentence data (GNSS DOP and Active Satellites).
Definition hl78xx_apis.h:910
int64_t vdop
Vertical Dilution of Precision (scaled).
Definition hl78xx_apis.h:918
int64_t hdop
Horizontal Dilution of Precision (scaled).
Definition hl78xx_apis.h:916
int64_t pdop
Position Dilution of Precision (scaled).
Definition hl78xx_apis.h:914
int32_t fix_type
Fix type: 1=no fix, 2=2D fix, 3=3D fix.
Definition hl78xx_apis.h:912
Parsed GST sentence data (GNSS Pseudorange Error Statistics).
Definition hl78xx_apis.h:927
int64_t lat_err
Standard deviation of latitude error (meters).
Definition hl78xx_apis.h:941
int64_t alt_err
Standard deviation of altitude error (meters).
Definition hl78xx_apis.h:945
int64_t sd_major
Standard deviation of semi-major axis of error ellipse (meters).
Definition hl78xx_apis.h:935
int64_t lon_err
Standard deviation of longitude error (meters).
Definition hl78xx_apis.h:943
int64_t rms
RMS value of standard deviation of range inputs.
Definition hl78xx_apis.h:933
int64_t orient
Orientation of semi-major axis of error ellipse (degrees from true north).
Definition hl78xx_apis.h:939
uint32_t gst_utc
UTC time of associated position fix (HHMMSS format).
Definition hl78xx_apis.h:931
int64_t sd_minor
Standard deviation of semi-minor axis of error ellipse (meters).
Definition hl78xx_apis.h:937
int32_t i32
Reserved for internal use.
Definition hl78xx_apis.h:929
Definition time.h:24
Macro utilities.