|
DESERT 4.0.0
|
#include <uwtdma.h>


Public Member Functions | |
| UwTDMA () | |
| virtual | ~UwTDMA () |
| virtual int | recvSyncClMsg (ClMessage *m) |
Protected Types | |
| enum | UWTDMA_STATUS { IDLE , TRANSMITTING , RECEIVING } |
Protected Member Functions | |
| virtual void | txData () |
| virtual void | stateTxData () |
| virtual void | changeStatus () |
| virtual void | start (double delay) |
| virtual void | stop () |
| virtual void | recvFromUpperLayers (Packet *p) |
| virtual void | Phy2MacEndRx (Packet *p) |
| virtual void | Phy2MacStartRx (const Packet *p) |
| virtual void | Mac2PhyStartTx (Packet *p) |
| virtual void | Phy2MacEndTx (const Packet *p) |
| virtual void | rxPacketNotForMe (Packet *p) |
| virtual void | initPkt (Packet *p) |
| unsigned long int | getEpoch () |
| virtual int | command (int argc, const char *const *argv) |
Protected Attributes | |
| UWTDMA_STATUS | transceiver_status |
| int | slot_status |
| int | debug_ |
| int | sea_trial_ |
| int | fair_mode |
| int | tot_slots |
| int | slot_number |
| int | HDR_size |
| double | frame_duration |
| double | guard_time |
| double | slot_duration |
| double | start_time |
| UwTDMATimer | tdma_timer |
| std::deque< Packet * > | buffer |
| std::ofstream | out_file_stats |
| bool | enable |
| int | max_queue_size |
| int | max_packet_per_slot |
| int | packet_sent_curr_slot_ |
| int | drop_old_ |
| std::string | name_label_ |
| int | checkPriority |
Friends | |
| class | UwTDMATimer |
Class that represents a TDMA Node
|
protected |
| UwTDMA::UwTDMA | ( | ) |
Constructor of the TDMA class
References checkPriority, debug_, drop_old_, fair_mode, frame_duration, guard_time, HDR_size, max_packet_per_slot, max_queue_size, sea_trial_, and tot_slots.
|
virtual |
Destructor of the TDMA class
|
protectedvirtual |
Alternate TDMA status between MY_STATUS and NOT_MY_STATUS
Reimplemented in UwTDMA_frame.
References debug_, frame_duration, getEpoch(), guard_time, out_file_stats, packet_sent_curr_slot_, sea_trial_, slot_duration, slot_status, stateTxData(), and tdma_timer.
Referenced by UwTDMA_frame::changeStatus().

|
protectedvirtual |
TCL command interpreter. It implements the following OTcl methods:
| 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). |
Reimplemented in UwTDMA_frame, and UwRangingTDMA.
References buffer, debug_, fair_mode, frame_duration, guard_time, name_label_, slot_duration, slot_number, start(), start_time, stop(), and tot_slots.
Referenced by UwTDMA_frame::command(), UwRangingTDMA::command(), and recvSyncClMsg().

|
inlineprotected |
Calculate the epoch of the event. Used in sea-trial mode
Referenced by UwTDMA_frame::changeStatus(), changeStatus(), Mac2PhyStartTx(), Phy2MacEndRx(), Phy2MacEndTx(), start(), stop(), and txData().
|
protectedvirtual |
Method called to add the MAC header size
| const | Packet* Pointer to an Packet object that rapresent the Packet in transmission |
References HDR_size.
Referenced by recvFromUpperLayers().
|
protectedvirtual |
Method called when the Mac Layer start to transmit a Packet
| const | Packet* Pointer to an Packet object that rapresent the Packet in transmission |
Reimplemented in UwRangingTDMA.
References debug_, getEpoch(), IDLE, max_packet_per_slot, out_file_stats, packet_sent_curr_slot_, sea_trial_, transceiver_status, and TRANSMITTING.
Referenced by txData().

|
protectedvirtual |
Method called when the Phy Layer finish to receive a Packet
| const | Packet* Pointer to an Packet object that rapresent the Packet in reception |
Reimplemented in UwRangingTDMA.
References debug_, getEpoch(), IDLE, out_file_stats, rxPacketNotForMe(), sea_trial_, slot_status, transceiver_status, TRANSMITTING, and txData().
Referenced by UwRangingTDMA::Phy2MacEndRx().

|
protectedvirtual |
Method called when the Mac Layer finish to transmit a Packet
| const | Packet* Pointer to an Packet object that rapresent the Packet in transmission |
References getEpoch(), IDLE, out_file_stats, packet_sent_curr_slot_, sea_trial_, transceiver_status, and txData().

|
protectedvirtual |
Method called when the Phy Layer start to receive a Packet
| const | Packet* Pointer to an Packet object that rapresent the Packet in reception |
Reimplemented in UwRangingTDMA.
References IDLE, RECEIVING, sea_trial_, and transceiver_status.
|
protectedvirtual |
Receive the packet from the upper layer (e.g. IP)
| Packet* | pointer to the packet received |
References buffer, checkPriority, debug_, drop_old_, initPkt(), max_queue_size, hdr_uwcbr::priority(), and txData().

|
virtual |
Cross-Layer messages synchronous interpreter.
| ClMessage* | an instance of ClMessage that represent the message received |
References CLMSG_UWMMAC_ENABLE, command(), ClMsgUwMmac::SET_REPLY, ClMsgUwMmac::SET_REQ, start(), start_time, and stop().

|
protectedvirtual |
Method called when the Packet received is determined to be not for me
| const | Packet* Pointer to an Packet object that rapresent the Packet in reception |
Referenced by Phy2MacEndRx().
|
protectedvirtual |
Schedule the beginning of each TDMA cycle, each one after delay
| delay | to await before starting the TDMA |
References debug_, enable, getEpoch(), name_label_, out_file_stats, sea_trial_, slot_status, and tdma_timer.
Referenced by UwTDMA_frame::command(), command(), and recvSyncClMsg().

|
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.
References txData().
Referenced by changeStatus().

|
protectedvirtual |
Terminate a TDMA cycle, essentially cancel the TDMA timer
References enable, getEpoch(), out_file_stats, sea_trial_, and tdma_timer.
Referenced by UwTDMA_frame::command(), command(), and recvSyncClMsg().

|
protectedvirtual |
Transmit a data packet if in my slot
References buffer, debug_, getEpoch(), IDLE, Mac2PhyStartTx(), max_packet_per_slot, out_file_stats, packet_sent_curr_slot_, sea_trial_, slot_status, and transceiver_status.
Referenced by Phy2MacEndRx(), Phy2MacEndTx(), recvFromUpperLayers(), and stateTxData().

|
friend |
|
protected |
Buffer of the MAC node
Referenced by command(), recvFromUpperLayers(), and txData().
|
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
Referenced by recvFromUpperLayers(), and UwTDMA().
|
protected |
Debug variable: 0 for no info, >-5 for small info, <-5 for complete info
Referenced by UwTDMA_frame::changeStatus(), changeStatus(), command(), UwTDMA_frame::getCurrentSlot(), UwTDMA_frame::getNextMySlot(), UwTDMA_frame::initializeTopologyS(), Mac2PhyStartTx(), Phy2MacEndRx(), recvFromUpperLayers(), start(), txData(), and UwTDMA().
|
protected |
flag to set the drop packet policy in case of buffer overflow: if 0 (default) drops the new packet, if 1 the oldest
Referenced by recvFromUpperLayers(), and UwTDMA().
|
protected |
Fair modality on if 1: then only set tot_slots and common guard_time
Referenced by UwTDMA_frame::command(), command(), UwTDMA(), and UwTDMA_frame::UwTDMA_frame().
|
protected |
Frame duration
Referenced by changeStatus(), UwTDMA_frame::command(), command(), and UwTDMA().
|
protected |
Guard time between slots
Referenced by UwTDMA_frame::changeStatus(), changeStatus(), UwTDMA_frame::command(), command(), UwTDMA(), and UwTDMA_frame::UwTDMA_frame().
|
protected |
max numer of packet it can transmit per slot
Referenced by Mac2PhyStartTx(), txData(), and UwTDMA().
|
protected |
Maximum dimension of Queue
Referenced by recvFromUpperLayers(), and UwTDMA().
|
protected |
|
protected |
File stream for the log file
Referenced by UwTDMA_frame::changeStatus(), changeStatus(), Mac2PhyStartTx(), Phy2MacEndRx(), Phy2MacEndTx(), start(), stop(), and txData().
|
protected |
counter of packet has been sent in the current slot
Referenced by changeStatus(), Mac2PhyStartTx(), Phy2MacEndTx(), and txData().
|
protected |
Written log variable
Referenced by UwTDMA_frame::changeStatus(), changeStatus(), Mac2PhyStartTx(), UwRangingTDMA::Mac2PhyStartTx(), Phy2MacEndRx(), Phy2MacEndTx(), Phy2MacStartRx(), start(), stop(), txData(), and UwTDMA().
|
protected |
Slot duration
Referenced by UwTDMA_frame::changeStatus(), changeStatus(), UwTDMA_frame::command(), command(), and UwRangingTDMA::Phy2MacEndRx().
|
protected |
set the position of the node in the frame (fair_mode) (starting from 0 to tot_slots-1)
Referenced by command(), UwTDMA_frame::initializeTopologyS(), and UwRangingTDMA::UwRangingTDMA().
|
protected |
Is it my turn to transmit data?
Referenced by UwTDMA_frame::changeStatus(), changeStatus(), Phy2MacEndRx(), start(), and txData().
|
protected |
Time to wait before starting the protocol
Referenced by UwTDMA_frame::command(), command(), and recvSyncClMsg().
|
protected |
TDMA timer handler
Referenced by UwTDMA_frame::changeStatus(), changeStatus(), start(), and stop().
|
protected |
Number of slots in the frame (fair_mode)
Referenced by UwTDMA_frame::changeStatus(), UwTDMA_frame::command(), command(), UwTDMA_frame::initializeTopologyS(), UwRangingTDMA::UwRangingTDMA(), UwTDMA(), and UwTDMA_frame::UwTDMA_frame().
|
protected |
Variable holding the status enum type
Referenced by Mac2PhyStartTx(), UwRangingTDMA::Mac2PhyStartTx(), Phy2MacEndRx(), UwRangingTDMA::Phy2MacEndRx(), Phy2MacEndTx(), Phy2MacStartRx(), UwRangingTDMA::Phy2MacStartRx(), and txData().