EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects
storage_example.cpp
/*
File: Storage_example.cpp
Example how to add an Gateway to the Storage Manager and Load and Save a File
*/
#define SER_PORT "/dev/ttyUSB1"
#include "./eoLink.h"
#include <stdio.h>
//Testing main.c
void storageExample()
{
eoGateway gateway ;
//adds the Object Gateway to the storage manager
myStore.addObject("Gateway",&gateway);
//now when you load a file, and it contains a Block Gateway, the Gateway will be loaded
if(myStore.Load("./eoLinkSave.txt")!=EO_OK)
{
printf("could not load Storage!");
}
/*
* main application
*/
//every Object which has been added to the storageManager will be saved to the output File
if(myStore.Save("./eoLinkSave.txt")!=EO_OK)
{
printf("could not save Storage!");
}
}