24 #include "goby/acomms/connect.h" 25 #include "goby/acomms/queue.h" 26 #include "goby/util/binary.h" 27 #include "simple.pb.h" 30 using goby::acomms::operator<<;
45 cfg.set_modem_id(our_id);
46 cfg.add_message_entry()->set_protobuf_name(
"Simple");
58 msg.set_telegram(
"hello all!");
61 std::cout <<
"1. pushing message to queue 1: " << msg << std::endl;
64 std::cout <<
"2. " << q_manager << std::endl;
71 <<
"3. executing loopback (simulating sending a message to ourselves over the modem link)" 77 request_msg.set_max_frame_bytes(32);
78 request_msg.set_max_num_frames(1);
82 std::cout <<
"4. requesting data, got: " << request_msg << std::endl;
83 std::cout <<
"\tdata as hex: " << goby::util::hex_encode(request_msg.frame(0)) << std::endl;
98 std::cout <<
"5. received message: " << msg << std::endl;
provides an API to the goby-acomms Queuing Library.
boost::signals2::signal< void(const google::protobuf::Message &msg)> signal_receive
Signals when a DCCL message is received.
void handle_modem_data_request(protobuf::ModemTransmission *msg)
Finds data to send to the modem.
void handle_modem_receive(const protobuf::ModemTransmission &message)
Receive incoming data from the modem.
void connect(Signal *signal, Slot slot)
connect a signal to a slot (e.g. function pointer)
void set_cfg(const protobuf::QueueManagerConfig &cfg)
Set (and overwrite completely if present) the current configuration. (protobuf::QueueManagerConfig de...
void push_message(const google::protobuf::Message &new_message)
Push a message (and add the queue if it does not exist)