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

LTE Cat.1 3 EX Click Example. More...

#include "board.h"
#include "log.h"
#include "ltecat13ex.h"
#include "generic_pointer.h"
#include "conversions.h"

Macros

#define EXAMPLE_TCP_UDP   0
 
#define EXAMPLE_SMS   1
 
#define EXAMPLE_CALL   2
 
#define EXAMPLE_GNSS   3
 
#define DEMO_EXAMPLE   EXAMPLE_TCP_UDP
 
#define SIM_APN   "internet"
 
#define SIM_SMSC   ""
 
#define PHONE_NUMBER   ""
 
#define SMS_MODE   "0"
 
#define REMOTE_IP   "77.46.162.162"
 
#define REMOTE_PORT   "51111"
 
#define MESSAGE_CONTENT   "LTE Cat.1 3 EX Click board - demo example."
 
#define APP_BUFFER_SIZE   500
 
#define PROCESS_BUFFER_SIZE   200
 
#define MIN_FUN_DEVICE   "0"
 
#define FULL_FUN_DEVICE   "1"
 
#define DEREGISTER_FROM_NETWORK   "2"
 
#define FULL_FUNCTIONALITY   "1"
 
#define ENABLE_REG   "2"
 
#define AUTOMATIC_REGISTRATION   "0"
 
#define CONNECTED_HOME   "+CREG: 2,1"
 
#define CONNECTED_ROAMING   "+CREG: 2,5"
 
#define ACTIVATE_CONTEXT   "1"
 
#define CONTEXT_ID   "1"
 
#define CONNECT_ID_TCP   "1"
 
#define SEVICE_TYPE_TCP   "\"TCP\""
 
#define LOCAL_PORT   "0"
 
#define ACCESS_MODE   "0"
 
#define MAX_READ_SIZE   "1500"
 
#define CONNECT_ID_UDP   "2"
 
#define SEVICE_TYPE_UDP   "\"UDP\""
 

Enumerations

enum  ltecat13ex_example_state_t { LTECAT13EX_CONFIGURE_FOR_NETWORK = 1, LTECAT13EX_WAIT_FOR_CONNECTION, LTECAT13EX_CONFIGURE_FOR_EXAMPLE, LTECAT13EX_EXAMPLE }
 Example states. More...
 

Functions

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

Detailed Description

LTE Cat.1 3 EX Click Example.

Description

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

The demo application is composed of two sections :

Application Init

Sets the device configuration for sending SMS, TCP/UDP messages, calling the selected number or GNSS location.

Application Task

Depending on the selected demo example, it sends an SMS message (in PDU or TXT mode) or a TCP/UDP message, calls the selected number or gets GNSS location.

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

◆ ACCESS_MODE

#define ACCESS_MODE   "0"

◆ ACTIVATE_CONTEXT

#define ACTIVATE_CONTEXT   "1"

◆ APP_BUFFER_SIZE

#define APP_BUFFER_SIZE   500

◆ AUTOMATIC_REGISTRATION

#define AUTOMATIC_REGISTRATION   "0"

◆ CONNECT_ID_TCP

#define CONNECT_ID_TCP   "1"

◆ CONNECT_ID_UDP

#define CONNECT_ID_UDP   "2"

◆ CONNECTED_HOME

#define CONNECTED_HOME   "+CREG: 2,1"

◆ CONNECTED_ROAMING

#define CONNECTED_ROAMING   "+CREG: 2,5"

◆ CONTEXT_ID

#define CONTEXT_ID   "1"

◆ DEMO_EXAMPLE

#define DEMO_EXAMPLE   EXAMPLE_TCP_UDP

◆ DEREGISTER_FROM_NETWORK

#define DEREGISTER_FROM_NETWORK   "2"

◆ ENABLE_REG

#define ENABLE_REG   "2"

◆ EXAMPLE_CALL

#define EXAMPLE_CALL   2

◆ EXAMPLE_GNSS

#define EXAMPLE_GNSS   3

◆ EXAMPLE_SMS

#define EXAMPLE_SMS   1

◆ EXAMPLE_TCP_UDP

#define EXAMPLE_TCP_UDP   0

◆ FULL_FUN_DEVICE

#define FULL_FUN_DEVICE   "1"

◆ FULL_FUNCTIONALITY

#define FULL_FUNCTIONALITY   "1"

◆ LOCAL_PORT

#define LOCAL_PORT   "0"

◆ MAX_READ_SIZE

#define MAX_READ_SIZE   "1500"

◆ MESSAGE_CONTENT

#define MESSAGE_CONTENT   "LTE Cat.1 3 EX Click board - demo example."

◆ MIN_FUN_DEVICE

#define MIN_FUN_DEVICE   "0"

◆ PHONE_NUMBER

#define PHONE_NUMBER   ""

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   200

◆ REMOTE_IP

#define REMOTE_IP   "77.46.162.162"

◆ REMOTE_PORT

#define REMOTE_PORT   "51111"

◆ SEVICE_TYPE_TCP

#define SEVICE_TYPE_TCP   "\"TCP\""

◆ SEVICE_TYPE_UDP

#define SEVICE_TYPE_UDP   "\"UDP\""

◆ SIM_APN

#define SIM_APN   "internet"

◆ SIM_SMSC

#define SIM_SMSC   ""

◆ SMS_MODE

#define SMS_MODE   "0"

Enumeration Type Documentation

◆ ltecat13ex_example_state_t

Example states.

Predefined enum values for application example state.

Enumerator
LTECAT13EX_CONFIGURE_FOR_NETWORK 
LTECAT13EX_WAIT_FOR_CONNECTION 
LTECAT13EX_CONFIGURE_FOR_EXAMPLE 
LTECAT13EX_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  )