EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects
HelloWorld.cpp
#ifdef WIN32
#include <windows.h>
#define SER_PORT "\\\\.\\COM43" //COM43
#else
#define SER_PORT "/dev/ttyUSB0"
#endif
#include "./eoLink.h"
#include <stdio.h>
int main(int argc, const char* argv[])
{
(void)argc;
(void)argv;
uint16_t recv;
//First a Gateway will be defined
eoGateway myGateway;
//This tries to open an connection to the USB300 or fails otherwise
printf("Opening Connection to USB300 \n");
if (myGateway.Open(SER_PORT)!=EO_OK)
{
printf("Failed to open USB300\n");
return 0;
}
printf("Hello to the world of eoLink\n");
if(myGateway.commands.ReadVersion(version)==EO_OK)
printf("%s %i.%i.%i.%i, ID:0x%08X on %s\n",
version.appDescription,
version.appVersion[0], version.appVersion[1], version.appVersion[2], version.appVersion[3],
version.chipID,
SER_PORT);
while(1)
{
recv = myGateway.Receive();
if (recv & RECV_TELEGRAM_ERP2)//ERP2 is used by J modules.
{
}
else if (recv & RECV_TELEGRAM)
{
}
}
return 0;
}