A component which writes data reports to a tcp/ip socket. It can serve different clients. It uses a ASCI-based protocol. More...
#include <TcpReporting.hpp>
Public Member Functions | |
bool | configureHook () |
const RTT::PropertyBag * | getReport () |
bool | startHook () |
void | stopHook () |
TcpReporting (std::string fr_name="ReportingComponent") | |
~TcpReporting () | |
Protected Attributes | |
RTT::SocketMarshaller * | fbody |
Private Attributes | |
bool | _finishing |
unsigned int | port |
RTT::Property< unsigned int > | port_prop |
A component which writes data reports to a tcp/ip socket. It can serve different clients. It uses a ASCI-based protocol.
The server accepts different kinds of commands. Before these commands are available for the client, the client has to authenticate itself.
"VERSION 1.0\n"
"101 OK\n"
"106 not supported\n"
The client can get the available commands
"HELP\n"
"Use HELP <command>\n CommandName1\n CommandName2\n ... CommandNameN\n."
and the syntax for each command.
"HELP CommandName\n"
"Name: CommandName\n Usage: CommandName CommandSyntax\n"
The client can get the names of all the available data.
"HEADERS\n"
"305 DataName1\n 305 DataName2\n ... 305 DataNameN\n 306 End of list\n"
The client has to send the server the names of the available data he wants to get. Only the subscribed data will be send to the client.
"SUBSCRIBE DataNameX\n"
"302 DataNameX\n"
"301 DataNameX\n"
The client can cancel a subscription.
"UNSUBSCRIBE DataNameX\n"
"303 DataNameX\n"
"304 DataNameX\n"
The client can ask for the subscriptions he has made.
"SUBS\n"
"305 DataNameX1\n 305 DataNameX2\n ... 305 DataNameXN\n 306 End of list\n"
The client can start and stop the streaming of the subscribed data.
"SILENCE OFF\n"
"SILENCE ON\n"
"107 SILENCE ON/OFF\n"
The client can close the connection with the server.
"QUIT\n"
"EXIT\n"
"104 Bye Bye\n"
When an error occurs because of wrong syntax the server will answer with an error message.
"102 Syntax: CommandNameX CommandSyntaxX\n"
When the streaming is started the server will send the following message at each timeframe.
"201 framenr --- begin of frame\n 202 DataNameX1\n 205 DataValueX1\n 202 DataNameX2\n 205 DataValueX2\n ... 202 DataNameXN\n 205 DataValueXN\n 203 framenr --- end of frame\n"
Definition at line 170 of file TcpReporting.hpp.
OCL::TcpReporting::TcpReporting | ( | std::string | fr_name = "ReportingComponent" | ) |
Create a reporting component which starts up a server
fr_name | Name of the TCP reporting component. |
port | Port to listen on. |
Definition at line 214 of file TcpReporting.cpp.
Definition at line 222 of file TcpReporting.cpp.
bool OCL::TcpReporting::configureHook | ( | ) | [virtual] |
Implementation of base::TaskCore::configureHook(). Calls load().
Reimplemented from OCL::ReportingComponent.
Definition at line 232 of file TcpReporting.cpp.
const RTT::PropertyBag * OCL::TcpReporting::getReport | ( | ) |
Return a property bag.
Definition at line 226 of file TcpReporting.cpp.
bool OCL::TcpReporting::startHook | ( | ) | [virtual] |
Reimplemented from OCL::ReportingComponent.
Definition at line 237 of file TcpReporting.cpp.
void OCL::TcpReporting::stopHook | ( | ) | [virtual] |
Reimplemented from OCL::ReportingComponent.
Definition at line 246 of file TcpReporting.cpp.
bool OCL::TcpReporting::_finishing [private] |
Flag to indicate that shutdown() has been called and changes in the list of reported data should not be reported to the client anymore.
Definition at line 179 of file TcpReporting.hpp.
RTT::SocketMarshaller* OCL::TcpReporting::fbody [protected] |
marsh::MarshallInterface
Definition at line 186 of file TcpReporting.hpp.
unsigned int OCL::TcpReporting::port [private] |
Definition at line 180 of file TcpReporting.hpp.
RTT::Property<unsigned int> OCL::TcpReporting::port_prop [private] |
Definition at line 181 of file TcpReporting.hpp.