Revision 142
renamed client.cpp and its header file to wirelessMessageHandler.cpp
trunk/code/projects/colonet/ColonetServer/client.cpp | ||
---|---|---|
1 |
/** @file client.c |
|
2 |
* |
|
3 |
* @author Jason Knichel |
|
4 |
* @author Eugene Marinelli |
|
5 |
* |
|
6 |
* @bug Weird segfault when processing tokens |
|
7 |
*/ |
|
8 |
|
|
9 |
#include <string.h> |
|
10 |
#include <stdio.h> |
|
11 |
#include <unistd.h> |
|
12 |
#include <ctype.h> |
|
13 |
#include <errno.h> |
|
14 |
|
|
15 |
#include <colonet_wireless.h> |
|
16 |
|
|
17 |
#include "includes/client.h" |
|
18 |
#include "includes/options.h" |
|
19 |
#include "includes/ColonetServer.h" |
|
20 |
|
|
21 |
/* Globals */ |
|
22 |
extern ColonetServer colonet_server; |
|
23 |
|
|
24 |
|
|
25 |
/* Public functions */ |
|
26 |
int wirelessMessageHandler(unsigned char type, short source, int dest, |
|
27 |
unsigned char* data, int len) { |
|
28 |
printf("Server received wireless message!!!\n"); |
|
29 |
|
|
30 |
return colonet_server.process_received_wireless_message(type, source, dest, |
|
31 |
data, len); |
|
32 |
} |
trunk/code/projects/colonet/ColonetServer/wirelessMessageHandler.cpp | ||
---|---|---|
1 |
/** @file wirelessMessageHandler.cpp |
|
2 |
* |
|
3 |
* @author Jason Knichel |
|
4 |
* @author Eugene Marinelli |
|
5 |
* |
|
6 |
* @bug Weird segfault when processing tokens |
|
7 |
*/ |
|
8 |
|
|
9 |
#include <string.h> |
|
10 |
#include <stdio.h> |
|
11 |
#include <unistd.h> |
|
12 |
#include <ctype.h> |
|
13 |
#include <errno.h> |
|
14 |
|
|
15 |
#include <colonet_wireless.h> |
|
16 |
|
|
17 |
#include "includes/wirelessMessageHandler.h" |
|
18 |
#include "includes/options.h" |
|
19 |
#include "includes/ColonetServer.h" |
|
20 |
|
|
21 |
/* Globals */ |
|
22 |
extern ColonetServer colonet_server; |
|
23 |
|
|
24 |
|
|
25 |
/* Public functions */ |
|
26 |
int wirelessMessageHandler(unsigned char type, short source, int dest, |
|
27 |
unsigned char* data, int len) { |
|
28 |
printf("Server received wireless message!!!\n"); |
|
29 |
|
|
30 |
return colonet_server.process_received_wireless_message(type, source, dest, |
|
31 |
data, len); |
|
32 |
} |
trunk/code/projects/colonet/ColonetServer/includes/client.h | ||
---|---|---|
1 |
/** |
|
2 |
* |
|
3 |
* @author Jason Knichel |
|
4 |
* |
|
5 |
*/ |
|
6 |
|
|
7 |
#ifndef CLIENT_H |
|
8 |
#define CLIENT_H |
|
9 |
|
|
10 |
#include <colonet_wireless.h> |
|
11 |
|
|
12 |
int wirelessMessageHandler(unsigned char* pkt, int len); |
|
13 |
int initWireless(void); |
|
14 |
int wirelessMessageHandler(unsigned char type, short source, int dest, |
|
15 |
unsigned char* data, int len); |
|
16 |
|
|
17 |
#endif |
trunk/code/projects/colonet/ColonetServer/includes/wirelessMessageHandler.h | ||
---|---|---|
1 |
/** |
|
2 |
* |
|
3 |
* @author Jason Knichel |
|
4 |
* |
|
5 |
*/ |
|
6 |
|
|
7 |
#ifndef WIRELESSMESSAGEHANDLER_H |
|
8 |
#define WIRELESSMESSAGEHANDLER_H |
|
9 |
|
|
10 |
#include <colonet_wireless.h> |
|
11 |
|
|
12 |
int wirelessMessageHandler(unsigned char type, short source, int dest, |
|
13 |
unsigned char* data, int len); |
|
14 |
|
|
15 |
#endif |
trunk/code/projects/colonet/ColonetServer/ConnectionPool.cpp | ||
---|---|---|
14 | 14 |
#include <stdio.h> |
15 | 15 |
|
16 | 16 |
#include "includes/ConnectionPool.h" |
17 |
#include "includes/client.h" |
|
18 | 17 |
#include "includes/Command.h" |
19 | 18 |
#include "../lib/colonet_defs.h" |
20 | 19 |
#include <colonet_wireless.h> |
trunk/code/projects/colonet/ColonetServer/ColonetServer.cpp | ||
---|---|---|
20 | 20 |
|
21 | 21 |
#include "includes/ColonetServer.h" |
22 | 22 |
#include "includes/ConnectionPool.h" |
23 |
#include "includes/client.h"
|
|
23 |
#include "includes/wirelessMessageHandler.h"
|
|
24 | 24 |
#include "includes/options.h" |
25 | 25 |
#include "includes/Log.h" |
26 | 26 |
|
trunk/code/projects/colonet/ColonetServer/Makefile | ||
---|---|---|
3 | 3 |
CC = g++ |
4 | 4 |
CFLAGS = -Wall -Wshadow -Wextra -g |
5 | 5 |
|
6 |
COLONETCPPFILES = ColonetServer.cpp client.cpp ConnectionPool.cpp Command.cpp
|
|
6 |
COLONETCPPFILES = ColonetServer.cpp wirelessMessageHandler.cpp ConnectionPool.cpp Command.cpp
|
|
7 | 7 |
COLONETCPPOBJECTS = $(COLONETCPPFILES:.cpp=.o) |
8 | 8 |
COLONETFILES = options.c |
9 | 9 |
COLONETOBJECTS = $(COLONETFILES:.c=.o) |
Also available in: Unified diff