c5gnbiot  2.0.0.0
Functions
Public function

Functions

void c5gnbiot_cfg_setup (c5gnbiot_cfg_t *cfg)
 5G NB IoT configuration object setup function. More...
 
err_t c5gnbiot_init (c5gnbiot_t *ctx, c5gnbiot_cfg_t *cfg)
 5G NB IoT initialization function. More...
 
err_t c5gnbiot_generic_write (c5gnbiot_t *ctx, char *data_buf, uint16_t len)
 5G NB IoT data writing function. More...
 
err_t c5gnbiot_generic_read (c5gnbiot_t *ctx, char *data_buf, uint16_t max_len)
 5G NB IoT data reading function. More...
 
void c5gnbiot_power_on (c5gnbiot_t *ctx)
 5G NB IoT module power on. More...
 
void c5gnbiot_set_on (c5gnbiot_t *ctx, uint8_t state)
 Sets state of the ON pin. More...
 
void c5gnbiot_set_rts (c5gnbiot_t *ctx, uint8_t state)
 Sets state of the RTS pin. More...
 
uint8_t c5gnbiot_get_cts (c5gnbiot_t *ctx)
 CTS Pin Get function. More...
 
void c5gnbiot_send_cmd (c5gnbiot_t *ctx, char *cmd)
 Send command function. More...
 
void c5gnbiot_send_cmd_with_parameter (c5gnbiot_t *ctx, char *at_cmd_buf, char *param_buf)
 Send command function with parameter. More...
 
void c5gnbiot_send_cmd_check (c5gnbiot_t *ctx, char *at_cmd_buf)
 Check the sent command. More...
 
void c5gnbiot_send_cmd_parameter_check (c5gnbiot_t *ctx, char *at_cmd_buf)
 Check the command parameters. More...
 
void c5gnbiot_set_sim_apn (c5gnbiot_t *ctx, char *sim_apn)
 Set sim card APN. More...
 
err_t c5gnbiot_send_text_message (c5gnbiot_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
 5G NB IoT send SMS in PDU mode. More...
 

Detailed Description

Function Documentation

◆ c5gnbiot_cfg_setup()

void c5gnbiot_cfg_setup ( c5gnbiot_cfg_t cfg)

5G NB IoT configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ c5gnbiot_generic_read()

err_t c5gnbiot_generic_read ( c5gnbiot_t ctx,
char *  data_buf,
uint16_t  max_len 
)

5G NB IoT data reading function.

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

Parameters
[in]ctx: Click context object. See c5gnbiot_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.

◆ c5gnbiot_generic_write()

err_t c5gnbiot_generic_write ( c5gnbiot_t ctx,
char *  data_buf,
uint16_t  len 
)

5G NB IoT data writing function.

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

Parameters
[in]ctx: Click context object. See c5gnbiot_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.

◆ c5gnbiot_get_cts()

uint8_t c5gnbiot_get_cts ( c5gnbiot_t ctx)

CTS Pin Get function.

This function allows user to check state of the CTS pin.

Parameters
[in]ctx: Click context object. See c5gnbiot_t object definition for detailed explanation.
Returns
  • 0 logical low.
  • 1 logical high.

◆ c5gnbiot_init()

err_t c5gnbiot_init ( c5gnbiot_t ctx,
c5gnbiot_cfg_t cfg 
)

5G NB IoT initialization function.

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

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

◆ c5gnbiot_power_on()

void c5gnbiot_power_on ( c5gnbiot_t ctx)

5G NB IoT module power on.

This function resets the chip on 5G NB IoT Click.

Parameters
[in]ctx: Click context object. See c5gnbiot_t object definition for detailed explanation.
Returns
Nothing.

◆ c5gnbiot_send_cmd()

void c5gnbiot_send_cmd ( c5gnbiot_t ctx,
char *  cmd 
)

Send command function.

This function sends the specified command to the Click module.

Parameters
[in]ctx: Click context object. See c5gnbiot_t object definition for detailed explanation.
[in]cmdCommand variable.
Returns
Nothing.

◆ c5gnbiot_send_cmd_check()

void c5gnbiot_send_cmd_check ( c5gnbiot_t ctx,
char *  at_cmd_buf 
)

Check the sent command.

This function checks the command that is sent.

Parameters
[in]ctx: Click context object. See c5gnbiot_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
Returns
Nothing.

◆ c5gnbiot_send_cmd_parameter_check()

void c5gnbiot_send_cmd_parameter_check ( c5gnbiot_t ctx,
char *  at_cmd_buf 
)

Check the command parameters.

This function checks the command that is sent.

Parameters
[in]ctx: Click context object. See c5gnbiot_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
Returns
Nothing.

◆ c5gnbiot_send_cmd_with_parameter()

void c5gnbiot_send_cmd_with_parameter ( c5gnbiot_t ctx,
char *  at_cmd_buf,
char *  param_buf 
)

Send command function with parameter.

This function sends commands to the Click module.

Parameters
[in]ctx: Click context object. See c5gnbiot_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
[in]param_bufParameter buffer.
Returns
Nothing.

◆ c5gnbiot_send_text_message()

err_t c5gnbiot_send_text_message ( c5gnbiot_t ctx,
char *  service_center_number,
char *  phone_number,
char *  sms_text 
)

5G NB IoT send SMS in PDU mode.

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

Parameters
[in]ctx: Click context object. See c5gnbiot_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.

◆ c5gnbiot_set_on()

void c5gnbiot_set_on ( c5gnbiot_t ctx,
uint8_t  state 
)

Sets state of the ON pin.

This function sets ON pin state.

Parameters
[in]ctx: Click context object. See c5gnbiot_t object definition for detailed explanation.
[in]statePin state ( 1 or 0 ).
Returns
Nothing.

◆ c5gnbiot_set_rts()

void c5gnbiot_set_rts ( c5gnbiot_t ctx,
uint8_t  state 
)

Sets state of the RTS pin.

This function sets RTS pin state.

Parameters
[in]ctx: Click context object. See c5gnbiot_t object definition for detailed explanation.
[in]statePin state ( 1 or 0 ).
Returns
Nothing.

◆ c5gnbiot_set_sim_apn()

void c5gnbiot_set_sim_apn ( c5gnbiot_t ctx,
char *  sim_apn 
)

Set sim card APN.

This function sets APN for sim card.

Parameters
[in]ctx: Click context object. See c5gnbiot_t object definition for detailed explanation.
[in]sim_apnSIM card APN.
Returns
Nothing.