nbiot 2.0.0.0
main.c File Reference

NbIot Click example. More...

#include "board.h"
#include "log.h"
#include "nbiot.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 PROCESS_BUFFER_SIZE   500
 
#define WAIT_FOR_CONNECTION   0
 
#define CONNECTED_TO_NETWORK   1
 
#define CONNECTED   "+CGATT:1"
 

Functions

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

Detailed Description

NbIot Click example.

Description

This example reads and processes data from NB IoT clicks.

The demo application is composed of two sections :

Application Init

Initializes driver, wake-up module and sets default configuration for connecting device to network.

Application Task

Waits for device to connect to network and then checks the signal quality every 5 seconds. All data is being logged on USB UART where you can track their changes.

Additional Function

  • static void nbiot_clear_app_buf ( void )
  • static void nbiot_error_check( err_t error_flag )
  • static void nbiot_log_app_buf ( void )
  • static void nbiot_check_connection( void )
  • static err_t nbiot_rsp_check ( void )
  • static err_t nbiot_process ( void )
Note
In order for the example to work, a valid SIM card needs to be entered.
Author
MikroE Team

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

◆ CONNECTED

#define CONNECTED   "+CGATT:1"

◆ CONNECTED_TO_NETWORK

#define CONNECTED_TO_NETWORK   1

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   500

◆ RSP_ERROR

#define RSP_ERROR   "ERROR"

◆ RSP_OK

#define RSP_OK   "OK"

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

int main ( void )