Encapsulates a data packet for debug communication.
Definition debugpacket.h:43
SizeT GetPayloadSize() const
get actual payload size
Definition debugpacket.cc:167
virtual ~DebugPacket()
destructor
Definition debugpacket.cc:29
ushort GetPort() const
get the port number of the packet
Definition debugpacket.cc:135
const ubyte * GetRawBuffer() const
get pointer to raw packet buffer (contains header + payload)
Definition debugpacket.cc:197
Command
packet commands
Definition debugpacket.h:47
@ Wii2PCCmd
Definition debugpacket.h:49
@ PC2WiiCmd
Definition debugpacket.h:48
@ PC2WiiAck
Definition debugpacket.h:50
@ Wii2PCAck
Definition debugpacket.h:51
static const SizeT HeaderSize
header size
Definition debugpacket.h:57
bool hasData
Definition debugpacket.h:97
static const SizeT PacketSize
packet size
Definition debugpacket.h:55
Util::FourCC GetMagic() const
get magic code at start of header
Definition debugpacket.cc:105
void WriteRaw(const void *buf, SizeT bufSize)
write raw data to packet (must have valid packet header, size of src buffer must be PacketSize!
Definition debugpacket.cc:92
static const SizeT MaxPayloadSize
max payload size
Definition debugpacket.h:59
static Util::Array< DebugPacket > EncodeStream(ushort portNum, uint firstPacketCounter, const Ptr< IO::Stream > &stream)
encode stream into a series of packets
Definition debugpacket.cc:206
const ubyte * GetPayload() const
get pointer to payload
Definition debugpacket.cc:186
DebugPacket()
constructor
Definition debugpacket.cc:20
bool IsFinalPacket() const
return true if this is the last packet of a message
Definition debugpacket.cc:150
uint GetCount() const
get message counter
Definition debugpacket.cc:120
static void DecodePackets(const Util::Array< DebugPacket > &packets, const Ptr< IO::Stream > &stream, ushort &outPortNum)
decode a series of packets into a stream
Definition debugpacket.cc:239
ubyte buffer[PacketSize]
Definition debugpacket.h:96
bool HasData() const
return true if the packet contains data
Definition debugpacket.h:113
void SetDataValid(bool b)
set the "has data" flag on the packet
Definition debugpacket.h:104
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Nebula's dynamic array class.
Definition array.h:60
A four-character-code is a quasi-human-readable 32-bit-id.
Definition fourcc.h:19
@ Write
Definition filewatcher.h:47
Definition debugmessage.h:20
unsigned char ubyte
Definition types.h:34
int SizeT
Definition types.h:49
unsigned int uint
Definition types.h:31
unsigned short ushort
Definition types.h:32