#include <FeePacket.hpp>
Public Member Functions | |
FeePacket (short errorCode, char *payload, int payloadSize, bool checksum=false, FlagBits flags=0x0000, bool huffman=false) | |
~FeePacket () | |
unsigned int | getId () const |
short | getErrorCode () const |
int | getPayloadSize () const |
int | getFeePacketSize () const |
Private Member Functions | |
FeePacket (unsigned int id, short errorCode, char *payload, bool legal, int payloadSize, bool checksum=false, FlagBits flags=0x0000, bool huffman=false) | |
void | initFeePacket (unsigned int id, short errorCode, char *payload, int payloadSize, bool checksum, FlagBits flags, bool huffman, bool legal=true) |
Static Private Member Functions | |
unsigned int | calculateChecksum (unsigned char *input, int size) |
Private Attributes | |
short | mErrorCode |
unsigned int | mId |
FlagBits | mFlags |
unsigned int | mChecksum |
char * | mPayload |
int | mPayloadSize |
bool | mValid |
Static Private Attributes | |
const int | HEADER_SIZE = FEE_PACKET_HEADER_SIZE |
unsigned int | mLastID = 0 |
|
Constructor for a command. If the huffman-flag is set, the payload will be coded in huffman here in the constructor due to consistency of the payload size member. This means: the payload and payloadSize differs from the input in the constructor afterwards.
|
|
Constructor for a command. If the huffman-flag is set, the payload will be coded in huffman here in the constructor due to consistency of the payload size member. This means: the payload and payloadSize differs from the input in the constructor afterwards. The ID for the FeePacket is set inside this constructor.
|
|
Destructor for a FeePacket object.
|
|
Method to calculate the checksum of an input stream. This function uses the Adler32 algorithm, which returns a 4 byte long checksum and can check any length of input stream. Normally used to calculate the checksum of the payload. Note: the checksum is always taken before huffman encoding and after huffman decoding, so we check also the correctness of the decoded data.
|
|
Gives back the error Code, if it is the result data from the FeeServer. For more details see FeeServer: fee_errors.h
|
|
Gives back the size of the command in bytes.
|
|
Gives back package ID of this command.
|
|
Gives back the payload size.
|
|
Initializes a FeePacket. This function is used by both construtors to initialize the packet and covers the part, which is identic for both construction methods.
|
|
Headersize, does NOT change.
|
|
stores the checksum
|
|
stores the errorCode, no error code is represented by 0
|
|
stores the flags
|
|
stores the package id
|
|
Last transmitted ID for FeePackets.
|
|
stores the payload, not NULL terminated !
|
|
stores the payload size in bytes
|
|
indicates, if payload is valid (checksum correct).
|