Rearranged the packet and serial code to make more sense

This mostly just reimplements the best parts of the discarded branch:

> discard-encapsulated-packets

There may still be some work needed.
This commit is contained in:
Kayne Ruse
2014-08-31 13:24:53 +10:00
parent 6f4334f84d
commit 094efad728
38 changed files with 472 additions and 871 deletions
+7 -7
View File
@@ -23,7 +23,7 @@
#define UDPNETWORKUTILITY_HPP_
//common
#include "serial_packet.hpp"
#include "serial_packet_base.hpp"
#include "singleton.hpp"
//APIs
@@ -50,12 +50,12 @@ public:
int SendToAllChannels(void* data, int len);
int Receive();
//send a SerialPacket
int SendTo(const char* ip, int port, SerialPacket* serialPacket);
int SendTo(IPaddress* add, SerialPacket* serialPacket);
int SendTo(int channel, SerialPacket* serialPacket);
int SendToAllChannels(SerialPacket* serialPacket);
int Receive(SerialPacket* serialPacket);
//send a SerialPacketBase
int SendTo(const char* ip, int port, SerialPacketBase* serialPacket);
int SendTo(IPaddress* add, SerialPacketBase* serialPacket);
int SendTo(int channel, SerialPacketBase* serialPacket);
int SendToAllChannels(SerialPacketBase* serialPacket);
int Receive(SerialPacketBase* serialPacket);
//accessors
UDPpacket* GetPacket() const {