gsmgnss2 2.0.0.0
gsmgnss2.h File Reference

This file contains API for GSM/GNSS 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  gsmgnss2_t
 GSM/GNSS 2 Click context object. More...
 
struct  gsmgnss2_cfg_t
 GSM/GNSS 2 Click configuration object. More...
 

Macros

#define GSMGNSS2_CMD_AT   "AT"
 GSM/GNSS 2 control commands.
 
#define GSMGNSS2_CMD_ATI   "ATI"
 
#define GSMGNSS2_CMD_CGMR   "AT+CGMR"
 
#define GSMGNSS2_CMD_CFUN   "AT+CFUN"
 
#define GSMGNSS2_CMD_CREG   "AT+CREG"
 
#define GSMGNSS2_CMD_CGREG   "AT+CGREG"
 
#define GSMGNSS2_CMD_CGDCONT   "AT+CGDCONT"
 
#define GSMGNSS2_CMD_CIMI   "AT+CIMI"
 
#define GSMGNSS2_CMD_CMEE   "AT+CMEE"
 
#define GSMGNSS2_CMD_CGATT   "AT+CGATT"
 
#define GSMGNSS2_CMD_CSQ   "AT+CSQ"
 
#define GSMGNSS2_CMD_COPS   "AT+COPS"
 
#define GSMGNSS2_CMD_CMGS   "AT+CMGS"
 
#define GSMGNSS2_CMD_CMGF   "AT+CMGF"
 
#define GSMGNSS2_CMD_CGNSPWR   "AT+CGNSPWR"
 
#define GSMGNSS2_CMD_CGNSTST   "AT+CGNSTST"
 
#define GSMGNSS2_RSP_START   "$"
 GSMGNSS 2 response buffer commands.
 
#define GSMGNSS2_RSP_DELIMITER   ","
 
#define GSMGNSS2_RSP_GNGGA   "$GNGGA"
 
#define GSMGNSS2_GNGGA_ELEMENT_SIZE   15
 GSMGNSS 2 GNGGA command elements.
 
#define GSMGNSS2_GNGGA_TIME   1
 
#define GSMGNSS2_GNGGA_LATITUDE   2
 
#define GSMGNSS2_GNGGA_LATITUDE_SIDE   3
 
#define GSMGNSS2_GNGGA_LONGITUDE   4
 
#define GSMGNSS2_GNGGA_LONGITUDE_SIDE   5
 
#define GSMGNSS2_GNGGA_QUALITY_INDICATOR   6
 
#define GSMGNSS2_GNGGA_NUMBER_OF_SATELLITES   7
 
#define GSMGNSS2_GNGGA_H_DILUTION_OF_POS   8
 
#define GSMGNSS2_GNGGA_ALTITUDE   9
 
#define GSMGNSS2_GNGGA_ALTITUDE_UNIT   10
 
#define GSMGNSS2_GNGGA_GEOIDAL_SEPARATION   11
 
#define GSMGNSS2_GNGGA_GEOIDAL_SEPARATION_UNIT   12
 
#define GSMGNSS2_GNGGA_TIME_SINCE_LAST_DGPS   13
 
#define GSMGNSS2_GNGGA_DGPS_REFERENCE_STATION_ID   14
 
#define GSMGNSS2_MODULE_POWER_ON   1
 GSMGNSS 2 module power state.
 
#define GSMGNSS2_MODULE_POWER_OFF   0
 
#define DRV_BUFFER_SIZE_RX   256
 GSM/GNSS 2 driver buffer size.
 
#define DRV_BUFFER_SIZE_TX   256
 
#define GSMGNSS2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  gsmgnss2_return_value_t { GSMGNSS2_OK = 0 , GSMGNSS2_ERROR = -1 }
 GSM/GNSS 2 Click return value data. More...
 

Functions

void gsmgnss2_cfg_setup (gsmgnss2_cfg_t *cfg)
 GSM/GNSS 2 configuration object setup function.
 
err_t gsmgnss2_init (gsmgnss2_t *ctx, gsmgnss2_cfg_t *cfg)
 GSM/GNSS 2 initialization function.
 
void gsmgnss2_module_power (gsmgnss2_t *ctx, uint8_t state)
 Power ON/OFF the module.
 
err_t gsmgnss2_generic_write (gsmgnss2_t *ctx, char *data_buf, uint16_t len)
 GSM/GNSS 2 data writing function.
 
err_t gsmgnss2_generic_read (gsmgnss2_t *ctx, char *data_buf, uint16_t max_len)
 GSM/GNSS 2 data reading function.
 
void gsmgnss2_send_cmd (gsmgnss2_t *ctx, char *cmd)
 Send command function.
 
void gsmgnss2_send_cmd_with_parameter (gsmgnss2_t *ctx, char *at_cmd_buf, char *param_buf)
 Send command function with parameter.
 
void gsmgnss2_send_cmd_check (gsmgnss2_t *ctx, char *at_cmd_buf)
 Check the sent command.
 
void gsmgnss2_send_cmd_parameter_check (gsmgnss2_t *ctx, char *at_cmd_buf)
 Check the command parameters.
 
void gsmgnss2_set_sim_apn (gsmgnss2_t *ctx, char *sim_apn)
 Set sim card APN.
 
void gsmgnss2_send_sms_text (gsmgnss2_t *ctx, char *phone_number, char *sms_text)
 GSM GNSS 2 send SMS in text mode.
 
err_t gsmgnss2_send_sms_pdu (gsmgnss2_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
 GSM GNSS 2 send SMS in PDU mode.
 
err_t gsmgnss2_parse_gngga (char *rsp_buf, uint8_t gngga_element, char *element_data)
 GSM GNSS 2 parse GNGGA function.
 

Detailed Description

This file contains API for GSM/GNSS 2 Click Driver.

Enumeration Type Documentation

◆ gsmgnss2_return_value_t

GSM/GNSS 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
GSMGNSS2_OK 
GSMGNSS2_ERROR