xbee2 2.1.0.0
main.c File Reference

XBEE 2 Click Example. More...

#include "board.h"
#include "log.h"
#include "xbee2.h"

Macros

#define DEVICE_NAME   "XBEE 2 Click"
 
#define DESTINATION_ADDRESS_HIGH   XBEE2_BROADCAST_DEST_ADDRESS_HIGH
 
#define DESTINATION_ADDRESS_LOW   XBEE2_BROADCAST_DEST_ADDRESS_LOW
 
#define DEMO_APP_TRANSMITTER
 
#define DEMO_TEXT_MESSAGE   "MikroE - XBEE 2 click board\r\n"
 
#define PROCESS_BUFFER_SIZE   200
 

Functions

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

Detailed Description

XBEE 2 Click Example.

Description

This example demonstrates the use of an XBEE 2 click board by showing the communication between the two click boards configured in transparent mode.

The demo application is composed of two sections :

Application Init

Initializes the driver and configures the click board by performing a factory reset, and setting the device name, destination address, api mode to transparent, and a device role to join or form network depending on the application mode.

Application Task

Depending on the selected application mode, it reads all the received data or sends the desired message every 3 seconds.

Additional Function

  • static void xbee2_clear_app_buf ( void )
  • static err_t xbee2_process ( void )
  • static err_t xbee2_display_rsp ( uint16_t timeout )
Author
Stefan Filipovic

Macro Definition Documentation

◆ DEMO_APP_TRANSMITTER

#define DEMO_APP_TRANSMITTER

◆ DEMO_TEXT_MESSAGE

#define DEMO_TEXT_MESSAGE   "MikroE - XBEE 2 click board\r\n"

◆ DESTINATION_ADDRESS_HIGH

#define DESTINATION_ADDRESS_HIGH   XBEE2_BROADCAST_DEST_ADDRESS_HIGH

◆ DESTINATION_ADDRESS_LOW

#define DESTINATION_ADDRESS_LOW   XBEE2_BROADCAST_DEST_ADDRESS_LOW

◆ DEVICE_NAME

#define DEVICE_NAME   "XBEE 2 Click"

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   200

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 )