#include <uwjammer.h>
Class that describes a Uwjammer module.
Definition at line 54 of file uwjammer.h.
◆ JammerStatus
Enum that rapresents the status of the protocol machine state.
Definition at line 93 of file uwjammer.h.
◆ 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.
Definition at line 92 of file uwjammer.cpp.
◆ 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.
Definition at line 134 of file uwjammer.cpp.
◆ 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
Definition at line 154 of file uwjammer.h.
◆ 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
Definition at line 147 of file uwjammer.h.
◆ 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
Definition at line 140 of file uwjammer.h.
◆ 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 |
Definition at line 190 of file uwjammer.cpp.
◆ 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 |
Definition at line 221 of file uwjammer.cpp.
◆ 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 |
Definition at line 201 of file uwjammer.cpp.
◆ recvFromUpperLayers()
void Uwjammer::recvFromUpperLayers |
( |
Packet * |
p | ) |
|
|
overrideprotectedvirtual |
Receives the packet from the upper layer (e.g.
IP)
- Parameters
-
Packet* | pointer to the packet received |
Definition at line 143 of file uwjammer.cpp.
◆ refreshState()
Refresh the state of the protocol.
- Parameters
-
JammerStatus | current state of the protcol |
Definition at line 161 of file uwjammer.h.
◆ stateIdle()
void Uwjammer::stateIdle |
( |
| ) |
|
|
protectedvirtual |
IDLE state, check if there is at least one more packet to transmit.
Definition at line 214 of file uwjammer.cpp.
◆ txJam()
Transmits the jam packet (calling Mac2PhyStartTx) and increment the counter of transmitted jam packets.
Definition at line 167 of file uwjammer.cpp.
◆ buffer_data_pkts
int Uwjammer::buffer_data_pkts |
|
protected |
Size of the buffer in number of packets.
Definition at line 163 of file uwjammer.h.
◆ curr_data_pkt
Packet* Uwjammer::curr_data_pkt |
|
protected |
Pointer to the current DATA packet.
Definition at line 170 of file uwjammer.h.
◆ curr_state
Current state of the protocol.
Definition at line 173 of file uwjammer.h.
◆ JAMMER_uid
uint Uwjammer::JAMMER_uid |
|
protected |
◆ MAX_BUFFER_SIZE
constexpr const int Uwjammer::MAX_BUFFER_SIZE = 100 |
|
staticconstexprprotected |
Maximum size of the queue in number of packets.
Definition at line 176 of file uwjammer.h.
◆ n_data_discarded
size_t Uwjammer::n_data_discarded |
|
protected |
Number of packets received and discarded.
Definition at line 168 of file uwjammer.h.
◆ n_jam_discarded
size_t Uwjammer::n_jam_discarded |
|
protected |
Number of packets discarded because the buffer is full.
Definition at line 167 of file uwjammer.h.
◆ n_jam_sent
size_t Uwjammer::n_jam_sent |
|
protected |
Number of packets sent.
Definition at line 166 of file uwjammer.h.
◆ node_id
◆ Q_data
std::queue<Packet *> Uwjammer::Q_data |
|
protected |
Queue of DATA in number of packets.
Definition at line 171 of file uwjammer.h.
◆ status_info
Initial value:
Textual info of the state.
Definition at line 44 of file uwjammer.h.
The documentation for this class was generated from the following files: