38 #include <msgs/MachineInfo.pb.h> 39 #include <protobuf_comm/client.h> 41 #include <boost/asio.hpp> 43 using namespace protobuf_comm;
44 using namespace llsf_msgs;
48 static bool quit =
false;
52 signal_handler(
const boost::system::error_code &error,
int signum)
72 handle_message(uint16_t comp_id, uint16_t msg_type, std::shared_ptr<google::protobuf::Message> msg)
74 printf(
"Received message of type %u\n", msg_type);
84 main(
int argc,
char **argv)
86 boost::asio::io_service io_service;
88 boost::asio::deadline_timer timer_(io_service);
89 boost::asio::deadline_timer reconnect_timer_(io_service);
90 boost::asio::deadline_timer attmsg_timer_(io_service);
91 boost::asio::deadline_timer blink_timer_(io_service);
102 boost::asio::signal_set signals(io_service, SIGINT, SIGTERM);
105 signals.async_wait(signal_handler);
113 google::protobuf::ShutdownProtobufLibrary();
boost::signals2::signal< void(uint16_t, uint16_t, std::shared_ptr< google::protobuf::Message >)> & signal_received()
Signal that is invoked when a message has been received.
boost::signals2::signal< void()> & signal_connected()
Signal that is invoked when the connection has been established.
void async_connect(const char *host, unsigned short port)
Asynchronous connect.
Stream client for protobuf message transmission.