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<<;
34 int main(
int argc,
char* argv[])
51 cfg.set_modem_id(our_id);
52 cfg.add_message_entry()->set_protobuf_name(
"Simple");
64 msg.set_telegram(
"hello 1!");
65 std::cout <<
"1.a. pushing message to queue 1: " << msg << std::endl;
68 msg.set_telegram(
"hello 2!");
69 std::cout <<
"1.b. pushing message to queue 1: " << msg << std::endl;
73 std::cout <<
"2. " << q_manager << std::endl;
80 <<
"3. executing loopback (simulating sending a message to ourselves over the modem link)" 86 request_msg.set_max_frame_bytes(64);
87 request_msg.set_max_num_frames(1);
91 std::cout <<
"4. requesting data, got: " << request_msg << std::endl;
92 std::cout <<
"\tdata as hex: " << goby::util::hex_encode(request_msg.frame(0)) << std::endl;
107 std::cout <<
"5. received message: " << msg << std::endl;
provides an API to the goby-acomms Queuing Library.
void set_name(const std::string &s)
Set the name of the application that the logger is serving.
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)
common::FlexOstream glog
Access the Goby logger through this object.
void set_cfg(const protobuf::QueueManagerConfig &cfg)
Set (and overwrite completely if present) the current configuration. (protobuf::QueueManagerConfig de...
void add_stream(logger::Verbosity verbosity=logger::VERBOSE, std::ostream *os=0)
Attach a stream object (e.g. std::cout, std::ofstream, ...) to the logger with desired verbosity...
void push_message(const google::protobuf::Message &new_message)
Push a message (and add the queue if it does not exist)