Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed packets not being sent up by CSMA ALOHA on listen state #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions DESERT_Framework/DESERT/data_link/uw-csma-aloha/uw-csma-aloha.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,18 @@ CsmaAloha::stateRxData(Packet *data_pkt)
stateCheckListenExpired();
} break;

case CSMA_STATE_LISTEN: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be the case. The case you are mentioning, should be handled by the state "RX_LISTEN". In fact, during Phy2MacStartRx, if state is LISTEN, state is moved to RX_LISTEN, which is then handled in stateRxData method. Could you please verify this?

hdr_cmn *ch = hdr_cmn::access(data_pkt);
ch->size() = ch->size() - HDR_size;
incrDataPktsRx();
sendUp(data_pkt);

if (ack_mode == CSMA_ACK_MODE)
stateTxAck(dst_addr);
else
stateCheckListenExpired();
} break;

case CSMA_STATE_RX_BACKOFF: {
hdr_cmn *ch = hdr_cmn::access(data_pkt);
ch->size() = ch->size() - HDR_size;
Expand Down