nbiot5  2.0.0.0
Macros | Functions
main.c File Reference

NB IoT 5 Click Example. More...

#include "board.h"
#include "log.h"
#include "nbiot5.h"

Macros

#define APP_OK   0
 
#define APP_ERROR_DRIVER   -1
 
#define APP_ERROR_OVERFLOW   -2
 
#define APP_ERROR_TIMEOUT   -3
 
#define RSP_OK   "OK"
 
#define RSP_ERROR   "ERROR"
 
#define SIM_APN   ""
 
#define PHONE_NUMBER_TO_MESSAGE   ""
 
#define MESSAGE_CONTENT   "NB IoT 5 Click"
 
#define PROCESS_BUFFER_SIZE   200
 
#define WAIT_FOR_CONNECTION   0
 
#define CONNECTED_TO_NETWORK   1
 
#define CHECK_CONNECTION   "AT+CGATT?"
 
#define CONNECTED   "+CGATT: 1"
 
#define NOT_CONNECTED   "+CGATT: 0"
 

Functions

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

Detailed Description

NB IoT 5 Click Example.

Description

This example reads and processes data from NB IoT 5 clicks. It configures device for connection to network, and checks if device is connected, and signal quality. After it connects, it sends SMS message to phone number set in application.

The demo application is composed of two sections :

Application Init

Initializes driver and wake-up module, and sets default configuration for connection.

Application Task

Checks if device is connected to network, when device connects to network device is sending SMS message to selected phone number.

Additional Function

note: In order for the example to work, user needs to set the phone number to which he wants to send an SMS and correct sim apn of its SIM card. Enter valid data for the following macros: SIM_APN and PHONE_NUMBER_TO_MESSAGE. E.g. SIM_APN "vip.iot" PHONE_NUMBER_TO_MESSAGE "999999999"

    *You need to have USB connected to device in the beggining of 
     the application for additional power on startup.*
Author
Luka Filipovic

Macro Definition Documentation

◆ APP_ERROR_DRIVER

#define APP_ERROR_DRIVER   -1

◆ APP_ERROR_OVERFLOW

#define APP_ERROR_OVERFLOW   -2

◆ APP_ERROR_TIMEOUT

#define APP_ERROR_TIMEOUT   -3

◆ APP_OK

#define APP_OK   0

◆ CHECK_CONNECTION

#define CHECK_CONNECTION   "AT+CGATT?"

◆ CONNECTED

#define CONNECTED   "+CGATT: 1"

◆ CONNECTED_TO_NETWORK

#define CONNECTED_TO_NETWORK   1

◆ MESSAGE_CONTENT

#define MESSAGE_CONTENT   "NB IoT 5 Click"

◆ NOT_CONNECTED

#define NOT_CONNECTED   "+CGATT: 0"

◆ PHONE_NUMBER_TO_MESSAGE

#define PHONE_NUMBER_TO_MESSAGE   ""

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   200

◆ RSP_ERROR

#define RSP_ERROR   "ERROR"

◆ RSP_OK

#define RSP_OK   "OK"

◆ SIM_APN

#define SIM_APN   ""

◆ WAIT_FOR_CONNECTION

#define WAIT_FOR_CONNECTION   0

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()

void main ( void  )