Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
simcom-sim7080.h File Reference
#include <zephyr/types.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  sim7080_gnss_data
 
struct  sim7080_sms
 Buffer structure for sms. More...
 
struct  sim7080_sms_buffer
 Buffer structure for sms reads. More...
 

Macros

#define SIM7080_GNSS_DATA_UTC_LEN   20
 
#define SIM7080_SMS_MAX_LEN   160
 

Enumerations

enum  sim7080_sms_stat {
  SIM7080_SMS_STAT_REC_UNREAD = 0 , SIM7080_SMS_STAT_REC_READ , SIM7080_SMS_STAT_STO_UNSENT , SIM7080_SMS_STAT_STO_SENT ,
  SIM7080_SMS_STAT_ALL
}
 Possible sms states in memory. More...
 
enum  sim7080_ftp_rc { SIM7080_FTP_RC_OK = 0 , SIM7080_FTP_RC_FINISHED , SIM7080_FTP_RC_ERROR }
 Possible ftp return codes. More...
 

Functions

int mdm_sim7080_power_on (void)
 Power on the Sim7080.
 
int mdm_sim7080_power_off (void)
 Power off the Sim7080.
 
int mdm_sim7080_start_network (void)
 Starts the modem in network operation mode.
 
int mdm_sim7080_start_gnss (void)
 Starts the modem in gnss operation mode.
 
int mdm_sim7080_query_gnss (struct sim7080_gnss_data *data)
 Query gnss position form the modem.
 
const char * mdm_sim7080_get_manufacturer (void)
 Get the sim7080 manufacturer.
 
const char * mdm_sim7080_get_model (void)
 Get the sim7080 model information.
 
const char * mdm_sim7080_get_revision (void)
 Get the sim7080 revision.
 
const char * mdm_sim7080_get_imei (void)
 Get the sim7080 imei number.
 
int mdm_sim7080_read_sms (struct sim7080_sms_buffer *buffer)
 Read sms from sim module.
 
int mdm_sim7080_delete_sms (uint16_t index)
 Delete a sms at a given index.
 
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.
 
int mdm_sim7080_ftp_get_read (char *dst, size_t *size)
 Read data from a ftp get session.
 

Macro Definition Documentation

◆ SIM7080_GNSS_DATA_UTC_LEN

#define SIM7080_GNSS_DATA_UTC_LEN   20

◆ SIM7080_SMS_MAX_LEN

#define SIM7080_SMS_MAX_LEN   160

Enumeration Type Documentation

◆ sim7080_ftp_rc

Possible ftp return codes.

Enumerator
SIM7080_FTP_RC_OK 
SIM7080_FTP_RC_FINISHED 
SIM7080_FTP_RC_ERROR 

◆ sim7080_sms_stat

Possible sms states in memory.

Enumerator
SIM7080_SMS_STAT_REC_UNREAD 
SIM7080_SMS_STAT_REC_READ 
SIM7080_SMS_STAT_STO_UNSENT 
SIM7080_SMS_STAT_STO_SENT 
SIM7080_SMS_STAT_ALL 

Function Documentation

◆ mdm_sim7080_delete_sms()

int mdm_sim7080_delete_sms ( uint16_t index)

Delete a sms at a given index.

Parameters
indexThe index of the sms in memory.
Returns
0 on success. Otherwise -1 is returned.

◆ mdm_sim7080_ftp_get_read()

int mdm_sim7080_ftp_get_read ( char * dst,
size_t * size )

Read data from a ftp get session.

Parameters
dstThe destination buffer.
sizeInitialize to the size of dst. Gets set to the number of bytes actually read.
Returns
According sim7080_ftp_rc.

◆ mdm_sim7080_ftp_get_start()

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.

Parameters
serverThe ftp servers address.
userUser name for the ftp server.
passwdPassword for the ftp user.
fileFile to be downloaded.
pathPath to the file on the server.
Returns
0 if the session was started. Otherwise -1 is returned.

◆ mdm_sim7080_get_imei()

const char * mdm_sim7080_get_imei ( void )

Get the sim7080 imei number.

◆ mdm_sim7080_get_manufacturer()

const char * mdm_sim7080_get_manufacturer ( void )

Get the sim7080 manufacturer.

◆ mdm_sim7080_get_model()

const char * mdm_sim7080_get_model ( void )

Get the sim7080 model information.

◆ mdm_sim7080_get_revision()

const char * mdm_sim7080_get_revision ( void )

Get the sim7080 revision.

◆ mdm_sim7080_power_off()

int mdm_sim7080_power_off ( void )

Power off the Sim7080.

Returns
0 on success. Otherwise -1 is returned.

◆ mdm_sim7080_power_on()

int mdm_sim7080_power_on ( void )

Power on the Sim7080.

Returns
0 on success. Otherwise -1 is returned.

◆ mdm_sim7080_query_gnss()

int mdm_sim7080_query_gnss ( struct sim7080_gnss_data * data)

Query gnss position form the modem.

Returns
0 on success. If no fix is acquired yet -EAGAIN is returned. Otherwise <0 is returned.

◆ mdm_sim7080_read_sms()

int mdm_sim7080_read_sms ( struct sim7080_sms_buffer * buffer)

Read sms from sim module.

Parameters
bufferBuffer structure for sms.
Returns
Number of sms read on success. Otherwise -1 is returned.
Note
The buffer structure needs to be initialized to the size of the sms buffer. When this function finishes successful, nsms will be set to the number of sms read. If the whole structure is filled a subsequent read may be needed.

◆ mdm_sim7080_start_gnss()

int mdm_sim7080_start_gnss ( void )

Starts the modem in gnss operation mode.

Returns
0 on success. Otherwise <0 is returned.

◆ mdm_sim7080_start_network()

int mdm_sim7080_start_network ( void )

Starts the modem in network operation mode.

Returns
0 on success. Otherwise <0 is returned.