lteiot2 2.0.0.0
lteiot2.h File Reference

This file contains API for LTE IoT 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  lteiot2_t
 Click ctx object definition. More...
 
struct  lteiot2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define LTEIOT2_MAP_MIKROBUS(cfg, mikrobus)
 
#define LTEIOT2_RETVAL   uint8_t
 
#define LTEIOT2_NMEA_GPGGA   1
 
#define LTEIOT2_NMEA_GPGGA_NUM_ELEMENT   15
 
#define LTEIOT2_GPGGA_TIME   1
 
#define LTEIOT2_GPGGA_LATITUDE   2
 
#define LTEIOT2_GPGGA_LATITUDE_SIDE   3
 
#define LTEIOT2_GPGGA_LONGITUDE   4
 
#define LTEIOT2_GPGGA_LONGITUDE_SIDE   5
 
#define LTEIOT2_GPGGA_QUALITY_INDICATOR   6
 
#define LTEIOT2_GPGGA_NUMBER_OF_SATELLITES   7
 
#define LTEIOT2_GPGGA_H_DILUTION_OF_POS   8
 
#define LTEIOT2_GPGGA_ALTITUDE   9
 
#define LTEIOT2_GPGGA_ALTITUDE_UNIT   10
 
#define LTEIOT2_GPGGA_GEOIDAL_SEPARATION   11
 
#define LTEIOT2_GPGGA_GEOIDAL_SEPARATION_UNIT   12
 
#define LTEIOT2_GPGGA_TIME_SINCE_LAST_DGPS   13
 
#define LTEIOT2_GPGGA_DGPS_REFERENCE_STATION_ID   14
 
#define LTEIOT2_ERROR_COMMAND_OR_ELEMENT   0xFF
 
#define LTEIOT2_ERROR_START_OR_END_COMMAND   0x8F
 
#define LTEIOT2_ERROR_NEXT_ELEMENT   0x4F
 
#define LTEIOT2_ERROR_CURRENT_ELEMENT   0x2F
 
#define LTEIOT2_NO_ERROR   0x00
 
#define LTEIOT2_MODULE_POWER_ON   1
 
#define LTEIOT2_MODULE_POWER_OFF   0
 
#define LTEIOT2_CMD_AT   "AT"
 
#define LTEIOT2_CMD_ATI   "ATI"
 
#define LTEIOT2_CMD_CGMR   "AT+CGMR"
 
#define LTEIOT2_CMD_CFUN   "AT+CFUN"
 
#define LTEIOT2_CMD_CREG   "AT+CREG"
 
#define LTEIOT2_CMD_CGDCONT   "AT+CGDCONT"
 
#define LTEIOT2_CMD_CIMI   "AT+CIMI"
 
#define LTEIOT2_CMD_CGATT   "AT+CGATT"
 
#define LTEIOT2_CMD_CSQ   "AT+CSQ"
 
#define LTEIOT2_CMD_COPS   "AT+COPS"
 
#define LTEIOT2_CMD_CMGS   "AT+CMGS"
 
#define LTEIOT2_CMD_CMGF   "AT+CMGF"
 
#define LTEIOT2_CMD_QGPS   "AT+QGPS"
 
#define LTEIOT2_CMD_QGPSCFG   "AT+QGPSCFG"
 
#define LTEIOT2_CMD_QGPSGNMEA   "AT+QGPSGNMEA"
 
#define LTEIOT2_CMD_QGPSLOC   "AT+QGPSLOC"
 
#define DRV_RX_BUFFER_SIZE   256
 
#define DRV_TX_BUFFER_SIZE   256
 

Typedefs

typedef uint8_t lteiot2_error_t
 Error type.
 

Enumerations

enum  lteiot2_return_value_t { LTEIOT2_OK = 0 , LTEIOT2_ERROR = -1 }
 LTE IoT 2 Click return value data. More...
 

Functions

void lteiot2_cfg_setup (lteiot2_cfg_t *cfg)
 Config Object Initialization function.
 
LTEIOT2_RETVAL lteiot2_init (lteiot2_t *ctx, lteiot2_cfg_t *cfg)
 Initialization function.
 
void lteiot2_module_power (lteiot2_t *ctx, uint8_t state)
 Power ON/OFF the module.
 
void lteiot2_generic_write (lteiot2_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
int32_t lteiot2_generic_read (lteiot2_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
void lteiot2_set_rts (lteiot2_t *ctx, uint8_t state)
 Sets state of the RTS pin.
 
uint8_t lteiot2_get_cts (lteiot2_t *ctx)
 CTS Pin Get function.
 
void lteiot2_send_cmd (lteiot2_t *ctx, char *cmd)
 Send command function.
 
void lteiot2_send_cmd_with_parameter (lteiot2_t *ctx, char *at_cmd_buf, char *param_buf)
 Send command function with parameter.
 
void lteiot2_send_cmd_check (lteiot2_t *ctx, char *at_cmd_buf)
 Check the sent command.
 
void lteiot2_send_cmd_parameter_check (lteiot2_t *ctx, char *at_cmd_buf)
 Check the command parameters.
 
void lteiot2_set_sim_apn (lteiot2_t *ctx, char *sim_apn)
 Set sim card APN.
 
void lteiot2_send_sms_text (lteiot2_t *ctx, char *phone_number, char *sms_text)
 LTE IoT 2 send SMS in text mode.
 
err_t lteiot2_send_sms_pdu (lteiot2_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
 LTE IoT 2 send SMS in PDU mode.
 
lteiot2_error_t lteiot2_generic_parser (char *rsp, uint8_t command, uint8_t element, char *parser_buf)
 Generic parser function.
 

Detailed Description

This file contains API for LTE IoT 2 Click driver.