gsmgnss2 2.0.0.0
|
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. | |
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.
void gsmgnss2_cfg_setup | ( | gsmgnss2_cfg_t * | cfg | ) |
GSM/GNSS 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See gsmgnss2_cfg_t object definition for detailed explanation. |
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.
[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. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. See #err_t definition for detailed explanation. 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.
[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. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void gsmgnss2_module_power | ( | gsmgnss2_t * | ctx, |
uint8_t | state ) |
Power ON/OFF the module.
ctx | Click object. |
state | 0 - power OFF, 1 - power ON. |
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.
[in] | rsp_buf | : Response buffer. |
[in] | gngga_element | : GNGGA element position [1-14]. |
[out] | element_data | : Element data parsed. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void gsmgnss2_send_cmd | ( | gsmgnss2_t * | ctx, |
char * | cmd ) |
Send command function.
This function sends the specified command to the click module.
[in] | ctx | : Click context object. See gsmgnss2_t object definition for detailed explanation. |
[in] | cmd | Command variable. |
void gsmgnss2_send_cmd_check | ( | gsmgnss2_t * | ctx, |
char * | at_cmd_buf ) |
Check the sent command.
This function checks the command that is sent.
[in] | ctx | : Click context object. See gsmgnss2_t object definition for detailed explanation. |
[in] | at_cmd_buf | Command buffer. |
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.
[in] | ctx | : Click context object. See gsmgnss2_t object definition for detailed explanation. |
[in] | at_cmd_buf | Command buffer. |
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.
[in] | ctx | : Click context object. See gsmgnss2_t object definition for detailed explanation. |
[in] | at_cmd_buf | Command buffer. |
[in] | param_buf | Parameter buffer. |
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.
[in] | ctx | : Click context object. See gsmgnss2_t object definition for detailed explanation. |
[in] | service_center_number | SMSC of the SIM card. |
[in] | phone_number | Phone number to message. |
[in] | sms_text | Message to be sent. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See gsmgnss2_t object definition for detailed explanation. |
[in] | phone_number | Phone number to message. |
[in] | message_context | Message to be sent. |
void gsmgnss2_set_sim_apn | ( | gsmgnss2_t * | ctx, |
char * | sim_apn ) |
Set sim card APN.
This function sets APN for sim card.
[in] | ctx | : Click context object. See gsmgnss2_t object definition for detailed explanation. |
[in] | sim_apn | SIM card APN. |