Goby v2
Public Member Functions | List of all members
goby::pb::PBDriver Class Reference
Inheritance diagram for goby::pb::PBDriver:
Inheritance graph
[legend]

Public Member Functions

 PBDriver (goby::common::ZeroMQService *zeromq_service)
 
void startup (const acomms::protobuf::DriverConfig &cfg)
 Starts the modem driver. Must be called before poll(). More...
 
void shutdown ()
 Shuts down the modem driver.
 
void do_work ()
 Allows the modem driver to do its work. More...
 
void handle_initiate_transmission (const acomms::protobuf::ModemTransmission &m)
 Virtual initiate_transmission method. Typically connected to MACManager::signal_initiate_transmission() using bind(). More...
 
- Public Member Functions inherited from goby::acomms::ModemDriverBase
virtual ~ModemDriverBase ()
 Public Destructor.
 
int driver_order ()
 
virtual void update_cfg (const protobuf::DriverConfig &cfg)
 Update configuration while running (not required to be implemented)
 
- Public Member Functions inherited from goby::pb::StaticProtobufNode
 StaticProtobufNode (common::ZeroMQService *service)
 
template<typename ProtoBufMessage >
void subscribe (int socket_id, boost::function< void(const ProtoBufMessage &)> handler=boost::function< void(const ProtoBufMessage &)>(), const std::string &group="")
 Subscribe to a message (of any type derived from google::protobuf::Message) More...
 
template<typename ProtoBufMessage , class C >
void subscribe (int socket_id, void(C::*mem_func)(const ProtoBufMessage &), C *obj, const std::string &group="")
 
template<typename ProtoBufMessage >
void on_receipt (int socket_id, boost::function< void(const ProtoBufMessage &)> handler=boost::function< void(const ProtoBufMessage &)>(), const std::string &group="")
 
template<typename ProtoBufMessage , class C >
void on_receipt (int socket_id, void(C::*mem_func)(const ProtoBufMessage &), C *obj, const std::string &group="")
 
void send (const google::protobuf::Message &msg, int socket_id, const std::string &group="")
 
- Public Member Functions inherited from goby::common::NodeInterface< google::protobuf::Message >
ZeroMQServicezeromq_service ()
 

Additional Inherited Members

- Public Attributes inherited from goby::acomms::ModemDriverBase
boost::signals2::signal< void(const protobuf::ModemTransmission &message)> signal_receive
 Called when a binary data transmission is received from the modem. More...
 
boost::signals2::signal< void(const protobuf::ModemTransmission &message)> signal_transmit_result
 Called when a transmission is completed. More...
 
boost::signals2::signal< void(protobuf::ModemTransmission *msg)> signal_data_request
 Called when the modem or modem driver needs data to send. The returned data should be stored in ModemTransmission::frame. More...
 
boost::signals2::signal< void(protobuf::ModemTransmission *msg_request)> signal_modify_transmission
 Called before the modem driver begins processing a transmission. This allows a third party to modify the parameters of the transmission (such as destination or rate) on the fly. More...
 
boost::signals2::signal< void(const protobuf::ModemRaw &msg)> signal_raw_incoming
 Called after any message is received from the modem by the driver. Used by the MACManager for auto-discovery of vehicles. Also useful for higher level analysis and debugging of the transactions between the driver and the modem. More...
 
boost::signals2::signal< void(const protobuf::ModemRaw &msg)> signal_raw_outgoing
 Called after any message is sent from the driver to the modem. Useful for higher level analysis and debugging of the transactions between the driver and the modem. More...
 
- Protected Member Functions inherited from goby::acomms::ModemDriverBase
 ModemDriverBase ()
 Constructor.
 
void modem_write (const std::string &out)
 write a line to the serial port. More...
 
bool modem_read (std::string *in)
 read a line from the serial port, including end-of-line character(s) More...
 
void modem_start (const protobuf::DriverConfig &cfg)
 start the physical connection to the modem (serial port, TCP, etc.). must be called before ModemDriverBase::modem_read() or ModemDriverBase::modem_write() More...
 
void modem_close ()
 closes the serial port. Use modem_start to reopen the port.
 
const std::string & glog_out_group () const
 
const std::string & glog_in_group () const
 
util::LineBasedInterfacemodem ()
 use for direct access to the modem
 
- Protected Member Functions inherited from goby::pb::ProtobufNode
 ProtobufNode (common::ZeroMQService *service)
 
void subscribe (const std::string &identifier, int socket_id)
 
void subscribe (const std::string &protobuf_type_name, int socket_id, const std::string &group)
 
- Protected Member Functions inherited from goby::common::NodeInterface< google::protobuf::Message >
 NodeInterface (ZeroMQService *service)
 
- Static Protected Attributes inherited from goby::acomms::ModemDriverBase
static int count_ = 0
 

Detailed Description

Definition at line 38 of file pb_modem_driver.h.

Member Function Documentation

void goby::pb::PBDriver::do_work ( )
virtual

Allows the modem driver to do its work.

Should be called regularly to perform the work of the driver as the driver does not run in its own thread. This allows us to guarantee that no signals are called except inside this method. Does not block.

Implements goby::acomms::ModemDriverBase.

Definition at line 126 of file pb_modem_driver.cpp.

void goby::pb::PBDriver::handle_initiate_transmission ( const acomms::protobuf::ModemTransmission m)
virtual

Virtual initiate_transmission method. Typically connected to MACManager::signal_initiate_transmission() using bind().

Parameters
mModemTransmission (defined in acomms_modem_message.proto) containing the details of the transmission to be started. This may contain data frames. If not, data will be requested when the driver calls the data request signal (ModemDriverBase::signal_data_request)

Implements goby::acomms::ModemDriverBase.

Definition at line 61 of file pb_modem_driver.cpp.

void goby::pb::PBDriver::startup ( const acomms::protobuf::DriverConfig cfg)
virtual

Starts the modem driver. Must be called before poll().

Parameters
cfgStartup configuration for the driver and modem. DriverConfig is defined in acomms_driver_base.proto. Derived classes can define extensions (see http://code.google.com/apis/protocolbuffers/docs/proto.html#extensions) to DriverConfig to handle modem specific configuration.

Implements goby::acomms::ModemDriverBase.

Definition at line 44 of file pb_modem_driver.cpp.


The documentation for this class was generated from the following files: