#include <uwpolling_SINK.h>
|
| enum | UWPOLLING_SINK_STATUS {
UWPOLLING_SINK_STATUS_IDLE = 1
, UWPOLLING_SINK_STATUS_RX_TRIGGER
, UWPOLLING_SINK_STATUS_TX_PROBE
, UWPOLLING_SINK_STATUS_WAIT_DATA
,
UWPOLLING_SINK_STATUS_RX_DATA
, UWPOLLING_SINK_STATUS_TX_ACK
} |
| |
| enum | UWPOLLING_PKT_TYPE {
UWPOLLING_DATA_PKT = 1
, UWPOLLING_POLL_PKT
, UWPOLLING_TRIGGER_PKT
, UWPOLLING_PROBE_PKT
,
UWPOLLING_ACK_PKT
} |
| |
| enum | UWPOLLING_SINK_REASON {
UWPOLLING_SINK_REASON_RX_DATA
, UWPOLLING_SINK_REASON_RX_TRIGGER
, UWPOLLING_SINK_REASON_PKT_ERROR
, UWPOLLING_SINK_REASON_TX_PROBE
,
UWPOLLING_SINK_REASON_TX_ACK
, UWPOLLING_SINK_REASON_BACKOFF_TIMER_EXPIRED
, UWPOLLING_SINK_REASON_RX_DATA_TIMER_EXPIRED
, UWPOLLING_SINK_REASON_NOT_SET
,
UWPOLLING_SINK_REASON_MAX_DATA_RECEIVED
, UWPOLLING_SINK_REASON_WRONG_TYPE
, UWPOLLING_SINK_REASON_WRONG_RECEIVER
, UWPOLLING_SINK_REASON_WRONG_STATE
} |
| |
| enum | UWPOLLING_TIMER_STATUS { UWPOLLING_IDLE = 1
, UWPOLLING_RUNNING
, UWPOLLING_FROZEN
, UWPOLLING_EXPIRED
} |
| |
Class used to represents the UWPOLLING MAC layer of a node.
Definition at line 75 of file uwpolling_SINK.h.
◆ UWPOLLING_PKT_TYPE
| Enumerator |
|---|
| UWPOLLING_DATA_PKT | |
| UWPOLLING_POLL_PKT | |
| UWPOLLING_TRIGGER_PKT | |
| UWPOLLING_PROBE_PKT | |
| UWPOLLING_ACK_PKT | |
Definition at line 118 of file uwpolling_SINK.h.
◆ UWPOLLING_SINK_REASON
| Enumerator |
|---|
| UWPOLLING_SINK_REASON_RX_DATA | |
| UWPOLLING_SINK_REASON_RX_TRIGGER | |
| UWPOLLING_SINK_REASON_PKT_ERROR | |
| UWPOLLING_SINK_REASON_TX_PROBE | |
| UWPOLLING_SINK_REASON_TX_ACK | |
| UWPOLLING_SINK_REASON_BACKOFF_TIMER_EXPIRED | |
| UWPOLLING_SINK_REASON_RX_DATA_TIMER_EXPIRED | |
| UWPOLLING_SINK_REASON_NOT_SET | |
| UWPOLLING_SINK_REASON_MAX_DATA_RECEIVED | |
| UWPOLLING_SINK_REASON_WRONG_TYPE | |
| UWPOLLING_SINK_REASON_WRONG_RECEIVER | |
| UWPOLLING_SINK_REASON_WRONG_STATE | |
Definition at line 127 of file uwpolling_SINK.h.
◆ UWPOLLING_SINK_STATUS
< Variable that rapresents the status of the protocol machine state
| Enumerator |
|---|
| UWPOLLING_SINK_STATUS_IDLE | |
| UWPOLLING_SINK_STATUS_RX_TRIGGER | |
| UWPOLLING_SINK_STATUS_TX_PROBE | |
| UWPOLLING_SINK_STATUS_WAIT_DATA | |
| UWPOLLING_SINK_STATUS_RX_DATA | |
| UWPOLLING_SINK_STATUS_TX_ACK | |
Definition at line 108 of file uwpolling_SINK.h.
◆ UWPOLLING_TIMER_STATUS
| Enumerator |
|---|
| UWPOLLING_IDLE | |
| UWPOLLING_RUNNING | |
| UWPOLLING_FROZEN | |
| UWPOLLING_EXPIRED | |
Definition at line 143 of file uwpolling_SINK.h.
◆ Uwpolling_SINK()
| Uwpolling_SINK::Uwpolling_SINK |
( |
| ) |
|
◆ ~Uwpolling_SINK()
| Uwpolling_SINK::~Uwpolling_SINK |
( |
| ) |
|
|
virtual |
◆ addMissPkt2List()
| void Uwpolling_SINK::addMissPkt2List |
( |
uint16_t |
n_pkts | ) |
|
|
protectedvirtual |
Add packet uids in the missing packet list.
- Parameters
-
| number | of missing packets to insert inthe list |
Definition at line 602 of file uwpolling_SINK.cpp.
◆ BackOffTimerExpired()
| void Uwpolling_SINK::BackOffTimerExpired |
( |
| ) |
|
|
protectedvirtual |
Method called by the Expire event of the timer.
Here we call the stateTxProbe method
Definition at line 338 of file uwpolling_SINK.cpp.
◆ command()
| int Uwpolling_SINK::command |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| |
|
virtual |
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 151 of file uwpolling_SINK.cpp.
◆ crLayCommand()
| int Uwpolling_SINK::crLayCommand |
( |
ClMessage * |
m | ) |
|
|
virtual |
Cross-Layer messages interpreter.
- Parameters
-
| ClMessage* | an instance of ClMessage that represent the message received |
- Returns
- 0 if successful.
Definition at line 185 of file uwpolling_SINK.cpp.
◆ getAckSent()
| int Uwpolling_SINK::getAckSent |
( |
| ) |
|
|
inlineprotected |
Returns the number of ACK packets sent during the simulation.
- Returns
- int n_ack_sent the number of ACK packets sent
Definition at line 510 of file uwpolling_SINK.h.
◆ getBackOffTime()
| double Uwpolling_SINK::getBackOffTime |
( |
| ) |
|
|
protectedvirtual |
The backoff timer is calculated choosing randomly using a Uniform random variable and multiplying it by a backoff_tuner chosen by the user via tcl.
Definition at line 327 of file uwpolling_SINK.cpp.
◆ getDuplicatedPkt()
| uint Uwpolling_SINK::getDuplicatedPkt |
( |
| ) |
|
|
inlineprotected |
◆ getEpoch()
| unsigned long int Uwpolling_SINK::getEpoch |
( |
| ) |
|
|
inlineprotected |
Calculate the epoch of the event.
Used in sea-trial mode
- Returns
- the epoch of the system
Definition at line 631 of file uwpolling_SINK.h.
◆ getProbeSent()
| int Uwpolling_SINK::getProbeSent |
( |
| ) |
|
|
inlineprotected |
Returns the number of PROBE packets sent during the simulation.
- Returns
- int n_probe_sent the number of PROBE packets sent
Definition at line 500 of file uwpolling_SINK.h.
◆ getTriggerDropped()
| int Uwpolling_SINK::getTriggerDropped |
( |
| ) |
|
|
inlineprotected |
Return the number of TRIGGER dropped by the node because of erroneous CRC.
- Returns
- int n_trigger_dropped number of TRIGGER dropped by the AUV
Definition at line 530 of file uwpolling_SINK.h.
◆ getTriggerReceived()
| int Uwpolling_SINK::getTriggerReceived |
( |
| ) |
|
|
inlineprotected |
Return the number of TRIGGER packets received by the NODE.
- Returns
- int n_trigger_received number of TRIGGER packets received
Definition at line 520 of file uwpolling_SINK.h.
◆ incrAckSent()
| virtual void Uwpolling_SINK::incrAckSent |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ incrDuplicatedPkt()
| void Uwpolling_SINK::incrDuplicatedPkt |
( |
| ) |
|
|
inlineprotected |
◆ incrProbeSent()
| virtual void Uwpolling_SINK::incrProbeSent |
( |
| ) |
|
|
inlineprotectedvirtual |
◆ incrTriggerDropped()
| void Uwpolling_SINK::incrTriggerDropped |
( |
| ) |
|
|
inlineprotected |
Increments the number of TRIGGER packets dropped because of erroneous CRC.
Definition at line 490 of file uwpolling_SINK.h.
◆ incrTriggerReceived()
| void Uwpolling_SINK::incrTriggerReceived |
( |
| ) |
|
|
inlineprotected |
Increments the number of TRIGGER packets received.
Definition at line 481 of file uwpolling_SINK.h.
◆ initInfo()
| void Uwpolling_SINK::initInfo |
( |
| ) |
|
|
protectedvirtual |
Initializes the protocol at the beginning of the simulation.
This method is called by a command in tcl.
- Parameters
-
- See also
- command method
Definition at line 639 of file uwpolling_SINK.cpp.
◆ initPkt()
Inits the packet with the MAC address of the receiver and the sender, the size of the packet and the type.
- Parameters
-
| UWPOLLING_PKT_TYPE | the type of the packet |
Definition at line 374 of file uwpolling_SINK.cpp.
◆ Mac2PhyStartTx()
| void Uwpolling_SINK::Mac2PhyStartTx |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Pass the packet to the PHY layer.
- Parameters
-
| Packet* | Pointer to an object of type Packet that rapresent the Packet to transmit |
Definition at line 444 of file uwpolling_SINK.cpp.
◆ Phy2MacEndRx()
| void Uwpolling_SINK::Phy2MacEndRx |
( |
Packet * |
p | ) |
|
|
protectedvirtual |
Method called when the Phy Layer finish to receive a Packet.
- Parameters
-
| const | Packet* Pointer to an object of type Packet that rapresent the packet received |
Definition at line 216 of file uwpolling_SINK.cpp.
◆ Phy2MacEndTx()
| void Uwpolling_SINK::Phy2MacEndTx |
( |
const Packet * |
p | ) |
|
|
protectedvirtual |
Method called when the PHY layer finish to transmit the packet.
- Parameters
-
| Packet* | Pointer to an object of type Packet that rapresent the Packet transmitted |
Definition at line 450 of file uwpolling_SINK.cpp.
◆ Phy2MacStartRx()
| virtual void Uwpolling_SINK::Phy2MacStartRx |
( |
const Packet * |
p | ) |
|
|
inlineprotectedvirtual |
Method called when the Phy Layer start to receive a Packet.
- Parameters
-
| const | Packet* Pointer to an object of type Packet that rapresent the Packet that is in reception |
Definition at line 413 of file uwpolling_SINK.h.
◆ refreshReason()
Refresh the reason for the changing of the state.
- Parameters
-
| UWPOLLING_SINK_REASON | The reason of the change of the state |
Definition at line 443 of file uwpolling_SINK.h.
◆ refreshState()
Refresh the state of the protocol.
- Parameters
-
| UWPOLLING_AUV_STATUS | current state of the protcol |
Definition at line 453 of file uwpolling_SINK.h.
◆ RxDataTimerExpired()
| void Uwpolling_SINK::RxDataTimerExpired |
( |
| ) |
|
|
protectedvirtual |
Methods called by the Expire event of the timer.
Here we disable the possibility of the node to receive DATA packets.
Definition at line 579 of file uwpolling_SINK.cpp.
◆ stateIdle()
| void Uwpolling_SINK::stateIdle |
( |
| ) |
|
|
protectedvirtual |
◆ stateRxData()
| void Uwpolling_SINK::stateRxData |
( |
| ) |
|
|
protectedvirtual |
◆ stateRxTrigger()
| void Uwpolling_SINK::stateRxTrigger |
( |
| ) |
|
|
protectedvirtual |
State of the protocol in which a TRIGGER packet is received.
Here we check the header of the TRIGGER and we store the information into it (i.e. the range of values into which choose randomly the backoff time
Definition at line 289 of file uwpolling_SINK.cpp.
◆ stateTxAck()
| void Uwpolling_SINK::stateTxAck |
( |
| ) |
|
|
protectedvirtual |
◆ stateTxProbe()
| void Uwpolling_SINK::stateTxProbe |
( |
| ) |
|
|
protectedvirtual |
State of the protocol in which a PROBE packet is sent.
Here we store into the PROBE header all the information needed, such as the timestamp of the most recent data packet, the number of the packets that the node wish to transmit
Definition at line 353 of file uwpolling_SINK.cpp.
◆ stateWaitData()
| void Uwpolling_SINK::stateWaitData |
( |
| ) |
|
|
protectedvirtual |
State in which the protocol set up the timer to wait the reception of the DATA packet.
Definition at line 463 of file uwpolling_SINK.cpp.
◆ txAck()
| void Uwpolling_SINK::txAck |
( |
| ) |
|
|
protectedvirtual |
◆ TxProbe()
| void Uwpolling_SINK::TxProbe |
( |
| ) |
|
|
protectedvirtual |
◆ waitForUser()
| void Uwpolling_SINK::waitForUser |
( |
| ) |
|
|
protectedvirtual |
Used for debug purposes.
(Permit to have a "step by step" behaviour of the protocol)
Definition at line 694 of file uwpolling_SINK.cpp.
◆ ack_enabled
| int Uwpolling_SINK::ack_enabled |
|
protected |
True if ack is enabled, false if disabled, default true.
Definition at line 721 of file uwpolling_SINK.h.
◆ AUV_mac_addr
| int Uwpolling_SINK::AUV_mac_addr |
|
protected |
MAC address of the AUV from which it receives data.
Definition at line 664 of file uwpolling_SINK.h.
◆ backoff_timer
◆ backoff_tuner
| double Uwpolling_SINK::backoff_tuner |
|
protected |
◆ BOffTime
| double Uwpolling_SINK::BOffTime |
|
protected |
◆ curr_ack_pkt
| Packet* Uwpolling_SINK::curr_ack_pkt |
|
protected |
◆ curr_data_pkt
| Packet* Uwpolling_SINK::curr_data_pkt |
|
protected |
◆ curr_probe_pkt
| Packet* Uwpolling_SINK::curr_probe_pkt |
|
protected |
◆ curr_state
◆ curr_trigger_pkt
| Packet* Uwpolling_SINK::curr_trigger_pkt |
|
protected |
◆ duplicate_pkts
| uint Uwpolling_SINK::duplicate_pkts |
|
protected |
◆ expected_id
| uint16_t Uwpolling_SINK::expected_id |
|
protected |
◆ expected_last_id
| uint16_t Uwpolling_SINK::expected_last_id |
|
protected |
◆ first_rx_pkt
| bool Uwpolling_SINK::first_rx_pkt |
|
protected |
◆ fout
| std::ofstream Uwpolling_SINK::fout |
|
protected |
◆ initialized
| bool Uwpolling_SINK::initialized = false |
|
staticprotected |
true if the protocol is initialized, false otherwise
Definition at line 648 of file uwpolling_SINK.h.
◆ last_reason
◆ last_rx
| uint16_t Uwpolling_SINK::last_rx |
|
protected |
◆ max_n_ack
| uint Uwpolling_SINK::max_n_ack |
|
protected |
Max number of ACK that can be sent in a single round.
The same value has to be used in packer, if needed.
Definition at line 722 of file uwpolling_SINK.h.
◆ max_payload
| int Uwpolling_SINK::max_payload |
|
protected |
◆ missing_id_list
| std::list<uint16_t> Uwpolling_SINK::missing_id_list |
|
protected |
◆ modem_data_bit_rate
| int Uwpolling_SINK::modem_data_bit_rate |
|
protected |
◆ n_ack_sent
| int Uwpolling_SINK::n_ack_sent |
|
protected |
◆ n_curr_rx_pkts
| uint Uwpolling_SINK::n_curr_rx_pkts |
|
protected |
Number of current received packets after the probe transmission.
Definition at line 673 of file uwpolling_SINK.h.
◆ n_probe_sent
| int Uwpolling_SINK::n_probe_sent |
|
protected |
◆ n_run
| int Uwpolling_SINK::n_run |
|
protected |
◆ n_trigger_dropped
| int Uwpolling_SINK::n_trigger_dropped |
|
protected |
◆ n_trigger_received
| int Uwpolling_SINK::n_trigger_received |
|
protected |
◆ out_file_stats
| std::ofstream Uwpolling_SINK::out_file_stats |
|
protected |
◆ pkt_type_info
◆ prev_expect_last_id
| uint16_t Uwpolling_SINK::prev_expect_last_id |
|
protected |
Expected Unique ID of the last packet in the round.
Definition at line 682 of file uwpolling_SINK.h.
◆ prev_state
◆ print_stats
| int Uwpolling_SINK::print_stats |
|
protected |
◆ PROBE_uid
| uint Uwpolling_SINK::PROBE_uid |
|
protected |
True if the packet received is the first packet in the round.
PROBE Unique ID
Definition at line 689 of file uwpolling_SINK.h.
◆ reason_info
◆ rx_data_timer
◆ RxDataEnabled
| bool Uwpolling_SINK::RxDataEnabled |
|
protected |
true if the node is enabled to receive the DATA, false otherwise
Definition at line 651 of file uwpolling_SINK.h.
◆ sea_trial
| int Uwpolling_SINK::sea_trial |
|
protected |
Sea Trial flag: To activate if the protocol is going to be tested at the sea.
Definition at line 714 of file uwpolling_SINK.h.
◆ send_ACK
| bool Uwpolling_SINK::send_ACK |
|
protected |
True if an ACK has to be sent, false otherwise.
Definition at line 677 of file uwpolling_SINK.h.
◆ sink_id
| uint Uwpolling_SINK::sink_id |
|
protected |
◆ status_info
◆ T_data
| double Uwpolling_SINK::T_data |
|
protected |
◆ T_data_gurad
| double Uwpolling_SINK::T_data_gurad |
|
protected |
◆ T_fin
| double Uwpolling_SINK::T_fin |
|
protected |
Upper bound of the range in which choose randomly the backoff time (sent by the AUV in the TRIGGER message)
Definition at line 660 of file uwpolling_SINK.h.
◆ T_guard
| double Uwpolling_SINK::T_guard |
|
protected |
Guard time added to the calculation of the data TO.
Definition at line 724 of file uwpolling_SINK.h.
◆ T_in
| double Uwpolling_SINK::T_in |
|
protected |
True if rx trigger is enabled.
Lower bound of the range in which choose randomly the backoff time (sent by the AUV in the TRIGGER message)
Definition at line 658 of file uwpolling_SINK.h.
◆ Triggered
| bool Uwpolling_SINK::Triggered |
|
protected |
true if the node has correctly received a TRIGGER, false otherwise
Definition at line 653 of file uwpolling_SINK.h.
◆ triggerEnabled
| bool Uwpolling_SINK::triggerEnabled |
|
protected |
◆ useAdaptiveTdata
| int Uwpolling_SINK::useAdaptiveTdata |
|
protected |
The documentation for this class was generated from the following files: