lteiot12 2.1.0.0
Macros | Enumerations | Functions
main.c File Reference

LTE IoT 12 Click Example. More...

#include "board.h"
#include "log.h"
#include "lteiot12.h"
#include "conversions.h"

Macros

#define PROCESS_BUFFER_SIZE   300
 
#define TCP_UDP_EXAMPLE   0
 
#define SMS_EXAMPLE   1
 
#define GNSS_EXAMPLE   2
 
#define DEMO_EXAMPLE   SMS_EXAMPLE
 
#define SMS_PDU_MODE   0
 
#define SMS_TEXT_MODE   1
 
#define SMS_DEMO_EXAMPLE   SMS_TEXT_MODE
 
#define SIM_APN   "vipmobile"
 
#define SIM_SMSC   "+381610401"
 
#define PHONE_NUMBER_TO_MESSAGE   "+381621702719"
 
#define REMOTE_IP   "77.46.162.162"
 
#define REMOTE_PORT   "51111"
 
#define MESSAGE_CONTENT   "LTE IoT 12 Click Example"
 
#define LTEIOT12_MIN_FUN   "0"
 
#define LTEIOT12_FULL_FUN   "1"
 
#define LTEIOT12_DISABLE_PSM   "1"
 
#define LTEIOT12_EN_LOCATION_AND_NETWORK   "2"
 
#define LTEIOT12_DISABLE_SLEEP   "0"
 
#define LTEIOT12_CHAR_SET_GMS   "\"GSM\""
 
#define LTEIOT12_TURN_ON_GNSS   "1"
 
#define LTEIOT12_CONFIG_GNSS   "\"nmeasrc\",1"
 
#define CONNECTED   "+CGATT: 1"
 
#define LTEIOT12_EN_LOCATION_AND_NETWORK   "2"
 
#define LTEIOT12_TEXT_MODE   "1"
 
#define LTEIOT12_PS_ATTACHED   "1"
 
#define LTEIOT12_URC_ENABLE   "1"
 
#define CONTEXTID   "1"
 
#define TCP_PROTOCOL   "0"
 
#define UDP_PROTOCOL   "1"
 
#define URC_READ_SOCKET_DATA   "+QIURC: \"recv\""
 
#define TCP   "TCP"
 
#define UDP   "UDP"
 
#define LTEIOT12_TCP_SOCKET_OPEN   "QIOPEN: 0,0"
 
#define LTEIOT12_UDP_SOCKET_OPEN   "QIOPEN: 1,0"
 

Enumerations

enum  ltelte12_example_state_t { LTEIOT12_CONFIGURE_FOR_EXAMPLE = 1 , LTEIOT12_EXAMPLE }
 Example states. More...
 

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

LTE IoT 12 Click Example.

Description

Application example shows device capability of connecting to the network and sending SMS, TCP/UDP messages or getting GNSS data using standard "AT" commands.

The demo application is composed of two sections :

Application Init

Sets the device configuration for sending SMS, TCP/UDP messages or getting GNSS data.

Application Task

Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or a TCP/UDP message or getting GNSS data ( position and altitude ).

Additional Function

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 Ilic

Macro Definition Documentation

◆ CONNECTED

#define CONNECTED   "+CGATT: 1"

◆ CONTEXTID

#define CONTEXTID   "1"

◆ DEMO_EXAMPLE

#define DEMO_EXAMPLE   SMS_EXAMPLE

◆ GNSS_EXAMPLE

#define GNSS_EXAMPLE   2

◆ LTEIOT12_CHAR_SET_GMS

#define LTEIOT12_CHAR_SET_GMS   "\"GSM\""

◆ LTEIOT12_CONFIG_GNSS

#define LTEIOT12_CONFIG_GNSS   "\"nmeasrc\",1"

◆ LTEIOT12_DISABLE_PSM

#define LTEIOT12_DISABLE_PSM   "1"

◆ LTEIOT12_DISABLE_SLEEP

#define LTEIOT12_DISABLE_SLEEP   "0"

◆ LTEIOT12_EN_LOCATION_AND_NETWORK [1/2]

#define LTEIOT12_EN_LOCATION_AND_NETWORK   "2"

◆ LTEIOT12_EN_LOCATION_AND_NETWORK [2/2]

#define LTEIOT12_EN_LOCATION_AND_NETWORK   "2"

◆ LTEIOT12_FULL_FUN

#define LTEIOT12_FULL_FUN   "1"

◆ LTEIOT12_MIN_FUN

#define LTEIOT12_MIN_FUN   "0"

◆ LTEIOT12_PS_ATTACHED

#define LTEIOT12_PS_ATTACHED   "1"

◆ LTEIOT12_TCP_SOCKET_OPEN

#define LTEIOT12_TCP_SOCKET_OPEN   "QIOPEN: 0,0"

◆ LTEIOT12_TEXT_MODE

#define LTEIOT12_TEXT_MODE   "1"

◆ LTEIOT12_TURN_ON_GNSS

#define LTEIOT12_TURN_ON_GNSS   "1"

◆ LTEIOT12_UDP_SOCKET_OPEN

#define LTEIOT12_UDP_SOCKET_OPEN   "QIOPEN: 1,0"

◆ LTEIOT12_URC_ENABLE

#define LTEIOT12_URC_ENABLE   "1"

◆ MESSAGE_CONTENT

#define MESSAGE_CONTENT   "LTE IoT 12 Click Example"

◆ PHONE_NUMBER_TO_MESSAGE

#define PHONE_NUMBER_TO_MESSAGE   "+381621702719"

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   300

◆ REMOTE_IP

#define REMOTE_IP   "77.46.162.162"

◆ REMOTE_PORT

#define REMOTE_PORT   "51111"

◆ SIM_APN

#define SIM_APN   "vipmobile"

◆ SIM_SMSC

#define SIM_SMSC   "+381610401"

◆ SMS_DEMO_EXAMPLE

#define SMS_DEMO_EXAMPLE   SMS_TEXT_MODE

◆ SMS_EXAMPLE

#define SMS_EXAMPLE   1

◆ SMS_PDU_MODE

#define SMS_PDU_MODE   0

◆ SMS_TEXT_MODE

#define SMS_TEXT_MODE   1

◆ TCP

#define TCP   "TCP"

◆ TCP_PROTOCOL

#define TCP_PROTOCOL   "0"

◆ TCP_UDP_EXAMPLE

#define TCP_UDP_EXAMPLE   0

◆ UDP

#define UDP   "UDP"

◆ UDP_PROTOCOL

#define UDP_PROTOCOL   "1"

◆ URC_READ_SOCKET_DATA

#define URC_READ_SOCKET_DATA   "+QIURC: \"recv\""

Enumeration Type Documentation

◆ ltelte12_example_state_t

Example states.

Predefined enum values for application example state.

Enumerator
LTEIOT12_CONFIGURE_FOR_EXAMPLE 
LTEIOT12_EXAMPLE 

Function Documentation

◆ application_init()

void application_init ( void  )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void  )

◆ main()

int main ( void  )