#ifdef WIN32
#define SER_PORT "\\\\.\\COM3" //COM43
#else
#define SER_PORT "/dev/ttyUSB0"
#endif
#define LEARN_TIME_S 10
#include "./eoLink.h"
#include <stdint.h>
#include <stdio.h>
#include <map>
{
bool retValue=true;
printf("Opening Connection to USB300 \n");
{
printf("Failed to open USB300\n");
retValue=false;
}
{
printf("%s %i.%i.%i.%i, ID:0x%08X on %s\n",
SER_PORT);
}
else
{
retValue=false;
}
return retValue;
}
{
uint16_t recv;
while(learnTime>time)
{
{
if(profile !=
NULL && profile->
rorg == 0xA5 && profile->
func == 0x02)
{
genericTemperatureProfiles.
AddChannelOut(
S_TEMP,GP_RES_10BIT,(int8_t)tempChannel->
max,(int8_t)tempChannel->
min,GP_SCAL_1,GP_SCAL_1,VAL_CURR);
}
else
{
}
}
}
myGateway.
Send(teachMessage);
}
{
uint16_t recv;
while (1)
{
{
float temperature;
{
genericTemperatureProfiles.
SetValue(
S_TEMP,temperature);
genericTemperatureProfiles.
Create(gpMessage);
myGateway.
Send(gpMessage);
}
}
}
}
int main(int argc, const char* argv[])
{
(void)argc;
(void)argv;
if(openGateway(myGateway))
{
printf("EnOcean-Link Gateway LearnMode\n");
learnInMode(myGateway,genericTemperatureProfiles);
printf("Learn Mode off\n");
operatingMode(myGateway, genericTemperatureProfiles);
delete learnFilter;
delete myFilter;
}
return 0;
}