Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hl7800.h
Go to the documentation of this file.
1
11#ifndef ZEPHYR_INCLUDE_DRIVERS_MODEM_HL7800_H_
12#define ZEPHYR_INCLUDE_DRIVERS_MODEM_HL7800_H_
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#include <zephyr/types.h>
19
20#include <time.h>
21
22/* The size includes the NUL character, the strlen doesn't */
23#define MDM_HL7800_REVISION_MAX_SIZE 29
24#define MDM_HL7800_REVISION_MAX_STRLEN (MDM_HL7800_REVISION_MAX_SIZE - 1)
25
26#define MDM_HL7800_IMEI_SIZE 16
27#define MDM_HL7800_IMEI_STRLEN (MDM_HL7800_IMEI_SIZE - 1)
28
29#define MDM_HL7800_ICCID_MAX_SIZE 21
30#define MDM_HL7800_ICCID_MAX_STRLEN (MDM_HL7800_ICCID_MAX_SIZE - 1)
31
32#define MDM_HL7800_SERIAL_NUMBER_SIZE 15
33#define MDM_HL7800_SERIAL_NUMBER_STRLEN (MDM_HL7800_SERIAL_NUMBER_SIZE - 1)
34
35#define MDM_HL7800_APN_MAX_SIZE 64
36#define MDM_HL7800_APN_USERNAME_MAX_SIZE 65
37#define MDM_HL7800_APN_PASSWORD_MAX_SIZE 65
38
39#define MDM_HL7800_APN_MAX_STRLEN (MDM_HL7800_APN_MAX_SIZE - 1)
40#define MDM_HL7800_APN_USERNAME_MAX_STRLEN \
41 (MDM_HL7800_APN_USERNAME_MAX_SIZE - 1)
42#define MDM_HL7800_APN_PASSWORD_MAX_STRLEN \
43 (MDM_HL7800_APN_PASSWORD_MAX_SIZE - 1)
44
45#define MDM_HL7800_APN_CMD_MAX_SIZE \
46 (32 + MDM_HL7800_APN_USERNAME_MAX_STRLEN + \
47 MDM_HL7800_APN_PASSWORD_MAX_STRLEN)
48
49#define MDM_HL7800_APN_CMD_MAX_STRLEN (MDM_HL7800_APN_CMD_MAX_SIZE - 1)
50
56
57#define MDM_HL7800_LTE_BAND_STR_SIZE 21
58#define MDM_HL7800_LTE_BAND_STRLEN (MDM_HL7800_LTE_BAND_STR_SIZE - 1)
59
60#define MDM_HL7800_OPERATOR_INDEX_SIZE 3
61#define MDM_HL7800_OPERATOR_INDEX_STRLEN (MDM_HL7800_OPERATOR_INDEX_SIZE - 1)
62
63#define MDM_HL7800_IMSI_MIN_STR_SIZE 15
64#define MDM_HL7800_IMSI_MAX_STR_SIZE 16
65#define MDM_HL7800_IMSI_MAX_STRLEN (MDM_HL7800_IMSI_MAX_STR_SIZE - 1)
66
67#define MDM_HL7800_MODEM_FUNCTIONALITY_SIZE 2
68#define MDM_HL7800_MODEM_FUNCTIONALITY_STRLEN \
69 (MDM_HL7800_MODEM_FUNCTIONALITY_SIZE - 1)
70
71#define MDM_HL7800_MAX_GPS_STR_SIZE 33
72
73#define MDM_HL7800_MAX_POLTE_USER_ID_SIZE 16
74#define MDM_HL7800_MAX_POLTE_PASSWORD_SIZE 16
75#define MDM_HL7800_MAX_POLTE_LOCATION_STR_SIZE 33
76
77/* Assign the server error code (location response) to a value
78 * that isn't used by locate response so that a single status
79 * callback can be used.
80 */
81#define MDM_HL7800_POLTE_SERVER_ERROR 10
82
83#define MDM_HL7800_SET_POLTE_USER_AND_PASSWORD_FMT_STR "AT%%POLTECMD=\"SERVERAUTH\",\"%s\",\"%s\""
84
86 uint32_t earfcn; /* EUTRA Absolute Radio Frequency Channel Number */
88 int rsrp;
89 int rsrq;
90};
91
93
115
125
137
145
157
163
164/* The modem reports state values as an enumeration and a string.
165 * GPS values are reported with a type of value and string.
166 */
171
179
185
194
207
208/* status: negative errno, 0 on success
209 * user and password aren't valid if status is non-zero.
210 */
216
217/* status: negative errno, 0 on success, non-zero error code
218 * Data is not valid if status is non-zero.
219 */
227
251 void *event_data);
252
257
264
271
278void mdm_hl7800_wakeup(bool awake);
279
288
301void mdm_hl7800_get_signal_quality(int *rsrp, int *sinr);
302
308
314
320
326
332
338int32_t mdm_hl7800_update_apn(char *access_point_name);
339
346
351
361
370
378
387
388#ifdef CONFIG_MODEM_HL7800_FW_UPDATE
397int32_t mdm_hl7800_update_fw(char *file_path);
398#endif
399
406
413
425
437
449
457int32_t mdm_hl7800_polte_enable(char *user, char *password);
458
470
480
488
498
509
519
529int32_t mdm_hl7800_set_bands(const char *bands);
530
542
543#ifdef __cplusplus
544}
545#endif
546
547#endif /* ZEPHYR_INCLUDE_DRIVERS_MODEM_HL7800_H_ */
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
#define MDM_HL7800_MAX_POLTE_LOCATION_STR_SIZE
Definition hl7800.h:75
bool mdm_hl7800_valid_rat(uint8_t value)
void mdm_hl7800_register_gpio6_callback(void(*func)(int state))
Allows mapping of P1.12_GPIO6 signal to a user accessible test point on the development board.
void mdm_hl7800_register_wake_test_point_callback(void(*func)(int state))
Allows mapping of WAKE_UP signal to a user accessible test point on the development board.
int32_t mdm_hl7800_polte_locate(void)
Locate device using PoLTE.
int32_t mdm_hl7800_set_functionality(enum mdm_hl7800_functionality mode)
Set airplane, normal, or reduced functionality mode.
char * mdm_hl7800_get_sn(void)
Get the HL7800 serial number.
int32_t mdm_hl7800_polte_enable(char *user, char *password)
Enable PoLTE.
int mdm_hl7800_set_desired_sleep_level(enum mdm_hl7800_sleep level)
Set desired sleep level.
int32_t mdm_hl7800_set_gps_rate(uint32_t rate)
When rate is non-zero: Put modem into Airplane mode.
int32_t mdm_hl7800_get_operator_index(void)
Read the operator index from the modem.
mdm_hl7800_radio_mode
Definition hl7800.h:92
@ MDM_RAT_CAT_NB1
Definition hl7800.h:92
@ MDM_RAT_CAT_M1
Definition hl7800.h:92
int32_t mdm_hl7800_get_functionality(void)
Get modem functionality.
mdm_hl7800_sleep
Definition hl7800.h:138
@ HL7800_SLEEP_SLEEP
Definition hl7800.h:143
@ HL7800_SLEEP_LITE_HIBERNATE
Definition hl7800.h:142
@ HL7800_SLEEP_AWAKE
Definition hl7800.h:141
@ HL7800_SLEEP_HIBERNATE
Definition hl7800.h:140
@ HL7800_SLEEP_UNINITIALIZED
Definition hl7800.h:139
int32_t mdm_hl7800_update_apn(char *access_point_name)
Update the Access Point Name in the modem.
mdm_hl7800_event
Definition hl7800.h:94
@ HL7800_EVENT_NETWORK_STATE_CHANGE
Definition hl7800.h:96
@ HL7800_EVENT_GPS_POSITION_STATUS
Definition hl7800.h:109
@ HL7800_EVENT_STARTUP_STATE_CHANGE
Definition hl7800.h:100
@ HL7800_EVENT_POLTE
Definition hl7800.h:112
@ HL7800_EVENT_BANDS
Definition hl7800.h:103
@ HL7800_EVENT_SITE_SURVEY
Definition hl7800.h:113
@ HL7800_EVENT_FOTA_COUNT
Definition hl7800.h:106
@ HL7800_EVENT_APN_UPDATE
Definition hl7800.h:97
@ HL7800_EVENT_RESERVED
Definition hl7800.h:95
@ HL7800_EVENT_SLEEP_STATE_CHANGE
Definition hl7800.h:101
@ HL7800_EVENT_POLTE_LOCATE_STATUS
Definition hl7800.h:111
@ HL7800_EVENT_REVISION
Definition hl7800.h:107
@ HL7800_EVENT_ACTIVE_BANDS
Definition hl7800.h:104
@ HL7800_EVENT_RSSI
Definition hl7800.h:98
@ HL7800_EVENT_RAT
Definition hl7800.h:102
@ HL7800_EVENT_SINR
Definition hl7800.h:99
@ HL7800_EVENT_POLTE_REGISTRATION
Definition hl7800.h:110
@ HL7800_EVENT_FOTA_STATE
Definition hl7800.h:105
@ HL7800_EVENT_GPS
Definition hl7800.h:108
char * mdm_hl7800_get_imei(void)
Get the HL7800 IMEI.
void mdm_hl7800_wakeup(bool awake)
Control the wake signals to the HL7800.
mdm_hl7800_gps_string_types
Definition hl7800.h:195
@ HL7800_GPS_STR_GPS_TIME
Definition hl7800.h:198
@ HL7800_GPS_STR_ALTITUDE
Definition hl7800.h:201
@ HL7800_GPS_STR_ALT_UNC
Definition hl7800.h:202
@ HL7800_GPS_STR_VER_SPEED
Definition hl7800.h:205
@ HL7800_GPS_STR_LONGITUDE
Definition hl7800.h:197
@ HL7800_GPS_STR_LATITUDE
Definition hl7800.h:196
@ HL7800_GPS_STR_FIX_TYPE
Definition hl7800.h:199
@ HL7800_GPS_STR_HOR_SPEED
Definition hl7800.h:204
@ HL7800_GPS_STR_HEPE
Definition hl7800.h:200
@ HL7800_GPS_STR_DIRECTION
Definition hl7800.h:203
mdm_hl7800_gnss_status
Definition hl7800.h:180
@ HL7800_GNSS_STATUS_FAILURE
Definition hl7800.h:182
@ HL7800_GNSS_STATUS_INVALID
Definition hl7800.h:181
@ HL7800_GNSS_STATUS_SUCCESS
Definition hl7800.h:183
char * mdm_hl7800_get_imsi(void)
Get the IMSI.
mdm_hl7800_gnss_event
Definition hl7800.h:172
@ HL7800_GNSS_EVENT_POSITION
Definition hl7800.h:177
@ HL7800_GNSS_EVENT_INVALID
Definition hl7800.h:173
@ HL7800_GNSS_EVENT_INIT
Definition hl7800.h:174
@ HL7800_GNSS_EVENT_START
Definition hl7800.h:175
@ HL7800_GNSS_EVENT_STOP
Definition hl7800.h:176
#define MDM_HL7800_APN_MAX_SIZE
Definition hl7800.h:35
mdm_hl7800_network_state
Definition hl7800.h:126
@ HL7800_EMERGENCY
Definition hl7800.h:133
@ HL7800_SEARCHING
Definition hl7800.h:129
@ HL7800_UNABLE_TO_CONFIGURE
Definition hl7800.h:135
@ HL7800_REGISTRATION_DENIED
Definition hl7800.h:130
@ HL7800_HOME_NETWORK
Definition hl7800.h:128
@ HL7800_NOT_REGISTERED
Definition hl7800.h:127
@ HL7800_ROAMING
Definition hl7800.h:132
@ HL7800_OUT_OF_COVERAGE
Definition hl7800.h:131
int32_t mdm_hl7800_send_at_cmd(const uint8_t *data)
Send an AT command to the HL7800.
uint32_t mdm_hl7800_log_filter_set(uint32_t level)
Set the log level for the modem.
int32_t mdm_hl7800_polte_register(void)
Register modem/SIM with polte.io.
mdm_hl7800_fota_state
Definition hl7800.h:146
@ HL7800_FOTA_PAD
Definition hl7800.h:150
@ HL7800_FOTA_REBOOT_AND_RECONFIGURE
Definition hl7800.h:154
@ HL7800_FOTA_INSTALL
Definition hl7800.h:153
@ HL7800_FOTA_WIP
Definition hl7800.h:149
@ HL7800_FOTA_SEND_EOT
Definition hl7800.h:151
@ HL7800_FOTA_FILE_ERROR
Definition hl7800.h:152
@ HL7800_FOTA_IDLE
Definition hl7800.h:147
@ HL7800_FOTA_COMPLETE
Definition hl7800.h:155
@ HL7800_FOTA_START
Definition hl7800.h:148
int32_t mdm_hl7800_set_bands(const char *bands)
Set the bands available for the LTE connection.
int32_t mdm_hl7800_reset(void)
Reset the HL7800 (and allow it to reconfigure).
int32_t mdm_hl7800_perform_site_survey(void)
Perform a site survey.
int32_t mdm_hl7800_update_rat(enum mdm_hl7800_radio_mode value)
Update the Radio Access Technology (mode).
void mdm_hl7800_generate_status_events(void)
Force modem module to generate status events.
#define MDM_HL7800_APN_PASSWORD_MAX_SIZE
Definition hl7800.h:37
char * mdm_hl7800_get_fw_version(void)
Get the HL7800 firmware version.
#define MDM_HL7800_APN_USERNAME_MAX_SIZE
Definition hl7800.h:36
void mdm_hl7800_get_signal_quality(int *rsrp, int *sinr)
Get the signal quality of the HL7800.
int mdm_hl7800_unregister_event_callback(struct mdm_hl7800_callback_agent *agent)
Unregister a callback event function.
int32_t mdm_hl7800_power_off(void)
Power off the HL7800.
void mdm_hl7800_register_cts_callback(void(*func)(int state))
Allows mapping of UART1_CTS signal to a user accessible test point on the development board.
mdm_hl7800_gnss_position_event
Definition hl7800.h:186
@ HL7800_GNSS_POSITION_EVENT_2D_AVAILABLE
Definition hl7800.h:190
@ HL7800_GNSS_POSITION_EVENT_3D_AVAILABLE
Definition hl7800.h:191
@ HL7800_GNSS_POSITION_EVENT_FIXED_TO_INVALID
Definition hl7800.h:192
@ HL7800_GNSS_POSITION_EVENT_INVALID
Definition hl7800.h:187
@ HL7800_GNSS_POSITION_EVENT_LOST_OR_NOT_AVAILABLE_YET
Definition hl7800.h:188
@ HL7800_GNSS_POSITION_EVENT_PREDICTION_AVAILABLE
Definition hl7800.h:189
mdm_hl7800_startup_state
Definition hl7800.h:116
@ HL7800_STARTUP_STATE_SIMLOCK
Definition hl7800.h:120
@ HL7800_STARTUP_STATE_UNRECOVERABLE_ERROR
Definition hl7800.h:121
@ HL7800_STARTUP_STATE_WAITING_FOR_ACCESS_CODE
Definition hl7800.h:118
@ HL7800_STARTUP_STATE_SIM_NOT_PRESENT
Definition hl7800.h:119
@ HL7800_STARTUP_STATE_INACTIVE_SIM
Definition hl7800.h:123
@ HL7800_STARTUP_STATE_UNKNOWN
Definition hl7800.h:122
@ HL7800_STARTUP_STATE_READY
Definition hl7800.h:117
char * mdm_hl7800_get_iccid(void)
Get the SIM card ICCID.
mdm_hl7800_functionality
Definition hl7800.h:158
@ HL7800_FUNCTIONALITY_AIRPLANE
Definition hl7800.h:161
@ HL7800_FUNCTIONALITY_FULL
Definition hl7800.h:160
@ HL7800_FUNCTIONALITY_MINIMUM
Definition hl7800.h:159
void(* mdm_hl7800_event_callback_t)(enum mdm_hl7800_event event, void *event_data)
event - The type of event event_data - Pointer to event specific data structure HL7800_EVENT_NETWORK_...
Definition hl7800.h:250
int32_t mdm_hl7800_get_local_time(struct tm *tm, int32_t *offset)
Get the local time from the modem's real time clock.
int mdm_hl7800_register_event_callback(struct mdm_hl7800_callback_agent *agent)
Register a function that is called when a modem event occurs.
state
Definition parser_state.h:29
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__INT32_TYPE__ int32_t
Definition stdint.h:74
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Definition hl7800.h:51
char value[64]
Definition hl7800.h:52
char password[65]
Definition hl7800.h:54
char username[65]
Definition hl7800.h:53
Definition hl7800.h:253
sys_snode_t node
Definition hl7800.h:254
mdm_hl7800_event_callback_t event_callback
Definition hl7800.h:255
Definition hl7800.h:167
char * string
Definition hl7800.h:169
uint8_t code
Definition hl7800.h:168
Definition hl7800.h:220
int status
Definition hl7800.h:222
char confidence_in_meters[33]
Definition hl7800.h:225
char longitude[33]
Definition hl7800.h:224
uint32_t timestamp
Definition hl7800.h:221
char latitude[33]
Definition hl7800.h:223
int status
Definition hl7800.h:212
char * password
Definition hl7800.h:214
char * user
Definition hl7800.h:213
Definition hl7800.h:85
int rsrq
Definition hl7800.h:89
int rsrp
Definition hl7800.h:88
uint32_t cell_id
Definition hl7800.h:87
uint32_t earfcn
Definition hl7800.h:86
Definition time.h:24