Robot Agent
1.0
|
Go to the source code of this file.
Data Structures | |
struct | s_PROTOCOL_STRUCT |
UDP structure. More... | |
Macros | |
#define | s_PROTOCOL_ADDR_SERVER 0 |
#define | s_PROTOCOL_ADDR_BROADCAST 99 |
#define | s_PROTOCOL_TYPE_ACK 'a' |
#define | s_PROTOCOL_TYPE_DATA 'd' |
#define | s_PROTOCOL_TYPE_GO_AHEAD 'g' |
Typedefs | |
typedef struct s_PROTOCOL_STRUCT | protocol_t |
UDP structure. More... | |
Functions | |
int | protocol_encode (char *udp_packet, int *len, int recv_id, int send_id, int send_team, char type, int seqno, int seqid, int seq_lid, int data_type, void *data) |
int | protocol_decode (protocol_t *packet, char *udp_packet, int len, int robot_id, int robot_team) |
Functions to decode communication packets header file.
Definition in file protocol.h.
#define s_PROTOCOL_ADDR_BROADCAST 99 |
Definition at line 41 of file protocol.h.
#define s_PROTOCOL_ADDR_SERVER 0 |
Definition at line 40 of file protocol.h.
#define s_PROTOCOL_TYPE_ACK 'a' |
Definition at line 44 of file protocol.h.
#define s_PROTOCOL_TYPE_DATA 'd' |
Definition at line 45 of file protocol.h.
#define s_PROTOCOL_TYPE_GO_AHEAD 'g' |
Definition at line 46 of file protocol.h.
typedef struct s_PROTOCOL_STRUCT protocol_t |
UDP structure.
int protocol_decode | ( | protocol_t * | packet, |
char * | udp_packet, | ||
int | len, | ||
int | robot_id, | ||
int | robot_team | ||
) |
Decode string received from UDP into interpretable data
packet | |
udp_packet | |
len | |
robot_id | |
robot_team |
Definition at line 169 of file protocol.c.
int protocol_encode | ( | char * | udp_packet, |
int * | len, | ||
int | recv_id, | ||
int | send_id, | ||
int | send_team, | ||
char | type, | ||
int | seqno, | ||
int | seqid, | ||
int | seq_lid, | ||
int | data_type, | ||
void * | data | ||
) |
Encode data structure into string to be sent through UDP
udp_packet | |
len | |
recv_id | |
send_id | |
send_team | |
type | |
data_type | |
data |
Definition at line 43 of file protocol.c.