neomesh915mhz 2.1.0.0
main.c File Reference

NeoMesh 915MHz Click Example. More...

#include "board.h"
#include "log.h"
#include "neomesh915mhz.h"

Macros

#define SINGLE_RECEIVER_MODE
 
#define APP_ORIGINATOR   0
 
#define APP_RECEIVER_1   1
 
#define APP_RECEIVER_2   2
 
#define DEMO_APP   APP_ORIGINATOR
 
#define DEMO_TEXT_MESSAGE   "MIKROE-NeoMesh"
 
#define DEFAULT_PORT   0
 
#define NODE_ID_ORIGINATOR   0x0100u
 
#define NODE_ID_RECEIVER_1   0x0020u
 
#define NODE_ID_RECEIVER_2   0x0021u
 

Functions

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

Detailed Description

NeoMesh 915MHz Click Example.

Description

This example demonstrates the use of NeoMesh 915MHz click board by showing the communication between the two click boards.

The demo application is composed of two sections :

Application Init

Initializes the driver and configures the click board for the selected application mode.

Application Task

One click board should be set to originator mode and the others to receiver 1 or 2. If the SINGLE_RECEIVER_MODE is enabled, the originator device sends a desired message to RECEIVER_1 node and waits for an acknowledge response, otherwise it sends the same message to both RECEIVER_1 and RECEIVER_2 nodes. The receiver devices reads and parses all incoming AAPI frames and displays them on the USB UART.

Author
Stefan Filipovic

Macro Definition Documentation

◆ APP_ORIGINATOR

#define APP_ORIGINATOR   0

◆ APP_RECEIVER_1

#define APP_RECEIVER_1   1

◆ APP_RECEIVER_2

#define APP_RECEIVER_2   2

◆ DEFAULT_PORT

#define DEFAULT_PORT   0

◆ DEMO_APP

#define DEMO_APP   APP_ORIGINATOR

◆ DEMO_TEXT_MESSAGE

#define DEMO_TEXT_MESSAGE   "MIKROE-NeoMesh"

◆ NODE_ID_ORIGINATOR

#define NODE_ID_ORIGINATOR   0x0100u

◆ NODE_ID_RECEIVER_1

#define NODE_ID_RECEIVER_1   0x0020u

◆ NODE_ID_RECEIVER_2

#define NODE_ID_RECEIVER_2   0x0021u

◆ SINGLE_RECEIVER_MODE

#define SINGLE_RECEIVER_MODE

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 )