#include <uwjammer.h>
Class that describes a Uwjammer module
◆ JammerStatus
Enum that rapresents the status of the protocol machine state.
◆ Uwjammer()
◆ ~Uwjammer()
| virtual Uwjammer::~Uwjammer |
( |
| ) |
|
|
virtualdefault |
◆ command()
| int Uwjammer::command |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| |
|
overridevirtual |
TCL command interpreter. It implements the following OTcl methods:
- Parameters
-
| argc | Number of arguments in argv. |
| argv | Array of strings which are the command parameters (Note that argv[0] is the name of the object). |
- Returns
- TCL_OK or TCL_ERROR whether the command has been dispatched successfully or not.
References getDataDiscarded(), getJamDiscarded(), getJamSent(), and Q_data.
◆ crLayCommand()
| int Uwjammer::crLayCommand |
( |
ClMessage * |
m | ) |
|
|
overridevirtual |
Cross-Layer messages interpreter
- Parameters
-
| ClMessage* | an instance of ClMessage that represent the message received |
- Returns
- 0 if successful.
◆ getDataDiscarded()
| int Uwjammer::getDataDiscarded |
( |
| ) |
const |
|
inlineprotected |
Returns the number of packets received and discarded during the simulation.
- Returns
- int n_data_discarded the number of packets sent
References n_data_discarded.
Referenced by command().
◆ getJamDiscarded()
| int Uwjammer::getJamDiscarded |
( |
| ) |
const |
|
inlineprotected |
Returns the number of packets discarded during the simulation because the buffer is full.
- Returns
- int n_jam_discarded the number of packets discarded
References n_jam_discarded.
Referenced by command().
◆ getJamSent()
| int Uwjammer::getJamSent |
( |
| ) |
const |
|
inlineprotected |
Returns the number of packets sent during the simulation.
- Returns
- int n_jam_sent the number of packets sent
References n_jam_sent.
Referenced by command().
◆ Mac2PhyStartTx()
| void Uwjammer::Mac2PhyStartTx |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Pass the packet to the PHY layer
- Parameters
-
| Packet* | Pointer to an object of type Packet that represent the Packet to transmit |
References BUSY, and refreshState().
Referenced by txJam().
◆ Phy2MacEndRx()
| void Uwjammer::Phy2MacEndRx |
( |
Packet * |
p | ) |
|
|
overrideprotectedvirtual |
Method called when the Phy Layer finish to receive a Packet.
- Parameters
-
| Packet* | Pointer to an object of type Packet that represent the Packet received |
References n_data_discarded.
◆ Phy2MacEndTx()
| void Uwjammer::Phy2MacEndTx |
( |
const Packet * |
p | ) |
|
|
overrideprotectedvirtual |
Method called when the PHY layer finish to transmit the packet.
- Parameters
-
| Packet* | Pointer to an object of type Packet that represent the Packet transmitted |
References IDLE, refreshState(), and stateIdle().
◆ recvFromUpperLayers()
| void Uwjammer::recvFromUpperLayers |
( |
Packet * |
p | ) |
|
|
overrideprotectedvirtual |
◆ refreshState()
◆ stateIdle()
| void Uwjammer::stateIdle |
( |
| ) |
|
|
protectedvirtual |
◆ txJam()
◆ buffer_data_pkts
| int Uwjammer::buffer_data_pkts |
|
protected |
◆ curr_data_pkt
| Packet* Uwjammer::curr_data_pkt |
|
protected |
Pointer to the current DATA packet.
Referenced by txJam().
◆ curr_state
◆ JAMMER_uid
| uint Uwjammer::JAMMER_uid |
|
protected |
◆ MAX_BUFFER_SIZE
| constexpr const int Uwjammer::MAX_BUFFER_SIZE |
|
staticconstexprprotected |
Initial value:Maximum size of the queue in number of packets.
Referenced by Uwjammer().
◆ n_data_discarded
| size_t Uwjammer::n_data_discarded |
|
protected |
◆ n_jam_discarded
| size_t Uwjammer::n_jam_discarded |
|
protected |
◆ n_jam_sent
| size_t Uwjammer::n_jam_sent |
|
protected |
◆ node_id
Unique Node ID.
Referenced by txJam().
◆ Q_data
| std::queue<Packet *> Uwjammer::Q_data |
|
protected |
◆ status_info
Initial value:Textual info of the state.
The documentation for this class was generated from the following files: