#include <ArNetPacket.h>
Inheritance diagram for ArNetPacket:
Public Types | |
enum | { SIZE_OF_LENGTH = 2, MAX_LENGTH = 32000, HEADER_LENGTH = 6, FOOTER_LENGTH = 2, MAX_DATA_LENGTH = MAX_LENGTH - HEADER_LENGTH - FOOTER_LENGTH - SIZE_OF_LENGTH } |
enum | PacketSource { TCP, UDP } |
an enum for where the packet came from More... | |
Public Member Functions | |
ArNetPacket (ArTypes::UByte2 bufferSize=ArNetPacket::MAX_LENGTH+5) | |
Constructor. | |
virtual double | bufToDouble (void) |
Gets a double from the packet buffer. | |
ArTypes::Byte2 | calcCheckSum (void) |
returns the checksum, probably used only internally | |
virtual void | doubleToBuf (double val) |
Puts a double into the packet buffer. | |
virtual void | duplicatePacket (ArNetPacket *packet) |
virtual void | empty (void) |
virtual void | finalizePacket (void) |
bool | getAddedFooter (void) |
Iternal function that sets if we already added the footer(for forwarding). | |
ArTypes::UByte2 | getCommand (void) |
Gets the command this packet is. | |
PacketSource | getPacketSource (void) |
virtual void | resetRead (void) |
void | setAddedFooter (bool addedFooter) |
Iternal function that sets if we already added the footer(for forwarding). | |
void | setCommand (ArTypes::UByte2 command) |
Sets the command this packet is. | |
void | setPacketSource (PacketSource source) |
bool | verifyCheckSum (void) |
returns true if the checksum matches what it should be | |
virtual | ~ArNetPacket () |
Destructor. | |
Protected Attributes | |
bool | myAddedFooter |
ArTypes::UByte2 | myCommand |
PacketSource | myPacketSource |
Definition at line 32 of file ArNetPacket.h.
|
Definition at line 44 of file ArNetPacket.h. |
|
an enum for where the packet came from
Definition at line 76 of file ArNetPacket.h. |
|
Constructor.
Definition at line 30 of file ArNetPacket.cpp. References myAddedFooter, and myCommand. |
|
Destructor.
Definition at line 37 of file ArNetPacket.cpp. |
|
Gets a double from the packet buffer.
Definition at line 54 of file ArNetPacket.cpp. References ArBasePacket::bufToStr(). |
|
returns the checksum, probably used only internally
Definition at line 147 of file ArNetPacket.cpp. Referenced by finalizePacket(), and verifyCheckSum(). |
|
Puts a double into the packet buffer.
Definition at line 42 of file ArNetPacket.cpp. References ArBasePacket::strToBuf(). Referenced by ArServerInfoRobot::batteryInfo(), and InputHandler::sendInput(). |
|
Definition at line 134 of file ArNetPacket.cpp. References myAddedFooter, myCommand, and ArBasePacket::setMaxLength(). Referenced by ArServerClientData::ArServerClientData(), ArHybridForwarderVideo::receiveVideo(), ArHybridForwarderVideo::receiveVideoSize(), ArNetPacketSenderTcp::sendPacket(), ArHybridForwarderVideo::sendVideo(), and ArServerClientData::setPacket(). |
|
|
Reimplemented from ArBasePacket. Definition at line 89 of file ArNetPacket.cpp. References ArBasePacket::byteToBuf(), calcCheckSum(), myAddedFooter, myCommand, ArBasePacket::uByte2ToBuf(), and ArBasePacket::uByteToBuf(). Referenced by ArServerHandlerMapping::packetHandler(). |
|
Iternal function that sets if we already added the footer(for forwarding).
Definition at line 71 of file ArNetPacket.h. References myAddedFooter. |
|
Gets the command this packet is.
Definition at line 129 of file ArNetPacket.cpp. References myCommand. Referenced by ArNetPacketReceiverUdp::readData(), ArNetPacketReceiverTcp::readPacket(), and ArNetPacketSenderTcp::sendData(). |
|
Definition at line 81 of file ArNetPacket.h. References myPacketSource. |
|
Reimplemented from ArBasePacket. Definition at line 115 of file ArNetPacket.cpp. References ArBasePacket::bufToUByte2(), myCommand, and ArBasePacket::resetValid(). Referenced by ArNetPacketReceiverUdp::readData(), ArNetPacketReceiverTcp::readPacket(), ArHybridForwarderVideo::receiveVideo(), ArHybridForwarderVideo::receiveVideoSize(), ArClientBase::requestByCommand(), and ArHybridForwarderVideo::sendVideo(). |
|
Iternal function that sets if we already added the footer(for forwarding).
Definition at line 73 of file ArNetPacket.h. References myAddedFooter. |
|
|
Definition at line 82 of file ArNetPacket.h. References myPacketSource. Referenced by ArNetPacketReceiverUdp::readData(), and ArNetPacketReceiverTcp::readData(). |
|
returns true if the checksum matches what it should be
Definition at line 171 of file ArNetPacket.cpp. References calcCheckSum(). Referenced by ArNetPacketReceiverUdp::readData(), and ArNetPacketReceiverTcp::readPacket(). |
|
Definition at line 85 of file ArNetPacket.h. Referenced by ArNetPacket(), duplicatePacket(), empty(), finalizePacket(), getAddedFooter(), and setAddedFooter(). |
|
Definition at line 86 of file ArNetPacket.h. Referenced by ArNetPacket(), duplicatePacket(), empty(), finalizePacket(), getCommand(), resetRead(), and setCommand(). |
|
Definition at line 84 of file ArNetPacket.h. Referenced by getPacketSource(), and setPacketSource(). |