Robot Agent  1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
def.h
Go to the documentation of this file.
1 
11 #ifndef __DEF_H
12 #define __DEF_H
13 
14 /* -- Includes -- */
15 /* system libraries */
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <unistd.h>
19 /* project libraries */
20 #include "config.h"
21 
22 /* -- Types -- */
23 
24 
28 typedef struct s_VICTIM_STRUCT
29 {
30  int x; // X coordinate
31  int y; // Y coordinate
32  char id[11]; // ID
33 
34 } victim_t;
35 
39 typedef struct s_COMMAND_STRUCT
40 {
41  int cmd; // command
42 
43 } command_t;
44 
48 typedef struct s_STREAM_STRUCT
49 {
50  long counter; // Stream counter
51  int size; // Stream size
52  unsigned char data[s_CONFIG_STREAM_SIZE]; // Stream data
53 
54 } stream_t;
55 
56 
57 /* -- Defines -- */
58 
59 /* Boolean */
60 #define s_TRUE 1
61 #define s_FALSE 0
62 
63 /* Function returns */
64 #define s_OK 0
65 #define s_ERROR -1
66 
67 /* Data Structure types */
68 #define s_DATA_STRUCT_TYPE_ROBOT 0
69 #define s_DATA_STRUCT_TYPE_VICTIM 1
70 #define s_DATA_STRUCT_TYPE_PHEROMONE 2
71 #define s_DATA_STRUCT_TYPE_CMD 3
72 #define s_DATA_STRUCT_TYPE_STREAM 4
73 
74 /* Commands */
75 #define s_CMD_START 0
76 #define s_CMD_STOP 1
77 #define s_CMD_GO_AHEAD 2
78 
79 
80 #endif /* __DEF_H */
struct s_VICTIM_STRUCT victim_t
Victim structure.
int size
Definition: def.h:51
Stream structure.
Definition: def.h:48
struct s_STREAM_STRUCT stream_t
Stream structure.
Victim structure.
Definition: def.h:28
unsigned char data[s_CONFIG_STREAM_SIZE]
Definition: def.h:52
Command structure.
Definition: def.h:39
struct s_COMMAND_STRUCT command_t
Command structure.
long counter
Definition: def.h:50
#define s_CONFIG_STREAM_SIZE
Definition: config.h:89