X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tos%2Flib%2Fmac%2Ftkn154%2FScanP.nc;h=72a04b6c9668065cc581a64f03215046322fc19d;hb=2f6d319a8bdf441aae82f42f71183dde482e2d5f;hp=37ac03b661bfd485c25c48ee5c125a90b3960de4;hpb=8bdf12e8f4255c53d8121586c39099e9f62a4ad8;p=tinyos-2.x.git diff --git a/tos/lib/mac/tkn154/ScanP.nc b/tos/lib/mac/tkn154/ScanP.nc index 37ac03b6..72a04b6c 100644 --- a/tos/lib/mac/tkn154/ScanP.nc +++ b/tos/lib/mac/tkn154/ScanP.nc @@ -345,6 +345,7 @@ implementation { if (!m_busy) return frame; + if (m_scanType == ORPHAN_SCAN) { if (!m_resultIndex) if ((MHR(frame)[0] & FC1_FRAMETYPE_MASK) == FC1_FRAMETYPE_CMD && @@ -355,7 +356,14 @@ implementation call RadioOff.off(); } } else if ((((ieee154_header_t*) frame->header)->mhr[0] & FC1_FRAMETYPE_MASK) == FC1_FRAMETYPE_BEACON) { - // PASSIVE_SCAN / ACTIVE_SCAN + + // PASSIVE_SCAN / ACTIVE_SCAN: + // A beacon frame containing a non-empty payload is always signalled + // to the next higher layer (regardless of the value of macAutoRequest), + // but it is unclear whether it should in addition be added to the + // PAN Descriptor list when macAutoRequest is set to TRUE. This is, + // anyway, what the implementation currently does ... + if (!call MLME_GET.macAutoRequest()) return signal MLME_BEACON_NOTIFY.indication (frame); else if (m_resultIndex >= m_resultListNumEntries) { @@ -367,25 +375,28 @@ implementation IEEE154_SUPPORTED_CHANNELPAGE, &((ieee154_PANDescriptor_t*) m_resultList)[m_resultIndex]) == SUCCESS) { - // check uniqueness: both PAN ID and source address must not be in a previously received beacon + // check uniqueness: PAN ID and source address must + // not be found in a previously received beacon uint8_t i; ieee154_PANDescriptor_t* descriptor = (ieee154_PANDescriptor_t*) m_resultList; dbg_serial("ScanP", "Received beacon, source: 0x%lx, channel: %lu.\n", (uint32_t) descriptor[m_resultIndex].CoordAddress.shortAddress, (uint32_t) m_currentChannelNum); - if (m_resultIndex) - for (i=0; i 0) + return signal MLME_BEACON_NOTIFY.indication (frame); } // PASSIVE_SCAN / ACTIVE_SCAN return frame; }