|
Fawkes API
Fawkes Development Version
|
OpenPRS communication wrapper. More...
#include <>>
Public Types | |
| typedef boost::signals2::signal< void(std::string, std::string)> | signal_msg_rcvd_type |
| Boost signal for a received message. More... | |
Public Member Functions | |
| OpenPRSComm (const char *local_name, const char *hostname, unsigned short port, OpenPRSServerProxy *server_proxy, Logger *logger=NULL) | |
| Constructor. More... | |
| virtual | ~OpenPRSComm () |
| Destructor. More... | |
| const std::string & | name () const |
| Get OpenPRS local name. More... | |
| void | send_message (const char *recipient, const char *message) |
| Send a message to an OpenPRS kernel. More... | |
| void | broadcast_message (const char *message) |
| Send a message to all OpenPRS kernels. More... | |
| void | multicast_message (std::vector< const char * > &recipients, const char *message) |
| Send a message to multiple OpenPRS kernel. More... | |
| void | send_message (const std::string &recipient, const std::string &message) |
| Send a message to an OpenPRS kernel. More... | |
| void | broadcast_message (const std::string &message) |
| Send a message to all OpenPRS kernels. More... | |
| void | multicast_message (const std::vector< std::string > &recipients, const std::string &message) |
| Send a message to multiple OpenPRS kernel. More... | |
| void | send_message_f (const std::string &recipient, const char *format,...) |
| Send a formatted message to an OpenPRS kernel. More... | |
| void | broadcast_message_f (const char *format,...) |
| Send a formatted message to all OpenPRS kernels. More... | |
| void | multicast_message_f (const std::vector< std::string > &recipients, const char *format,...) |
| Send a message to multiple OpenPRS kernel. More... | |
| void | transmit_command (const char *recipient, const char *message) |
| Transmit a command to an OpenPRS kernel. More... | |
| void | transmit_command (const std::string &recipient, const std::string &message) |
| Transmit a command to an OpenPRS kernel. More... | |
| void | transmit_command_f (const std::string &recipient, const char *format,...) |
| Transmit a command to an OpenPRS kernel. More... | |
| signal_msg_rcvd_type & | signal_msg_rcvd () |
| Signal that is invoked when a message has been received. More... | |
OpenPRS communication wrapper.
This class provides communication facilities via the OpenPRS message passer as well as through the OpenPRS server proxy.
Definition at line 37 of file openprs_comm.h.
| typedef boost::signals2::signal<void(std::string, std::string)> fawkes::OpenPRSComm::signal_msg_rcvd_type |
Boost signal for a received message.
Definition at line 72 of file openprs_comm.h.
| fawkes::OpenPRSComm::OpenPRSComm | ( | const char * | local_name, |
| const char * | hostname, | ||
| unsigned short | port, | ||
| OpenPRSServerProxy * | server_proxy, | ||
| Logger * | logger = NULL |
||
| ) |
Constructor.
| local_name | the local name with which the communication wrapper will be registered to the message parser. This can be used to send messages from the kernel. |
| hostname | host where the message passer runs |
| port | TCP port where the message passer listens |
| server_proxy | server proxy to use to send commands to kernels |
| logger | logger for informational messages (optional) |
Definition at line 64 of file openprs_comm.cpp.
|
virtual |
Destructor.
Definition at line 87 of file openprs_comm.cpp.
| void fawkes::OpenPRSComm::broadcast_message | ( | const char * | message | ) |
Send a message to all OpenPRS kernels.
| message | message to send, cf. OpenPRS manual for valid messages |
Definition at line 110 of file openprs_comm.cpp.
| void fawkes::OpenPRSComm::broadcast_message | ( | const std::string & | message | ) |
Send a message to all OpenPRS kernels.
| message | message to send, cf. OpenPRS manual for valid messages |
Definition at line 139 of file openprs_comm.cpp.
| void fawkes::OpenPRSComm::broadcast_message_f | ( | const char * | format, |
| ... | |||
| ) |
Send a formatted message to all OpenPRS kernels.
| format | format for message to send according to sprintf() |
Definition at line 183 of file openprs_comm.cpp.
| void fawkes::OpenPRSComm::multicast_message | ( | const std::vector< std::string > & | recipients, |
| const std::string & | message | ||
| ) |
Send a message to multiple OpenPRS kernel.
| recipients | Vector of OpenPRS kernel names to send to |
| message | message to send, cf. OpenPRS manual for valid messages |
Definition at line 149 of file openprs_comm.cpp.
| void fawkes::OpenPRSComm::multicast_message | ( | std::vector< const char * > & | recipients, |
| const char * | message | ||
| ) |
Send a message to multiple OpenPRS kernel.
| recipients | Vector of OpenPRS kernel names to send to |
| message | message to send, cf. OpenPRS manual for valid messages |
Definition at line 120 of file openprs_comm.cpp.
| void fawkes::OpenPRSComm::multicast_message_f | ( | const std::vector< std::string > & | recipients, |
| const char * | format, | ||
| ... | |||
| ) |
Send a message to multiple OpenPRS kernel.
| recipients | Vector of OpenPRS kernel names to send to |
| format | format for message to send according to sprintf() |
Definition at line 202 of file openprs_comm.cpp.
|
inline |
| void fawkes::OpenPRSComm::send_message | ( | const char * | recipient, |
| const char * | message | ||
| ) |
Send a message to an OpenPRS kernel.
| recipient | OpenPRS kernel name to send to |
| message | message to send, cf. OpenPRS manual for valid messages |
Definition at line 101 of file openprs_comm.cpp.
| void fawkes::OpenPRSComm::send_message | ( | const std::string & | recipient, |
| const std::string & | message | ||
| ) |
Send a message to an OpenPRS kernel.
| recipient | OpenPRS kernel name to send to |
| message | message to send, cf. OpenPRS manual for valid messages |
Definition at line 130 of file openprs_comm.cpp.
| void fawkes::OpenPRSComm::send_message_f | ( | const std::string & | recipient, |
| const char * | format, | ||
| ... | |||
| ) |
Send a formatted message to an OpenPRS kernel.
| recipient | OpenPRS kernel name to send to |
| format | format for message to send according to sprintf() |
Definition at line 165 of file openprs_comm.cpp.
|
inline |
Signal that is invoked when a message has been received.
Definition at line 78 of file openprs_comm.h.
| void fawkes::OpenPRSComm::transmit_command | ( | const char * | recipient, |
| const char * | message | ||
| ) |
Transmit a command to an OpenPRS kernel.
This works equivalent to the transmit oprs-server console command.
| recipient | OpenPRS kernel name to send to |
| message | command to send, cf. OpenPRS manual for valid commands |
Definition at line 229 of file openprs_comm.cpp.
References fawkes::OpenPRSServerProxy::transmit_command().
| void fawkes::OpenPRSComm::transmit_command | ( | const std::string & | recipient, |
| const std::string & | message | ||
| ) |
Transmit a command to an OpenPRS kernel.
This works equivalent to the transmit oprs-server console command.
| recipient | OpenPRS kernel name to send to |
| message | command to send, cf. OpenPRS manual for valid commands |
Definition at line 240 of file openprs_comm.cpp.
References fawkes::OpenPRSServerProxy::transmit_command().
| void fawkes::OpenPRSComm::transmit_command_f | ( | const std::string & | recipient, |
| const char * | format, | ||
| ... | |||
| ) |
Transmit a command to an OpenPRS kernel.
This works equivalent to the transmit oprs-server console command. This function allows to pass a format according to the sprintf() format and its arguments.
| recipient | OpenPRS kernel name to send to |
| format | format string for the command, must be followed by the appropriate number and types of arguments. |
Definition at line 254 of file openprs_comm.cpp.
References fawkes::OpenPRSServerProxy::transmit_command_v().
Referenced by fawkes::OpenPRSAspectIniFin::init().