LRAUV  revA
DataReceiver Class Reference

Handles data that is sent to the vehicle. More...

#include <DataReceiver.h>

Public Types

enum  BinaryTransferFlags {
  FILE_START = 0x00, FILE_PART = 0x01, FILE_MEDIUM_OFFSET = 0x02, FILE_LARGE_OFFSET = 0x04,
  FILE_FLAG = 0x80
}
 

Static Public Member Functions

static bool ReceiveSbd (const char *data, size_t dataLen, const char *keyText, Logger &logger)
 
static void Receive (const char *data, size_t dataLen, Logger &logger)
 

Static Protected Member Functions

static void FileStart (const char *data, size_t dataLen, unsigned int flags, unsigned int stamp, char *infoFilename, char *partFilename, unsigned int &crc, size_t &size, char *streamCmd, char *targetPath, Logger &logger)
 Write data to start of file, and set informational parameters Data contains stamp, size, path, data Sets streamCmd. More...
 
static void FilePart (const char *data, size_t dataLen, unsigned int flags, unsigned int stamp, char *infoFilename, char *partFilename, unsigned int &crc, size_t &size, char *streamCmd, char *targetPath, Logger &logger)
 Write data to middle of file Data contains stamp, offset, data Sets streamCmd if possible Returns true if file CAN BE COMPLETE. More...
 
static bool FileDone (char *partFilename, unsigned int crc, size_t size, char *targetPath, Logger &logger)
 Returns true if file is completely written and there are no long stringstrailZ of zeroes in the data. More...
 

Private Member Functions

 DataReceiver ()
 Private constructor for singleton class. More...
 

Static Private Attributes

static AES Crypt_
 

Detailed Description

Handles data that is sent to the vehicle.

Assumes that data that starts with a valid ASCII character is a command. Otherwise binary.

Constructor & Destructor Documentation

DataReceiver::DataReceiver ( )
private

Private constructor for singleton class.

Member Function Documentation

bool DataReceiver::FileDone ( char *  partFilename,
unsigned int  crc,
size_t  size,
char *  targetPath,
Logger logger 
)
staticprotected

Returns true if file is completely written and there are no long stringstrailZ of zeroes in the data.

Returns true if file is completely written and there are no long strings of zeroes in the data.

References Syslog::FAULT, Syslog::IMPORTANT, MAX_ZEROES, and Logger::syslog().

Referenced by Receive().

void DataReceiver::FilePart ( const char *  data,
size_t  dataLen,
unsigned int  flags,
unsigned int  stamp,
char *  infoFilename,
char *  partFilename,
unsigned int &  crc,
size_t &  size,
char *  streamCmd,
char *  targetPath,
Logger logger 
)
staticprotected

Write data to middle of file Data contains stamp, offset, data Sets streamCmd if possible Returns true if file CAN BE COMPLETE.

References FILE_LARGE_OFFSET, FILE_MEDIUM_OFFSET, Syslog::IMPORTANT, and Logger::syslog().

Referenced by Receive().

void DataReceiver::FileStart ( const char *  data,
size_t  dataLen,
unsigned int  flags,
unsigned int  stamp,
char *  infoFilename,
char *  partFilename,
unsigned int &  crc,
size_t &  size,
char *  streamCmd,
char *  targetPath,
Logger logger 
)
staticprotected

Write data to start of file, and set informational parameters Data contains stamp, size, path, data Sets streamCmd.

References FILE_LARGE_OFFSET, FILE_MEDIUM_OFFSET, Syslog::IMPORTANT, and Logger::syslog().

Referenced by Receive().

bool DataReceiver::ReceiveSbd ( const char *  data,
size_t  dataLen,
const char *  keyText,
Logger logger 
)
static

Member Data Documentation

AES DataReceiver::Crypt_
staticprivate

Referenced by ReceiveSbd().


The documentation for this class was generated from the following files: