ism5 2.1.0.0
main.c File Reference

ISM 5 Click example. More...

#include "board.h"
#include "log.h"
#include "ism5.h"

Macros

#define DEMO_APP_SERVER
 
#define TEXT_MESSAGE_TO_SEND   "Greetings from ISM 5 click board client"
 
#define ACKNOWLEDGE_RESPONSE   "ACK OK"
 
#define CHANNEL_NUMBER   0
 

Functions

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

Detailed Description

ISM 5 Click example.

Description

This example demonstrates the use of an ISM 5 click board by showing the communication between the two click boards (Server and Client).

The demo application is composed of two sections :

Application Init

Initializes the driver, performs the click default configuration, then reads and displays the device part information.

Application Task

There are two application modes: Server and Client.

  • Server mode: Waits for a message from client device, reads the received packet and responds with an acknowledge message.
  • Client mode: Initiates communication with the server device by sending a desired packet which contains the text message and a packet counter approximately once per second. After sending the packet it waits for an acknowledge response from server. The packet counter is incremented only after successfull acknowledgment for the last packet. All data is being displayed on the USB UART where you can track their changes.
Author
Stefan Filipovic

Macro Definition Documentation

◆ ACKNOWLEDGE_RESPONSE

#define ACKNOWLEDGE_RESPONSE   "ACK OK"

◆ CHANNEL_NUMBER

#define CHANNEL_NUMBER   0

◆ DEMO_APP_SERVER

#define DEMO_APP_SERVER

◆ TEXT_MESSAGE_TO_SEND

#define TEXT_MESSAGE_TO_SEND   "Greetings from ISM 5 click board client"

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 )