EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects
eoLogger Class Reference

Logs Packets. More...

#include <eoLogger.h>

Public Member Functions

 eoLogger ()
 
eoReturn Open (const char *filename)
 
eoReturn Close ()
 
eoReturn Log (eoPacket &p, bool flush=false)
 
eoReturn Log (eoTelegram &tel, bool flush=false)
 
eoReturn Flush ()
 

Detailed Description

Logs Packets.

The eoLogger logs Packets in binary to a specified file. Each packets precedes a timestamp.

Constructor & Destructor Documentation

◆ eoLogger()

eoLogger::eoLogger ( )

Constructor

Member Function Documentation

◆ Close()

eoReturn eoLogger::Close ( )

Closes the file that was opened using open()

Returns
0 for successful closing the file.

◆ Flush()

eoReturn eoLogger::Flush ( )

Flushes the stream to file.

◆ Log() [1/2]

eoReturn eoLogger::Log ( eoPacket p,
bool  flush = false 
)

Logs a Packet of type Packet by appending it to the opened file with a preceding timestamp.

Parameters
pThe Packet to be logged.
flushIf true, after logging the packet p, the file is flushed
Returns
Returns 0 if successful.

◆ Log() [2/2]

eoReturn eoLogger::Log ( eoTelegram tel,
bool  flush = false 
)

Logs a Packet of type Packet by appending it to the opened file with a preceding timestamp.

Parameters
pThe Packet to be logged.
flushIf true, after logging the packet p, the file is flushed
Returns
Returns 0 if successful.

◆ Open()

eoReturn eoLogger::Open ( const char *  filename)

Opens a file for binary write access. Overwrites it if it exists.

Returns
0 for successful opening the file. -1 otherwise.