$search

Aseba::Hub Class Reference
[Software router of messages on TCP and D-Bus.]

#include <medulla.h>

Inheritance diagram for Aseba::Hub:
Inheritance graph
[legend]

List of all members.

Signals

void firstConnectionCreated ()
void messageAvailable (Message *message, Dashel::Stream *sourceStream)

Public Member Functions

 Hub (unsigned port, bool verbose, bool dump, bool forward, bool rawTime, bool systemBus)
void sendMessage (Message &message, Dashel::Stream *sourceStream=0)
void sendMessage (Message *message, Dashel::Stream *sourceStream=0)

Protected Slots

void firstConnectionAvailable ()
 If no description has been previously requested, requests one in 200 ms.
void requestDescription ()
 Timer has elapsed, request a description.

Private Member Functions

virtual void connectionClosed (Dashel::Stream *stream, bool abnormal)
virtual void connectionCreated (Dashel::Stream *stream)
virtual void incomingData (Dashel::Stream *stream)
virtual void run ()

Private Attributes

bool dump
 should we dump content of CAN messages
bool forward
 should we only forward messages instead of transmit them back to the sender
bool rawTime
 should displayed timestamps be of the form sec:usec since 1970
bool verbose
 should we print a notification on each message

Detailed Description

Route Aseba messages on the TCP part of the network.

This thread only *receives* messages. All dispatch, including forwarding, is done in the main thread called by the AsebaNetworkInterface class.

Definition at line 141 of file medulla.h.


Constructor & Destructor Documentation

Aseba::Hub::Hub ( unsigned  port,
bool  verbose,
bool  dump,
bool  forward,
bool  rawTime,
bool  systemBus 
)

Creates the hub, listen to TCP on port, and creates a DBus interace.

Parameters:
port port on which to listen for incoming connections
verbose should we print a notification on each message
dump should we dump content of each message
forward should we only forward messages instead of transmit them back to the sender
rawTime should the time be printed as integer

Member Function Documentation

virtual void Aseba::Hub::connectionClosed ( Dashel::Stream stream,
bool  abnormal 
) [private, virtual]

Reimplemented from Dashel::Hub.

virtual void Aseba::Hub::connectionCreated ( Dashel::Stream stream  )  [private, virtual]

Reimplemented from Dashel::Hub.

void Aseba::Hub::firstConnectionAvailable (  )  [protected, slot]

If no description has been previously requested, requests one in 200 ms.

void Aseba::Hub::firstConnectionCreated (  )  [signal]
virtual void Aseba::Hub::incomingData ( Dashel::Stream stream  )  [private, virtual]

Reimplemented from Dashel::Hub.

void Aseba::Hub::messageAvailable ( Message message,
Dashel::Stream sourceStream 
) [signal]
void Aseba::Hub::requestDescription (  )  [protected, slot]

Timer has elapsed, request a description.

virtual void Aseba::Hub::run (  )  [private, virtual]

Reimplemented from Dashel::Hub.

void Aseba::Hub::sendMessage ( Message message,
Dashel::Stream sourceStream = 0 
)

Sends a message to Dashel peers. Convenience overload

void Aseba::Hub::sendMessage ( Message message,
Dashel::Stream sourceStream = 0 
)

Sends a message to Dashel peers. Does not delete the message, should be called by the main thread.

Parameters:
message aseba message to send
sourceStream originate of the message, if from Dashel.

Member Data Documentation

bool Aseba::Hub::dump [private]

should we dump content of CAN messages

Definition at line 184 of file medulla.h.

bool Aseba::Hub::forward [private]

should we only forward messages instead of transmit them back to the sender

Definition at line 185 of file medulla.h.

bool Aseba::Hub::rawTime [private]

should displayed timestamps be of the form sec:usec since 1970

Definition at line 186 of file medulla.h.

bool Aseba::Hub::verbose [private]

should we print a notification on each message

Definition at line 183 of file medulla.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


aseba
Author(s): Stéphane Magnenat
autogenerated on Sat Mar 2 12:31:54 2013