nbiot4 2.0.0.0
nbiot4.h File Reference

This file contains API for NB IoT 4 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  nbiot4_t
 NB IoT 4 Click context object. More...
 
struct  nbiot4_cfg_t
 NB IoT 4 Click configuration object. More...
 

Macros

#define NBIOT4_CMD_AT   "AT"
 NB IoT 4 control commands.
 
#define NBIOT4_CMD_ATE1   "ATE1"
 
#define NBIOT4_CMD_CFUN   "AT+CFUN"
 
#define NBIOT4_CMD_CREG   "AT+CREG"
 
#define NBIOT4_CMD_CEREG   "AT+CEREG"
 
#define NBIOT4_CMD_CGDCONT   "AT+CGDCONT"
 
#define NBIOT4_CMD_CSQ   "AT+CSQ"
 
#define NBIOT4_CMD_COPS   "AT+COPS"
 
#define NBIOT4_CMD_CMGS   "AT+CMGS"
 
#define NBIOT4_CMD_CMGF   "AT+CMGF"
 
#define NBIOT4_CMD_SIMSWAP   "AT^SIMSWAP"
 
#define NBIOT4_CMD_TRB   "AT+TRB"
 
#define NBIOT4_CMD_CIPMUX   "AT+CIPMUX"
 
#define NBIOT4_CMD_CIPSTART   "AT+CIPSTART"
 
#define NBIOT4_CMD_CIPCLOSE   "AT+CIPCLOSE"
 
#define NBIOT4_CMD_CIPSEND   "AT+CIPSEND"
 
#define NBIOT4_CMD_CIPHEAD   "AT+CIPHEAD"
 
#define NBIOT4_RSP_OK   "OK"
 NB IoT 4 device response for AT commands.
 
#define NBIOT4_RSP_ERROR   "ERROR"
 
#define NBIOT4_RSP_REBOOTING   "REBOOTING"
 
#define NBIOT4_RX_DRV_BUFFER_SIZE   256
 NB IoT 4 driver buffer size.
 
#define NBIOT4_TX_DRV_BUFFER_SIZE   256
 
#define NBIOT4_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  nbiot4_return_value_t {
  NBIOT4_OK = 0 , NBIOT4_ERROR = -1 , NBIOT4_ERROR_TIMEOUT = -2 , NBIOT4_ERROR_CMD = -3 ,
  NBIOT4_ERROR_UNKNOWN = -4
}
 NB IoT 4 Click return value data. More...
 

Functions

void nbiot4_cfg_setup (nbiot4_cfg_t *cfg)
 NB IoT 4 configuration object setup function.
 
err_t nbiot4_init (nbiot4_t *ctx, nbiot4_cfg_t *cfg)
 NB IoT 4 initialization function.
 
err_t nbiot4_generic_write (nbiot4_t *ctx, uint8_t *data_in, uint16_t len)
 NB IoT 4 data writing function.
 
err_t nbiot4_generic_read (nbiot4_t *ctx, uint8_t *data_out, uint16_t len)
 NB IoT 4 data reading function.
 
void nbiot4_set_rst_pin (nbiot4_t *ctx, uint8_t state)
 NB IoT 4 set rst pin function.
 
void nbiot4_set_cs_pin (nbiot4_t *ctx, uint8_t state)
 NB IoT 4 set cs pin function.
 
uint8_t nbiot4_get_ring_pin (nbiot4_t *ctx)
 NB IoT 4 get ring pin function.
 
void nbiot4_send_cmd (nbiot4_t *ctx, uint8_t *cmd)
 Send command function.
 
void nbiot4_send_cmd_with_par (nbiot4_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf)
 Send command function with parameter.
 
void nbiot4_send_cmd_check (nbiot4_t *ctx, uint8_t *at_cmd_buf)
 Check the sent command.
 
void nbiot4_send_cmd_par_check (nbiot4_t *ctx, uint8_t *at_cmd_buf)
 Check the command parameters.
 
void nbiot4_set_sim_apn (nbiot4_t *ctx, uint8_t *sim_apn)
 Set sim card APN.
 
void nbiot4_send_sms_text (nbiot4_t *ctx, uint8_t *phone_number, uint8_t *sms_text)
 NB IoT 4 send SMS in text mode.
 
err_t nbiot4_send_sms_pdu (nbiot4_t *ctx, uint8_t *service_center_number, uint8_t *phone_number, uint8_t *sms_text)
 NB IoT 4 send SMS in PDU mode.
 

Detailed Description

This file contains API for NB IoT 4 Click Driver.

Enumeration Type Documentation

◆ nbiot4_return_value_t

NB IoT 4 Click return value data.

Predefined enum values for driver return values.

Enumerator
NBIOT4_OK 
NBIOT4_ERROR 
NBIOT4_ERROR_TIMEOUT 
NBIOT4_ERROR_CMD 
NBIOT4_ERROR_UNKNOWN