xuxiuxi
2017-04-19 001099d29745b2f0ec64d6512ef659f81f9385cb
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef _EV_PROTO_H_
#define _EV_PROTO_H_
 
#include <stddef.h>
#include <stdint.h>
 
#pragma pack(1)
 
struct EVPCommand
{
    enum EVPC
    {
        EVPC__FIRST,
        EVPC_STATUS = 1,
        EVPC_USER_DEFINE = 128,
        EVPC__LAST
    };
};
 
struct EVPStatus
{
    enum EVPS
    {
        EVPS__FIRST,
        EVPS_OK = 1,
        EVPS_ERROR = 128,
        EVPS_INTERNAL_ERROR,
        EVPS_PARAMETER_ERROR,
        EVPS__LAST
    };
};
 
struct EVPHeader
{
    int16_t cmd;    // EVPCommand::EVPC
    uint32_t size;    // sizeof(EVPHeader)+sizeof(subcmd)
};
 
struct EVP_Status
{
    int16_t status;
};
 
struct EVP_VariableBuffer
{
    int16_t type;
    uint8_t buff[0];
};
 
//#todo
template<typename TPacket>
void endian_convert(TPacket& packet);
 
#pragma pack()
 
#endif