|
#define | EXAMPLE_TCP_UDP 0 |
|
#define | EXAMPLE_SMS 1 |
|
#define | EXAMPLE_GNSS 2 |
|
#define | DEMO_EXAMPLE EXAMPLE_TCP_UDP |
|
#define | SIM_APN "" |
|
#define | SIM_SMSC "" |
|
#define | PHONE_NUMBER_TO_MESSAGE "" |
|
#define | SMS_MODE "1" |
|
#define | REMOTE_IP "77.46.162.162" |
|
#define | REMOTE_PORT "51111" |
|
#define | MESSAGE_CONTENT "LTE IoT 11 click board - demo example." |
|
#define | APP_BUFFER_SIZE 256 |
|
#define | PROCESS_BUFFER_SIZE 256 |
|
#define | RESTART_DEVICE "1,1" |
|
#define | DEREGISTER_FROM_NETWORK "2" |
|
#define | FULL_FUNCTIONALITY "1" |
|
#define | ENABLE_REG "2" |
|
#define | AUTOMATIC_REGISTRATION "0" |
|
#define | CONNECTED "+CREG: 1" |
|
#define | ACTIVATE_PDP_CONTEXT "1,1" |
|
#define | REQ_DYNAMIC_IP "1" |
|
#define | SRVTYPE_SOCKET ",srvtype,\"socket\"" |
|
#define | CONN_PROFILE ",conid,\"1\"" |
|
#define | ASCII_ALPHABET ",alphabet,1" |
|
#define | ADDRESS_TCP ",address,\"socktcp://" |
|
#define | ADDRESS_UDP ",address,\"sockudp://" |
|
LTE IoT 11 Click Example.
Description
Application example shows device capability of connecting to the network and sending SMS or TCP/UDP messages, or retrieving data from GNSS 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:
- LTEIOT11_CONFIGURE_FOR_NETWORK: Sets configuration to device to be able to connect to the network. (used only for SMS or TCP/UDP demo examples).
- LTEIOT11_WAIT_FOR_CONNECTION: Waits for the network registration indicated via CREG URC event and then checks the connection status (used only for SMS or TCP/UDP demo examples).
- LTEIOT11_CONFIGURE_FOR_EXAMPLE: Sets the device configuration for sending SMS or TCP/UDP messages or for retrieving data from GNSS depending on the selected demo example.
- LTEIOT11_EXAMPLE: Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or TCP/UDP message or waits for the GPS fix to retrieve location info from GNSS.
By default, the TCP/UDP example is selected.
Additional Function
- static void lteiot11_clear_app_buf ( void )
- static err_t lteiot11_process ( void )
- static void lteiot11_error_check( err_t error_flag )
- static void lteiot11_log_app_buf ( void )
- static err_t lteiot11_rsp_check ( uint8_t *rsp )
- static err_t lteiot11_configure_for_connection( void )
- static err_t lteiot11_check_connection( void )
- static err_t lteiot11_configure_for_messages( void )
- static err_t lteiot11_send_message( void )
- Note
- In order for the examples to work (except GNSS example), 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" In order to establish communication with the module, some of the supported MCUs may require the UART RX line to be pulled up additionally either with the external or internal weak pull-up resistor.
- Author
- Stefan Filipovic