Revision 397
added error returns to some libwireless functions, handled in server.
colonet_wireless.cpp | ||
---|---|---|
17 | 17 |
#include <wireless.h> // Colonet wireless library. |
18 | 18 |
#include <wl_token_ring.h> |
19 | 19 |
|
20 |
#include "colonet_defs.h"
|
|
21 |
#include "colonet_wireless.h"
|
|
20 |
#include <colonet_defs.h>
|
|
21 |
#include <colonet_wireless.h>
|
|
22 | 22 |
|
23 | 23 |
/******************************* Definitions *********************************/ |
24 | 24 |
|
... | ... | |
48 | 48 |
static int log_packet(unsigned char* packet, int len); |
49 | 49 |
|
50 | 50 |
/**************************** Public functions *******************************/ |
51 |
void colonet_wl_init(char* wl_port_, MsgHandlerFunction message_handler_, char* log_filename_) {
|
|
51 |
int colonet_wl_init(char* wl_port_, MsgHandlerFunction message_handler_, char* log_filename_) {
|
|
52 | 52 |
if (log_filename_ != NULL) { |
53 | 53 |
logging_enabled = true; |
54 | 54 |
strcpy(log_filename, log_filename_); |
... | ... | |
65 | 65 |
wl_token_ring_register(); |
66 | 66 |
|
67 | 67 |
printf("Joining token ring...\n"); |
68 |
wl_token_ring_join(); |
|
68 |
if (wl_token_ring_join() != 0) { |
|
69 |
fprintf(stderr, "Failed to join token ring.\n"); |
|
70 |
return -1; |
|
71 |
} |
|
69 | 72 |
printf("Joined token ring.\n"); |
73 |
|
|
74 |
return 0; |
|
70 | 75 |
} |
71 | 76 |
|
72 | 77 |
void colonet_wl_kill_listener_thread() { |
Also available in: Unified diff