wirepas 2.1.0.0
Macros | Functions | Variables
main.c File Reference

Wirepas Click Example. More...

#include "board.h"
#include "log.h"
#include "wirepas.h"

Macros

#define PROCESS_BUFFER_SIZE   200
 
#define TX_DATA   "Wirepas Click"
 
#define ROUTER_MODE
 
#define MULTI_SINK_MODE
 
#define TX_ADDRESS   0x01
 Wirepas node addresses. More...
 
#define RX_ADDRESS_1   0x02
 
#define RX_ADDRESS_2   0x03
 
#define NET_ADDRESS   0x01
 
#define CHANNEL_ADDRESS   0x01
 

Functions

err_t wirepas_get_resp (wirepas_t *ctx)
 Wirepas get responce function. More...
 
void application_init (void)
 
void application_task (void)
 
void main (void)
 

Variables

uint8_t frame_id
 

Detailed Description

Wirepas Click Example.

Description

This example demonstrates the use of Wirepas click board by processing the incoming data and displaying them on the USB UART in sink mode, and sending data to the sinks in router mode.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the click default configuration, setting device mode, node, net and chennel addresses, and starting stack.

Application Task

Router mode - Sending data to the sinks at the same network. Sink mode - Reads and processes all incoming data and displays them on the USB UART.

Additional Function

Note
For the best experience use two clicks in sink mode and one in router.
Author
Stefan Ilic

Macro Definition Documentation

◆ CHANNEL_ADDRESS

#define CHANNEL_ADDRESS   0x01

◆ MULTI_SINK_MODE

#define MULTI_SINK_MODE

◆ NET_ADDRESS

#define NET_ADDRESS   0x01

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   200

◆ ROUTER_MODE

#define ROUTER_MODE

◆ RX_ADDRESS_1

#define RX_ADDRESS_1   0x02

◆ RX_ADDRESS_2

#define RX_ADDRESS_2   0x03

◆ TX_ADDRESS

#define TX_ADDRESS   0x01

Wirepas node addresses.

Specified setting for node addresses of Wirepas Click driver.

◆ TX_DATA

#define TX_DATA   "Wirepas Click"

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  )

◆ wirepas_get_resp()

err_t wirepas_get_resp ( wirepas_t ctx)

Wirepas get responce function.

This function is used to get responce from the device.

Parameters
[in]ctx: Click context object. See wirepas_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

Variable Documentation

◆ frame_id

uint8_t frame_id