gsmgnss2 2.0.0.0
GSM/GNSS 2 Click Driver

API for configuring and manipulating GSM/GNSS 2 Click driver. More...

Topics

 GSM/GNSS 2 Device Settings
 Settings for registers of GSM/GNSS 2 Click driver.
 
 GSM/GNSS 2 MikroBUS Map
 MikroBUS pin mapping of GSM/GNSS 2 Click driver.
 

Functions

void gsmgnss2_cfg_setup (gsmgnss2_cfg_t *cfg)
 GSM/GNSS 2 configuration object setup function.
 
err_t gsmgnss2_init (gsmgnss2_t *ctx, gsmgnss2_cfg_t *cfg)
 GSM/GNSS 2 initialization function.
 
void gsmgnss2_module_power (gsmgnss2_t *ctx, uint8_t state)
 Power ON/OFF the module.
 
err_t gsmgnss2_generic_write (gsmgnss2_t *ctx, char *data_buf, uint16_t len)
 GSM/GNSS 2 data writing function.
 
err_t gsmgnss2_generic_read (gsmgnss2_t *ctx, char *data_buf, uint16_t max_len)
 GSM/GNSS 2 data reading function.
 
void gsmgnss2_send_cmd (gsmgnss2_t *ctx, char *cmd)
 Send command function.
 
void gsmgnss2_send_cmd_with_parameter (gsmgnss2_t *ctx, char *at_cmd_buf, char *param_buf)
 Send command function with parameter.
 
void gsmgnss2_send_cmd_check (gsmgnss2_t *ctx, char *at_cmd_buf)
 Check the sent command.
 
void gsmgnss2_send_cmd_parameter_check (gsmgnss2_t *ctx, char *at_cmd_buf)
 Check the command parameters.
 
void gsmgnss2_set_sim_apn (gsmgnss2_t *ctx, char *sim_apn)
 Set sim card APN.
 
void gsmgnss2_send_sms_text (gsmgnss2_t *ctx, char *phone_number, char *sms_text)
 GSM GNSS 2 send SMS in text mode.
 
err_t gsmgnss2_send_sms_pdu (gsmgnss2_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
 GSM GNSS 2 send SMS in PDU mode.
 
err_t gsmgnss2_parse_gngga (char *rsp_buf, uint8_t gngga_element, char *element_data)
 GSM GNSS 2 parse GNGGA function.
 

Detailed Description

API for configuring and manipulating GSM/GNSS 2 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ gsmgnss2_cfg_setup()

void gsmgnss2_cfg_setup ( gsmgnss2_cfg_t * cfg)

GSM/GNSS 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ gsmgnss2_generic_read()

err_t gsmgnss2_generic_read ( gsmgnss2_t * ctx,
char * data_buf,
uint16_t max_len )

GSM/GNSS 2 data reading function.

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

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

◆ gsmgnss2_generic_write()

err_t gsmgnss2_generic_write ( gsmgnss2_t * ctx,
char * data_buf,
uint16_t len )

GSM/GNSS 2 data writing function.

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

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

◆ gsmgnss2_init()

err_t gsmgnss2_init ( gsmgnss2_t * ctx,
gsmgnss2_cfg_t * cfg )

GSM/GNSS 2 initialization function.

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

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

◆ gsmgnss2_module_power()

void gsmgnss2_module_power ( gsmgnss2_t * ctx,
uint8_t state )

Power ON/OFF the module.

Parameters
ctxClick object.
state0 - power OFF, 1 - power ON.

◆ gsmgnss2_parse_gngga()

err_t gsmgnss2_parse_gngga ( char * rsp_buf,
uint8_t gngga_element,
char * element_data )

GSM GNSS 2 parse GNGGA function.

This function parses the GNGGA data from the read response buffer.

Parameters
[in]rsp_buf: Response buffer.
[in]gngga_element: GNGGA element position [1-14].
[out]element_data: Element data parsed.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gsmgnss2_send_cmd()

void gsmgnss2_send_cmd ( gsmgnss2_t * ctx,
char * cmd )

Send command function.

This function sends the specified command to the click module.

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

◆ gsmgnss2_send_cmd_check()

void gsmgnss2_send_cmd_check ( gsmgnss2_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 gsmgnss2_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
Returns
Nothing.

◆ gsmgnss2_send_cmd_parameter_check()

void gsmgnss2_send_cmd_parameter_check ( gsmgnss2_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 gsmgnss2_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
Returns
Nothing.

◆ gsmgnss2_send_cmd_with_parameter()

void gsmgnss2_send_cmd_with_parameter ( gsmgnss2_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 gsmgnss2_t object definition for detailed explanation.
[in]at_cmd_bufCommand buffer.
[in]param_bufParameter buffer.
Returns
Nothing.

◆ gsmgnss2_send_sms_pdu()

err_t gsmgnss2_send_sms_pdu ( gsmgnss2_t * ctx,
char * service_center_number,
char * phone_number,
char * sms_text )

GSM GNSS 2 send SMS in PDU mode.

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

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

◆ gsmgnss2_send_sms_text()

void gsmgnss2_send_sms_text ( gsmgnss2_t * ctx,
char * phone_number,
char * sms_text )

GSM GNSS 2 send SMS in text mode.

This function sends text message to a phone number.

Parameters
[in]ctx: Click context object. See gsmgnss2_t object definition for detailed explanation.
[in]phone_numberPhone number to message.
[in]message_contextMessage to be sent.
Returns
Nothing.

◆ gsmgnss2_set_sim_apn()

void gsmgnss2_set_sim_apn ( gsmgnss2_t * ctx,
char * sim_apn )

Set sim card APN.

This function sets APN for sim card.

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