#include <uwtdma.h>
Class that represents a TDMA Node.
Definition at line 91 of file uwtdma.h.
◆ UWTDMA_STATUS
Enumeration class of UWTDMA status.
Enumerator |
---|
IDLE | |
TRANSMITTING | |
RECEIVING | |
Definition at line 206 of file uwtdma.h.
◆ UwTDMA()
Constructor of the TDMA class.
Definition at line 79 of file uwtdma.cpp.
◆ ~UwTDMA()
Destructor of the TDMA class.
Definition at line 140 of file uwtdma.cpp.
◆ changeStatus()
void UwTDMA::changeStatus |
( |
| ) |
|
|
protectedvirtual |
Alternate TDMA status between MY_STATUS and NOT_MY_STATUS.
Reimplemented in UwTDMA_frame.
Definition at line 359 of file uwtdma.cpp.
◆ command()
int UwTDMA::command |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| |
|
protectedvirtual |
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.
Reimplemented in UwTDMA_frame, and UwRangingTDMA.
Definition at line 423 of file uwtdma.cpp.
◆ getEpoch()
unsigned long int UwTDMA::getEpoch |
( |
| ) |
|
|
inlineprotected |
Calculate the epoch of the event.
Used in sea-trial mode
- Returns
- the epoch of the system
Definition at line 186 of file uwtdma.h.
◆ initPkt()
void UwTDMA::initPkt |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Method called to add the MAC header size.
- Parameters
-
const | Packet* Pointer to an Packet object that rapresent the Packet in transmission |
Definition at line 341 of file uwtdma.cpp.
◆ Mac2PhyStartTx()
void UwTDMA::Mac2PhyStartTx |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Method called when the Mac Layer start to transmit a Packet.
- Parameters
-
const | Packet* Pointer to an Packet object that rapresent the Packet in transmission |
Reimplemented in UwRangingTDMA.
Definition at line 236 of file uwtdma.cpp.
◆ Phy2MacEndRx()
void UwTDMA::Phy2MacEndRx |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Method called when the Phy Layer finish to receive a Packet.
- Parameters
-
const | Packet* Pointer to an Packet object that rapresent the Packet in reception |
Reimplemented in UwRangingTDMA.
Definition at line 281 of file uwtdma.cpp.
◆ Phy2MacEndTx()
void UwTDMA::Phy2MacEndTx |
( |
const Packet * |
p | ) |
|
|
protectedvirtual |
Method called when the Mac Layer finish to transmit a Packet.
- Parameters
-
const | Packet* Pointer to an Packet object that rapresent the Packet in transmission |
Definition at line 258 of file uwtdma.cpp.
◆ Phy2MacStartRx()
void UwTDMA::Phy2MacStartRx |
( |
const Packet * |
p | ) |
|
|
protectedvirtual |
Method called when the Phy Layer start to receive a Packet.
- Parameters
-
const | Packet* Pointer to an Packet object that rapresent the Packet in reception |
Reimplemented in UwRangingTDMA.
Definition at line 271 of file uwtdma.cpp.
◆ recvFromUpperLayers()
void UwTDMA::recvFromUpperLayers |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Receive the packet from the upper layer (e.g.
IP)
- Parameters
-
Packet* | pointer to the packet received |
Definition at line 145 of file uwtdma.cpp.
◆ recvSyncClMsg()
int UwTDMA::recvSyncClMsg |
( |
ClMessage * |
m | ) |
|
|
virtual |
Cross-Layer messages synchronous interpreter.
- Parameters
-
ClMessage* | an instance of ClMessage that represent the message received |
- Returns
- 0 if successful.
Definition at line 507 of file uwtdma.cpp.
◆ rxPacketNotForMe()
void UwTDMA::rxPacketNotForMe |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Method called when the Packet received is determined to be not for me.
- Parameters
-
const | Packet* Pointer to an Packet object that rapresent the Packet in reception |
Definition at line 352 of file uwtdma.cpp.
◆ start()
void UwTDMA::start |
( |
double |
delay | ) |
|
|
protectedvirtual |
Schedule the beginning of each TDMA cycle, each one after delay
.
- Parameters
-
delay | to await before starting the TDMA |
Definition at line 389 of file uwtdma.cpp.
◆ stateTxData()
void UwTDMA::stateTxData |
( |
| ) |
|
|
protectedvirtual |
Change transceiver status and and start to transmit if in my slot Used when there's spare time, useful for transmitting other packtes.
Reimplemented in UwRangingTDMA.
Definition at line 195 of file uwtdma.cpp.
◆ stop()
Terminate a TDMA cycle, essentially cancel the TDMA timer.
Definition at line 412 of file uwtdma.cpp.
◆ txData()
Transmit a data packet if in my slot.
Definition at line 203 of file uwtdma.cpp.
◆ UwTDMATimer
◆ buffer
std::deque<Packet *> UwTDMA::buffer |
|
protected |
Buffer of the MAC node.
Definition at line 227 of file uwtdma.h.
◆ checkPriority
int UwTDMA::checkPriority |
|
protected |
flag to set to 1 if UWCBR module uses packets with priority, set to 0 otherwise.
Priority can be used only with UWCBR module
Definition at line 238 of file uwtdma.h.
◆ debug_
Debug variable: 0 for no info, >-5 for small info, <-5 for complete info.
Definition at line 211 of file uwtdma.h.
◆ drop_old_
flag to set the drop packet policy in case of buffer overflow: if 0 (default) drops the new packet, if 1 the oldest
Definition at line 235 of file uwtdma.h.
◆ enable
◆ fair_mode
Fair modality on if 1: then only set tot_slots and common guard_time.
Definition at line 214 of file uwtdma.h.
◆ frame_duration
double UwTDMA::frame_duration |
|
protected |
Frame duration.
Definition at line 222 of file uwtdma.h.
◆ guard_time
double UwTDMA::guard_time |
|
protected |
Guard time between slots.
Definition at line 223 of file uwtdma.h.
◆ HDR_size
Size of the HDR if any.
Definition at line 221 of file uwtdma.h.
◆ max_packet_per_slot
int UwTDMA::max_packet_per_slot |
|
protected |
max numer of packet it can transmit per slot
Definition at line 232 of file uwtdma.h.
◆ max_queue_size
int UwTDMA::max_queue_size |
|
protected |
Maximum dimension of Queue.
Definition at line 231 of file uwtdma.h.
◆ name_label_
std::string UwTDMA::name_label_ |
|
protected |
label added in the log file, empty string by default
Definition at line 237 of file uwtdma.h.
◆ out_file_stats
std::ofstream UwTDMA::out_file_stats |
|
protected |
File stream for the log file.
Definition at line 228 of file uwtdma.h.
◆ packet_sent_curr_slot_
int UwTDMA::packet_sent_curr_slot_ |
|
protected |
counter of packet has been sent in the current slot
Definition at line 233 of file uwtdma.h.
◆ sea_trial_
Written log variable.
Definition at line 213 of file uwtdma.h.
◆ slot_duration
double UwTDMA::slot_duration |
|
protected |
Slot duration.
Definition at line 224 of file uwtdma.h.
◆ slot_number
set the position of the node in the frame (fair_mode) (starting from 0 to tot_slots-1)
Definition at line 218 of file uwtdma.h.
◆ slot_status
Is it my turn to transmit data?
Definition at line 210 of file uwtdma.h.
◆ start_time
double UwTDMA::start_time |
|
protected |
Time to wait before starting the protocol.
Definition at line 225 of file uwtdma.h.
◆ tdma_timer
TDMA timer handler.
Definition at line 226 of file uwtdma.h.
◆ tot_slots
Number of slots in the frame (fair_mode)
Definition at line 217 of file uwtdma.h.
◆ transceiver_status
Variable holding the status enum type.
Definition at line 209 of file uwtdma.h.
The documentation for this class was generated from the following files: