24 #ifndef __NETCOMM_FAWKES_CLIENT_H_
25 #define __NETCOMM_FAWKES_CLIENT_H_
27 #include <netcomm/fawkes/message_queue.h>
28 #include <netcomm/fawkes/message.h>
29 #include <netcomm/fawkes/component_ids.h>
31 #include <core/exception.h>
32 #include <core/utils/lock_map.h>
39 class FawkesNetworkClientHandler;
40 class FawkesNetworkClientSendThread;
41 class FawkesNetworkClientRecvThread;
49 #define FAWKES_TCP_PORT 1910
59 unsigned short int port,
const char *ip = NULL);
64 void connect(
const char *hostname,
unsigned short int port);
65 void connect(
const char *hostname,
const char *ip,
unsigned short int port);
70 void wait(
unsigned int component_id,
unsigned int timeout_sec = 15);
71 void wake(
unsigned int component_id);
81 unsigned int id()
const;
84 const char *
get_ip()
const;
88 void notify_of_connection_established();
89 void notify_of_connection_dead();
91 void wake_handlers(
unsigned int cid);
93 void connection_died();
94 void set_send_slave_alive();
95 void set_recv_slave_alive();
99 unsigned short int __port;
107 Mutex *__connest_mutex;
109 bool __connest_interrupted;
113 std::map<unsigned int, bool> __recv_received;
116 bool __recv_slave_alive;
117 bool __send_slave_alive;
119 bool connection_died_recently;
120 Mutex *slave_status_mutex;