nbiot4  2.0.0.0
Modules | Functions
NB IoT 4 Click Driver

API for configuring and manipulating NB IoT 4 Click driver. More...

Modules

 NB IoT 4 Commands List
 List of commands of NB IoT 4 Click driver.
 
 NB IoT 4 Device Settings
 Settings for registers of NB IoT 4 Click driver.
 
 NB IoT 4 MikroBUS Map
 MikroBUS pin mapping of NB IoT 4 Click driver.
 

Functions

void nbiot4_cfg_setup (nbiot4_cfg_t *cfg)
 NB IoT 4 configuration object setup function. More...
 
err_t nbiot4_init (nbiot4_t *ctx, nbiot4_cfg_t *cfg)
 NB IoT 4 initialization function. More...
 
err_t nbiot4_default_cfg (nbiot4_t *ctx)
 NB IoT 4 default configuration function. More...
 
err_t nbiot4_generic_write (nbiot4_t *ctx, char *data_buf, uint16_t len)
 NB IoT 4 data writing function. More...
 
err_t nbiot4_generic_read (nbiot4_t *ctx, char *data_buf, uint16_t max_len)
 NB IoT 4 data reading function. More...
 
void nbiot4_send_cmd (nbiot4_t *ctx, char *cmd)
 Send command function. More...
 
void nbiot4_send_cmd_with_parameter (nbiot4_t *ctx, char *at_cmd_buf, char *param_buf)
 Send command with parameters. More...
 
void nbiot4_send_cmd_check (nbiot4_t *ctx, char *at_cmd_buf)
 Send command to check commands current value. More...
 
void nbiot4_send_cmd_syntax_check (nbiot4_t *ctx, char *at_cmd_buf)
 Send command to check commands available parameters. More...
 
void nbiot4_set_sim_apn (nbiot4_t *ctx, char *sim_apn)
 Set SIM APN. More...
 
void nbiot4_send_text_message (nbiot4_t *ctx, char *phone_number, char *message_content)
 Send SMS message to number in text mode. More...
 
err_t nbiot4_send_sms_pdu (nbiot4_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
 Send SMS message to number in pdu mode. More...
 
void nbiot4_set_reset (nbiot4_t *ctx, uint8_t state)
 Set reset pin state. More...
 
void nbiot_set_ri (nbiot4_t *ctx, uint8_t state)
 Set ri pin state. More...
 

Detailed Description

API for configuring and manipulating NB IoT 4 Click driver.

Function Documentation

◆ nbiot4_cfg_setup()

void nbiot4_cfg_setup ( nbiot4_cfg_t cfg)

NB IoT 4 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See nbiot4_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ nbiot4_default_cfg()

err_t nbiot4_default_cfg ( nbiot4_t ctx)

NB IoT 4 default configuration function.

This function executes a default configuration of NB IoT 4 click board.

Parameters
[in]ctx: Click context object. See nbiot4_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ nbiot4_generic_read()

err_t nbiot4_generic_read ( nbiot4_t ctx,
char *  data_buf,
uint16_t  max_len 
)

NB IoT 4 data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See nbiot4_t object definition for detailed explanation.
[out]data_buf: Output read data.
[in]max_len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer.
See #err_t definition for detailed explanation.
Note
None.

◆ nbiot4_generic_write()

err_t nbiot4_generic_write ( nbiot4_t ctx,
char *  data_buf,
uint16_t  len 
)

NB IoT 4 data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See nbiot4_t object definition for detailed explanation.
[in]data_buf: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ nbiot4_init()

err_t nbiot4_init ( nbiot4_t ctx,
nbiot4_cfg_t cfg 
)

NB IoT 4 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See nbiot4_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See nbiot4_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ nbiot4_send_cmd()

void nbiot4_send_cmd ( nbiot4_t ctx,
char *  cmd 
)

Send command function.

Send string byte by byte and additionaly send CR flag.

Parameters
[in]ctx: Click context object. See nbiot4_t object definition for detailed explanation.
[in]cmd: Command variable.
Returns
Nothing.

◆ nbiot4_send_cmd_check()

void nbiot4_send_cmd_check ( nbiot4_t ctx,
char *  at_cmd_buf 
)

Send command to check commands current value.

Send AT command (at_cmd_buf) and appends '?' to check commands value.

Parameters
[in]ctx: Click context object. See nbiot4_t object definition for detailed explanation.
[in]at_cmd_buf: AT command.
Returns
Nothing.

◆ nbiot4_send_cmd_syntax_check()

void nbiot4_send_cmd_syntax_check ( nbiot4_t ctx,
char *  at_cmd_buf 
)

Send command to check commands available parameters.

Send AT command (at_cmd_buf) and appends '?' to check commands value.

Parameters
[in]ctx: Click context object. See nbiot4_t object definition for detailed explanation.
[in]at_cmd_buf: AT command.
Returns
Nothing.

◆ nbiot4_send_cmd_with_parameter()

void nbiot4_send_cmd_with_parameter ( nbiot4_t ctx,
char *  at_cmd_buf,
char *  param_buf 
)

Send command with parameters.

Send AT command (at_cmd_buf) with '=' and parameter(param_buf) to set commands value.

Parameters
[in]ctx: Click context object. See nbiot4_t object definition for detailed explanation.
[in]at_cmd_buf: AT command.
[in]param_buf: Parameter for AT command.
Returns
Nothing.

◆ nbiot4_send_sms_pdu()

err_t nbiot4_send_sms_pdu ( nbiot4_t ctx,
char *  service_center_number,
char *  phone_number,
char *  sms_text 
)

Send SMS message to number in pdu mode.

This function sends text message to a phone number in PDU mode.

Parameters
[in]ctx: Click context object. See #gsmgps_t object definition for detailed explanation.
[in]service_center_numberSMSC of the SIM card.
[in]phone_numberPhone number to message.
[in]sms_textMessage to be sent.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.

◆ nbiot4_send_text_message()

void nbiot4_send_text_message ( nbiot4_t ctx,
char *  phone_number,
char *  message_content 
)

Send SMS message to number in text mode.

Send command for SIM message with function parameters for device to send SMS message.

Parameters
[in]ctx: Click context object. See nbiot4_t object definition for detailed explanation.
[in]phone_number: Phone number to send message to.
[in]message_context: Content of the message.
Returns
Nothing.
Note
Device should be configured for text message before sending text message.

◆ nbiot4_set_reset()

void nbiot4_set_reset ( nbiot4_t ctx,
uint8_t  state 
)

Set reset pin state.

Set rst pin to the selected logic level.

Parameters
[in]ctx: Click context object. See nbiot4_t object definition for detailed explanation.
[in]state: Logic level.
Returns
Nothing.

◆ nbiot4_set_sim_apn()

void nbiot4_set_sim_apn ( nbiot4_t ctx,
char *  sim_apn 
)

Set SIM APN.

Send command to select SIM APN.

Parameters
[in]ctx: Click context object. See nbiot4_t object definition for detailed explanation.
[in]sim_apn: SIM APN.
Returns
Nothing.

◆ nbiot_set_ri()

void nbiot_set_ri ( nbiot4_t ctx,
uint8_t  state 
)

Set ri pin state.

Set ri pin to the selected logic level.

Parameters
[in]ctx: Click context object. See nbiot4_t object definition for detailed explanation.
[in]state: Logic level.
Returns
Nothing.