Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

Packet.h

00001 
00007 #ifndef PACKET_H
00008 #define PACKET_H
00009 
00010 class Packet {
00011     public:
00015         enum {
00017             IDLEN = 7,
00019             TIMELEN = 9,
00021             TYPELEN = 1,
00023             OVERHEAD = 2,
00024         };
00025 
00029         enum {
00031             END = 13,
00033             START = 58
00034         };
00038         enum Type {
00040             HBEAT = 72,
00042             LOGIN = 76,
00044             JOYST = 74,
00046             NOSET = 0
00047         }; 
00052         virtual char getType();
00053         
00059         virtual int getTime();
00060         
00065         virtual int getID();
00066 
00071         virtual void setType(Type packetType);
00072         
00076         virtual void registerPacket()=0;
00077 
00083         virtual int sendPacket(int fd)=0;
00084         
00088         virtual void setTime();
00089         
00094         virtual void setTime(int newTime);
00095         
00099         virtual void setID();
00100         
00105         virtual void setID(int newID);
00106 
00107    protected:
00109         char type;
00111         char cTime[TIMELEN];
00113         char ID[IDLEN];
00114 };
00115 
00116 #endif
00117 

Generated on Fri Mar 25 23:48:45 2005 for CS498EmbeddedSystemsProgramming by doxygen 1.3.6