Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
simcom-sim7080.h
Go to the documentation of this file.
1
8
9#ifndef ZEPHYR_INCLUDE_DRIVERS_MODEM_SIMCOM_SIM7080_H
10#define ZEPHYR_INCLUDE_DRIVERS_MODEM_SIMCOM_SIM7080_H
11
12#include <zephyr/types.h>
13
14#include <stdint.h>
15#include <time.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
22#define SIM7080_GNSS_DATA_UTC_LEN 20
24#define SIM7080_SMS_MAX_LEN 160
26#define SIM7080_UE_SYS_INFO_BAND_SIZE 32
28#define SIM7080_DNS_MAX_RECOUNT 10
30#define SIM7080_DNS_MAX_TIMEOUT_MS 60000
31
40
80
89
96
124
134
142
151
175
209
225
232
239
246
253
262
269
278
288
295
303int mdm_sim7080_download_xtra(uint8_t server_id, const char *f_name);
304
312int mdm_sim7080_query_xtra_validity(int16_t *diff_h, int16_t *duration_h, struct tm *inject);
313
321
326
330const char *mdm_sim7080_get_model(void);
331
335const char *mdm_sim7080_get_revision(void);
336
340const char *mdm_sim7080_get_imei(void);
341
345const char *mdm_sim7080_get_iccid(void);
346
360
368
378int mdm_sim7080_set_gpio(int gpio, int level);
379
390int mdm_sim7080_ftp_get_start(const char *server, const char *user, const char *passwd,
391 const char *file, const char *path);
392
401int mdm_sim7080_ftp_get_read(char *dst, size_t *size);
402
412
420
429
440
448
449#ifdef __cplusplus
450}
451#endif
452
453#endif /* ZEPHYR_INCLUDE_DRIVERS_MODEM_SIMCOM_SIM7080_H */
time_t time(time_t *tloc)
int mdm_sim7080_dns_set_lookup_params(uint8_t recount, uint16_t timeout)
Set the dns query lookup parameters.
sim7080_sms_stat
Possible sms states in memory.
Definition simcom-sim7080.h:82
@ SIM7080_SMS_STAT_REC_READ
Message read.
Definition simcom-sim7080.h:84
@ SIM7080_SMS_STAT_REC_UNREAD
Message unread.
Definition simcom-sim7080.h:83
@ SIM7080_SMS_STAT_STO_UNSENT
Message stored unsent.
Definition simcom-sim7080.h:85
@ SIM7080_SMS_STAT_ALL
Status count.
Definition simcom-sim7080.h:87
@ SIM7080_SMS_STAT_STO_SENT
Message stored sent.
Definition simcom-sim7080.h:86
enum sim7080_state mdm_sim7080_get_state(void)
Get the current state of the modem.
int mdm_sim7080_query_xtra_validity(int16_t *diff_h, int16_t *duration_h, struct tm *inject)
Query the validity of the XTRA file.
sim7080_ue_sys_mode
UE system mode.
Definition simcom-sim7080.h:136
@ SIM7080_UE_SYS_MODE_LTE_NB_IOT
LTE NB IOT.
Definition simcom-sim7080.h:140
@ SIM7080_UE_SYS_MODE_NO_SERVICE
No service.
Definition simcom-sim7080.h:137
@ SIM7080_UE_SYS_MODE_GSM
GSM.
Definition simcom-sim7080.h:138
@ SIM7080_UE_SYS_MODE_LTE_CAT_M1
LTE CAT M1.
Definition simcom-sim7080.h:139
const char * mdm_sim7080_get_imei(void)
Get the sim7080 imei number.
int mdm_sim7080_get_ue_sys_info(struct sim7080_ue_sys_info *info)
Read the ue system information.
int mdm_sim7080_get_battery_charge(uint8_t *bcs, uint8_t *bcl, uint16_t *voltage)
Read voltage, charge status and battery connection level.
int mdm_sim7080_power_off(void)
Power off the Sim7080.
#define SIM7080_UE_SYS_INFO_BAND_SIZE
Maximum UE system information band size.
Definition simcom-sim7080.h:26
void mdm_sim7080_force_reset(void)
Forcefully reset the modem by pulling pwrkey for 15 seconds.
sim7080_ftp_rc
Possible ftp return codes.
Definition simcom-sim7080.h:91
@ SIM7080_FTP_RC_FINISHED
Session finished.
Definition simcom-sim7080.h:93
@ SIM7080_FTP_RC_OK
Operation finished correctly.
Definition simcom-sim7080.h:92
@ SIM7080_FTP_RC_ERROR
An error occurred.
Definition simcom-sim7080.h:94
int mdm_sim7080_ftp_get_start(const char *server, const char *user, const char *passwd, const char *file, const char *path)
Start a ftp get session.
const char * mdm_sim7080_get_model(void)
Get the sim7080 model information.
sim7080_state
Sim7080 modem state.
Definition simcom-sim7080.h:33
@ SIM7080_STATE_NETWORKING
Network active.
Definition simcom-sim7080.h:36
@ SIM7080_STATE_OFF
Modem off.
Definition simcom-sim7080.h:38
@ SIM7080_STATE_IDLE
Modem idle.
Definition simcom-sim7080.h:35
@ SIM7080_STATE_INIT
Initial modem state.
Definition simcom-sim7080.h:34
@ SIM7080_STATE_GNSS
GNSS active.
Definition simcom-sim7080.h:37
int mdm_sim7080_start_gnss(void)
Starts the modem in gnss operation mode.
int mdm_sim7080_stop_gnss(void)
Stops the modem gnss operation mode.
int mdm_sim7080_set_gpio(int gpio, int level)
Set the level of one of the module's GPIO pins.
int mdm_sim7080_get_local_time(struct tm *t)
Get the local time of the modem.
int mdm_sim7080_ftp_get_read(char *dst, size_t *size)
Read data from a ftp get session.
const char * mdm_sim7080_get_manufacturer(void)
Get the sim7080 manufacturer.
int mdm_sim7080_start_gnss_xtra(void)
Starts the modem in gnss operation mode with xtra functionality.
void mdm_sim7080_dns_get_lookup_params(uint8_t *recount, uint16_t *timeout)
Get the dns query lookup parameters.
int mdm_sim7080_power_on(void)
Power on the Sim7080.
const char * mdm_sim7080_get_revision(void)
Get the sim7080 revision.
int mdm_sim7080_stop_network(void)
Stops the networking operation mode of the modem.
int mdm_sim7080_read_sms(struct sim7080_sms_buffer *buffer)
Read sms from sim module.
#define SIM7080_SMS_MAX_LEN
Maximum SMS length.
Definition simcom-sim7080.h:24
int mdm_sim7080_query_gnss(struct sim7080_gnss_data *data)
Query gnss position form the modem.
#define SIM7080_GNSS_DATA_UTC_LEN
Maximum Length of GNSS UTC data.
Definition simcom-sim7080.h:22
const char * mdm_sim7080_get_iccid(void)
Get the sim7080 iccid number.
int mdm_sim7080_download_xtra(uint8_t server_id, const char *f_name)
Download the XTRA file for assisted gnss.
int mdm_sim7080_start_network(void)
Activates the network operation mode of the modem.
int mdm_sim7080_delete_sms(uint16_t index)
Delete a sms at a given index.
sim7080_ue_op_mode
UE operating mode.
Definition simcom-sim7080.h:144
@ SIM7080_UE_OP_MODE_OFFLINE
Offline.
Definition simcom-sim7080.h:146
@ SIM7080_UE_OP_MODE_RESET
Reset.
Definition simcom-sim7080.h:148
@ SIM7080_UE_OP_MODE_FACTORY_TEST_MODE
Factory test mode.
Definition simcom-sim7080.h:147
@ SIM7080_UE_OP_MODE_ONLINE
Online.
Definition simcom-sim7080.h:145
@ SIM7080_UE_OP_MODE_LOW_POWER_MODE
Low power mode.
Definition simcom-sim7080.h:149
__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
__INT16_TYPE__ int16_t
Definition stdint.h:73
Definition pwd.h:15
Sim7080 gnss data structure.
Definition simcom-sim7080.h:42
int32_t lon
Longitude in 10^-7 degree.
Definition simcom-sim7080.h:62
int32_t lat
Latitude in 10^-7 degree.
Definition simcom-sim7080.h:58
uint16_t kmh
Speed in 10^-1 km/h.
Definition simcom-sim7080.h:78
uint16_t cog
Course over ground un 10^-2 degree.
Definition simcom-sim7080.h:74
bool fix_status
Whether fix is acquired or not.
Definition simcom-sim7080.h:50
char utc[20]
UTC in format yyyyMMddhhmmss.sss.
Definition simcom-sim7080.h:54
int32_t alt
Altitude in mm.
Definition simcom-sim7080.h:66
bool run_status
Whether gnss is powered or not.
Definition simcom-sim7080.h:46
uint16_t hdop
Horizontal dilution of precision in 10^-2.
Definition simcom-sim7080.h:70
Buffer structure for sms reads.
Definition simcom-sim7080.h:128
uint8_t nsms
Number of sms structures.
Definition simcom-sim7080.h:132
struct sim7080_sms * sms
sms structures to read to.
Definition simcom-sim7080.h:130
Buffer structure for sms.
Definition simcom-sim7080.h:100
uint8_t day
Day of the month.
Definition simcom-sim7080.h:113
uint8_t second
Second.
Definition simcom-sim7080.h:116
uint8_t month
Month of the year.
Definition simcom-sim7080.h:112
uint8_t minute
Minute.
Definition simcom-sim7080.h:115
char data[160+1]
Buffered sms.
Definition simcom-sim7080.h:120
uint8_t first_octet
First octet of the sms.
Definition simcom-sim7080.h:102
enum sim7080_sms_stat stat
Status of the sms in memory.
Definition simcom-sim7080.h:106
uint8_t tp_pid
Message protocol identifier.
Definition simcom-sim7080.h:104
uint16_t index
Index of the sms in memory.
Definition simcom-sim7080.h:108
uint8_t timezone
Current timezone.
Definition simcom-sim7080.h:117
uint8_t hour
Hour of the day.
Definition simcom-sim7080.h:114
uint8_t data_len
Length of the sms in buffer.
Definition simcom-sim7080.h:122
uint8_t year
Current Year.
Definition simcom-sim7080.h:111
Sim7080 ue system information structure for gsm.
Definition simcom-sim7080.h:155
uint16_t mcn
Mobile network code.
Definition simcom-sim7080.h:159
uint16_t c2
C2 coefficient.
Definition simcom-sim7080.h:173
uint16_t lac
Location area code.
Definition simcom-sim7080.h:161
uint16_t cid
Cell ID.
Definition simcom-sim7080.h:163
uint16_t c1
C1 coefficient.
Definition simcom-sim7080.h:171
uint8_t arfcn[32+1]
Absolute radio frequency channel number.
Definition simcom-sim7080.h:165
int16_t track_lo_adjust
Track LO adjust.
Definition simcom-sim7080.h:169
int16_t rx_lvl
RX level in dBm.
Definition simcom-sim7080.h:167
uint16_t mcc
Mobile country code.
Definition simcom-sim7080.h:157
Sim7080 ue system information structure for LTE.
Definition simcom-sim7080.h:179
uint16_t dlbw
Downlink bandwidth in MHz.
Definition simcom-sim7080.h:195
uint16_t mcc
Mobile country code.
Definition simcom-sim7080.h:181
int16_t rssi
Received signal strength indicator in dBm.
Definition simcom-sim7080.h:203
uint16_t mcn
Mobile network code.
Definition simcom-sim7080.h:183
int16_t sinr
Signal to interference plus noise ratio in dB.
Definition simcom-sim7080.h:207
int16_t rssnr
Reference signal signal to noise ratio in dB.
Definition simcom-sim7080.h:205
uint32_t sci
Serving Cell ID.
Definition simcom-sim7080.h:187
uint16_t ulbw
Uplink bandwidth in MHz.
Definition simcom-sim7080.h:197
uint8_t band[32+1]
Frequency band.
Definition simcom-sim7080.h:191
uint16_t earfcn
E-UTRA absolute radio frequency channel number.
Definition simcom-sim7080.h:193
int16_t rsrp
Reference signal received power in dBm.
Definition simcom-sim7080.h:201
uint16_t tac
Tracing area code.
Definition simcom-sim7080.h:185
uint16_t pci
Physical Cell ID.
Definition simcom-sim7080.h:189
int16_t rsrq
Reference signal received quality in dB.
Definition simcom-sim7080.h:199
Sim7080 ue system information structure.
Definition simcom-sim7080.h:213
enum sim7080_ue_sys_mode sys_mode
Refer to sim7080_ue_sys_mode.
Definition simcom-sim7080.h:215
enum sim7080_ue_op_mode op_mode
Refer to sim7080_ue_op_mode.
Definition simcom-sim7080.h:217
union sim7080_ue_sys_info::@022025115355176221356052205061203224150002333135 cell
Cell information.
struct sim7080_ue_sys_info_lte lte
Only set if sys mode is LTE CAT-M1/NB-IOT.
Definition simcom-sim7080.h:222
struct sim7080_ue_sys_info_gsm gsm
Only set if sys_mode is GSM.
Definition simcom-sim7080.h:220
Definition time.h:24