-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPacket.h
More file actions
40 lines (32 loc) · 727 Bytes
/
Copy pathPacket.h
File metadata and controls
40 lines (32 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Packet.h
*
* Make packet in proper format.
* Parse packet
*/
#ifndef PACKET_H_
#define PACKET_H_
#include <string>
#include <sstream>
#include <stdlib.h>
#include "PacketType.h"
class Packet {
public:
// refer below PacketType
int m_MsgType;
int m_ValueType[16];
std::string m_Value[16];
//number of value in single packet
int m_paramNo;
public:
Packet();
virtual ~Packet();
// Decide Message Type and Add value
void DecideMessageType(int msgType);
void AddValue(int valueType, std::string value);
// return standardized message string for transmission.
std::string CreateMessage();
// Parse message in message type, value type and value.
void Parse(std::string msg);
};
#endif /* PACKET_H_ */