c3gsara 2.0.0.0
c3gsara.h File Reference

This file contains API for 3G SARA 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  c3gsara_t
 3G SARA Click context object. More...
 
struct  c3gsara_cfg_t
 3G SARA Click configuration object. More...
 

Macros

#define C3GSARA_CMD_AT   "AT"
 3G SARA control commands.
 
#define C3GSARA_CMD_ATI   "ATI"
 
#define C3GSARA_CMD_CFUN   "AT+CFUN"
 
#define C3GSARA_CMD_CREG   "AT+CREG"
 
#define C3GSARA_CMD_CGDCONT   "AT+CGDCONT"
 
#define C3GSARA_CMD_CSQ   "AT+CSQ"
 
#define C3GSARA_CMD_COPS   "AT+COPS"
 
#define C3GSARA_CMD_CMGS   "AT+CMGS"
 
#define C3GSARA_CMD_CMGF   "AT+CMGF"
 
#define C3GSARA_CMD_CGACT   "AT+CGACT"
 
#define C3GSARA_CMD_UPSDA   "AT+UPSDA"
 
#define C3GSARA_CMD_USOCR   "AT+USOCR"
 
#define C3GSARA_CMD_USOCO   "AT+USOCO"
 
#define C3GSARA_CMD_USOWR   "AT+USOWR"
 
#define C3GSARA_CMD_USORD   "AT+USORD"
 
#define C3GSARA_CMD_USORF   "AT+USORF"
 
#define C3GSARA_CMD_USOCL   "AT+USOCL"
 
#define C3GSARA_RSP_OK   "OK"
 3G SARA device response for AT commands.
 
#define C3GSARA_RSP_ERROR   "ERROR"
 
#define C3GSARA_POWER_STATE_OFF   0
 3G SARA power state settings.
 
#define C3GSARA_POWER_STATE_ON   1
 
#define C3GSARA_RX_DRV_BUFFER_SIZE   256
 3G SARA driver buffer size.
 
#define C3GSARA_TX_DRV_BUFFER_SIZE   256
 
#define C3GSARA_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  c3gsara_return_value_t {
  C3GSARA_OK = 0 , C3GSARA_ERROR = -1 , C3GSARA_ERROR_TIMEOUT = -2 , C3GSARA_ERROR_CMD = -3 ,
  C3GSARA_ERROR_UNKNOWN = -4
}
 3G SARA Click return value data. More...
 

Functions

void c3gsara_cfg_setup (c3gsara_cfg_t *cfg)
 3G SARA configuration object setup function.
 
err_t c3gsara_init (c3gsara_t *ctx, c3gsara_cfg_t *cfg)
 3G SARA initialization function.
 
err_t c3gsara_generic_write (c3gsara_t *ctx, uint8_t *data_in, uint16_t len)
 3G SARA data writing function.
 
err_t c3gsara_generic_read (c3gsara_t *ctx, uint8_t *data_out, uint16_t len)
 3G SARA data reading function.
 
void c3gsara_set_power_state (c3gsara_t *ctx, uint8_t state)
 3G SARA set power state function.
 
void c3gsara_set_rts_pin (c3gsara_t *ctx, uint8_t state)
 3G SARA set rts pin function.
 
void c3gsara_set_pwk_pin (c3gsara_t *ctx, uint8_t state)
 3G SARA set pwk pin function.
 
uint8_t c3gsara_get_cts_pin (c3gsara_t *ctx)
 3G SARA get cts pin function.
 
uint8_t c3gsara_get_sta_pin (c3gsara_t *ctx)
 3G SARA get sta pin function.
 
uint8_t c3gsara_get_ring_pin (c3gsara_t *ctx)
 3G SARA get ring pin function.
 
void c3gsara_send_cmd (c3gsara_t *ctx, uint8_t *cmd)
 Send command function.
 
void c3gsara_send_cmd_with_par (c3gsara_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
 Send command function with parameter.
 
void c3gsara_send_cmd_check (c3gsara_t *ctx, uint8_t *at_cmd_buf)
 Check the sent command.
 
void c3gsara_send_cmd_par_check (c3gsara_t *ctx, uint8_t *at_cmd_buf)
 Check the command parameters.
 
void c3gsara_set_sim_apn (c3gsara_t *ctx, uint8_t *sim_apn)
 Set sim card APN.
 
void c3gsara_send_sms_text (c3gsara_t *ctx, uint8_t *phone_number, uint8_t *sms_text)
 3G SARA send SMS in text mode.
 
err_t c3gsara_send_sms_pdu (c3gsara_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text)
 3G SARA send SMS in PDU mode.
 

Detailed Description

This file contains API for 3G SARA Click Driver.

Enumeration Type Documentation

◆ c3gsara_return_value_t

3G SARA Click return value data.

Predefined enum values for driver return values.

Enumerator
C3GSARA_OK 
C3GSARA_ERROR 
C3GSARA_ERROR_TIMEOUT 
C3GSARA_ERROR_CMD 
C3GSARA_ERROR_UNKNOWN