-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.h
49 lines (43 loc) · 925 Bytes
/
constants.h
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
#ifndef __CONSTANTS_INC__
#define __CONSTANTS_INC__
/*
* This file containts all the packet types, commands
* and status constants
*
*/
// Packet types
typedef enum
{
PACKET_TYPE_COMMAND = 0,
PACKET_TYPE_RESPONSE = 1,
PACKET_TYPE_ERROR = 2,
PACKET_TYPE_MESSAGE = 3,
PACKET_TYPE_HELLO = 4
// PACKET_TYPE_COLOUR = 5
} TPacketType;
// Response types. This goes into the command field
typedef enum
{
RESP_OK = 0,
RESP_STATUS=1,
RESP_BAD_PACKET = 2,
RESP_BAD_CHECKSUM = 3,
RESP_BAD_COMMAND = 4,
RESP_BAD_RESPONSE = 5
} TResponseType;
// Commands
// For direction commands, param[0] = distance in cm to move
// param[1] = speed
typedef enum
{
COMMAND_FORWARD = 0,
COMMAND_REVERSE = 1,
COMMAND_TURN_LEFT = 2,
COMMAND_TURN_RIGHT = 3,
COMMAND_STOP = 4,
COMMAND_GET_STATS = 5,
COMMAND_CLEAR_STATS = 6
// COMMAND_DETECT_COLOUR = 7,
// COMMAND_ULTRASONIC = 8
} TCommandType;
#endif