GSM 2 Click Example.
Description
Application example shows device capability of connecting to the network and sending SMS or TCP/UDP messages using standard "AT" commands.
The demo application is composed of two sections :
Application Init
Initializes the driver, tests the communication by sending "AT" command, and after that restarts the device.
Application Task
Application task is split in few stages:
- GSM2_CONFIGURE_FOR_NETWORK: Sets configuration to device to be able to connect to the network.
- GSM2_WAIT_FOR_CONNECTION: Waits for the network registration indicated via CREG URC event and then checks the connection status.
- GSM2_CONFIGURE_FOR_EXAMPLE: Sets the device configuration for sending SMS or TCP/UDP messages depending on the selected demo example.
- GSM2_EXAMPLE: Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or TCP/UDP message.
By default, the TCP/UDP example is selected.
Additional Function
- static void gsm2_clear_app_buf ( void )
- static err_t gsm2_process ( void )
- static void gsm2_error_check( err_t error_flag )
- static void gsm2_log_app_buf ( void )
- static err_t gsm2_rsp_check ( uint8_t *rsp )
- static err_t gsm2_configure_for_connection( void )
- static err_t gsm2_check_connection( void )
- static err_t gsm2_configure_for_messages( void )
- static err_t gsm2_send_message( void )
- Note
- In order for the examples to work, user needs to set the APN and SMSC (SMS PDU mode only) of entered SIM card as well as the phone number (SMS mode only) to which he wants to send an SMS. Enter valid values for the following macros: SIM_APN, SIM_SMSC and PHONE_NUMBER_TO_MESSAGE. Example: SIM_APN "internet" SIM_SMSC "+381610401" PHONE_NUMBER_TO_MESSAGE "+381659999999"
- Author
- Stefan Filipovic