User Manual, Developers Guide and API Documentation

copper::Transmitter Class Reference

Transmitter with configurable sensing time (detect wire free or busy). More...

#include <Transmitter.hpp>

Inheritance diagram for copper::Transmitter:

Inheritance graph
[legend]
Collaboration diagram for copper::Transmitter:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void onDataSent (wns::osi::PDUPtr pdu)
 Transmitter (const wns::pyconfig::View &pyco, WireInterface *wire)
 Constructor.
virtual ~Transmitter ()
 Destructor.
wns::service::phy::copper::DataTransmission Interface
virtual void cancelData (const wns::osi::PDUPtr &data)
 Stop an ongoing transmission.
virtual bool isFree () const
 Indicates if the wire is available for transmission.
virtual void sendData (const wns::service::dll::UnicastAddress &peerAddress, const wns::osi::PDUPtr &data)
 Unicast transmission of data.
virtual void sendData (const wns::service::dll::BroadcastAddress &, const wns::osi::PDUPtr &data)
 Broadcast transmission of data.

Private Types

typedef
wns::service::phy::copper::Handler 
Handler
typedef
wns::service::phy::copper::DataTransmission 
Super

Private Member Functions

simTimeType getDuration (Bit len)
 Calculate how long it takes to transmit "len" Bit.

Private Attributes

double dataRate
 The data rate the transmitter is able to use for tranmission.
wns::logger::Logger logger
 Logger.
simTimeType sensingTime
 Time needed to detect the state of the wire (free or busy).
WireInterfacewire
 Wire to be used for transmission.


Detailed Description

This transmitter can detect ongoing transmissions after a configurable amount time (sensing time). Setting this time to 0.0 (the default) allows collision free operation.

Definition at line 61 of file Transmitter.hpp.


Member Typedef Documentation

Definition at line 70 of file Transmitter.hpp.

Definition at line 67 of file Transmitter.hpp.


Constructor & Destructor Documentation

Transmitter::Transmitter ( const wns::pyconfig::View pyco,
WireInterface wire 
)

Definition at line 34 of file Transmitter.cpp.

Transmitter::~Transmitter (  )  [virtual]

Definition at line 47 of file Transmitter.cpp.


Member Function Documentation

void Transmitter::cancelData ( const wns::osi::PDUPtr data  )  [virtual]

Implements wns::service::phy::copper::DataTransmission.

Definition at line 79 of file Transmitter.cpp.

simTimeType Transmitter::getDuration ( Bit  len  )  [private]

Definition at line 103 of file Transmitter.cpp.

bool Transmitter::isFree (  )  const [virtual]

Returns:
false if transmission is ongoing, true otherwise
Note:
Depending on the implementation this method might behave differently for the same state of the wire. Consider the following: At time "t" a transmission is started by transmitter A. A second transmitter (B) wants to transmit data, too, at the same time. Normally transmitter B would not be able to detect that the wire is already occupied by another transmission. However, in order to have the ability to test simple Data Link Layer implementations (that assume coillision free transmissions) it might be useful to return "true" in this case. Please check the copper implementation you're using for details.

Implements wns::service::phy::copper::DataTransmission.

Definition at line 88 of file Transmitter.cpp.

void Transmitter::onDataSent ( wns::osi::PDUPtr  pdu  )  [virtual]

Implements copper::TransmitterDataSentInterface.

Definition at line 95 of file Transmitter.cpp.

void Transmitter::sendData ( const wns::service::dll::UnicastAddress macAddress,
const wns::osi::PDUPtr data 
) [virtual]

Parameters:
[in] macAddress MAC address of the peer entitiy
[in] data Protocol Data Unit to be transmitted

Implements wns::service::phy::copper::DataTransmission.

Definition at line 66 of file Transmitter.cpp.

void Transmitter::sendData ( const wns::service::dll::BroadcastAddress macAddress,
const wns::osi::PDUPtr data 
) [virtual]

Parameters:
[in] macAddress The Broadcast address
[in] data Protocol Data Unit to be transmitted

Implements wns::service::phy::copper::DataTransmission.

Definition at line 53 of file Transmitter.cpp.


Member Data Documentation

Definition at line 129 of file Transmitter.hpp.

Definition at line 140 of file Transmitter.hpp.

Definition at line 135 of file Transmitter.hpp.

Definition at line 124 of file Transmitter.hpp.


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

Generated on Sat May 26 03:32:29 2012 for openWNS by  doxygen 1.5.5