52#define UW_TDMA_STATUS_MY_SLOT 1
53#define UW_TDMA_STATUS_NOT_MY_SLOT 2
84 virtual void expire(Event *e);
134 virtual void start(
double delay);
180 virtual void initPkt(Packet *p);
185 inline unsigned long int
202 virtual int command(
int argc,
const char *
const *argv);
UwTDMATimer class is used to handle the scheduling period of UWTDMA slots.
UwTDMATimer(UwTDMA *m)
Costructor of the class UwTDMATimer.
virtual void expire(Event *e)
Method call when the timer expire.
Class that represents a TDMA Node.
std::string name_label_
label added in the log file, empty string by default
UwTDMA()
Constructor of the TDMA class.
virtual void recvFromUpperLayers(Packet *p)
Receive the packet from the upper layer (e.g.
virtual void initPkt(Packet *p)
Method called to add the MAC header size.
virtual void txData()
Transmit a data packet if in my slot.
int checkPriority
flag to set to 1 if UWCBR module uses packets with priority, set to 0 otherwise.
UWTDMA_STATUS transceiver_status
Variable holding the status enum type.
virtual void start(double delay)
Schedule the beginning of each TDMA cycle, each one after delay.
int tot_slots
Number of slots in the frame (fair_mode)
double guard_time
Guard time between slots.
int sea_trial_
Written log variable.
int max_packet_per_slot
max numer of packet it can transmit per slot
int drop_old_
flag to set the drop packet policy in case of buffer overflow: if 0 (default) drops the new packet,...
virtual void stateTxData()
Change transceiver status and and start to transmit if in my slot Used when there's spare time,...
virtual void Phy2MacStartRx(const Packet *p)
Method called when the Phy Layer start to receive a Packet.
virtual void rxPacketNotForMe(Packet *p)
Method called when the Packet received is determined to be not for me.
int debug_
Debug variable: 0 for no info, >-5 for small info, <-5 for complete info.
int max_queue_size
Maximum dimension of Queue.
int HDR_size
Size of the HDR if any.
int fair_mode
Fair modality on if 1: then only set tot_slots and common guard_time.
virtual int command(int argc, const char *const *argv)
TCL command interpreter.
UwTDMATimer tdma_timer
TDMA timer handler.
std::ofstream out_file_stats
File stream for the log file.
virtual ~UwTDMA()
Destructor of the TDMA class.
virtual int recvSyncClMsg(ClMessage *m)
Cross-Layer messages synchronous interpreter.
virtual void Mac2PhyStartTx(Packet *p)
Method called when the Mac Layer start to transmit a Packet.
virtual void Phy2MacEndTx(const Packet *p)
Method called when the Mac Layer finish to transmit a Packet.
virtual void stop()
Terminate a TDMA cycle, essentially cancel the TDMA timer.
unsigned long int getEpoch()
Calculate the epoch of the event.
virtual void Phy2MacEndRx(Packet *p)
Method called when the Phy Layer finish to receive a Packet.
int packet_sent_curr_slot_
counter of packet has been sent in the current slot
double frame_duration
Frame duration.
double start_time
Time to wait before starting the protocol.
int slot_status
Is it my turn to transmit data?
virtual void changeStatus()
Alternate TDMA status between MY_STATUS and NOT_MY_STATUS.
UWTDMA_STATUS
Enumeration class of UWTDMA status.
double slot_duration
Slot duration.
std::deque< Packet * > buffer
Buffer of the MAC node.
int slot_number
set the position of the node in the frame (fair_mode) (starting from 0 to tot_slots-1)