From d2cbd062f73a4d21fa53f4a216a99805e5b0d457 Mon Sep 17 00:00:00 2001 From: janhauer Date: Fri, 22 May 2009 08:56:32 +0000 Subject: [PATCH] incoming beacon payload size was caculated wrongly. fixed. --- tos/lib/mac/tkn154/PibP.nc | 2 +- tos/lib/mac/tkn154/ScanP.nc | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tos/lib/mac/tkn154/PibP.nc b/tos/lib/mac/tkn154/PibP.nc index cb6dc92f..2f55e72a 100644 --- a/tos/lib/mac/tkn154/PibP.nc +++ b/tos/lib/mac/tkn154/PibP.nc @@ -939,7 +939,7 @@ implementation uint8_t *mhr = MHR(frame); uint8_t len = ((ieee154_header_t*) frame->header)->length & FRAMECTL_LENGTH_MASK; if ((mhr[MHR_INDEX_FC1] & FC1_FRAMETYPE_MASK) == FC1_FRAMETYPE_BEACON) { - uint8_t *payload = call Frame.getPayload(frame); + uint8_t *payload = call BeaconFrame.getBeaconPayload(frame); len = len - (payload - (uint8_t *) frame->data); } return len; diff --git a/tos/lib/mac/tkn154/ScanP.nc b/tos/lib/mac/tkn154/ScanP.nc index 72a04b6c..4fb18aca 100644 --- a/tos/lib/mac/tkn154/ScanP.nc +++ b/tos/lib/mac/tkn154/ScanP.nc @@ -359,10 +359,9 @@ implementation // 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 ... + // to the next higher layer (regardless of the value of macAutoRequest); + // when macAutoRequest is set to TRUE, then the beacon is always + // stored in the PAN Descriptor list (see 7.1.11.2.1 - Table 68) if (!call MLME_GET.macAutoRequest()) return signal MLME_BEACON_NOTIFY.indication (frame); -- 2.39.2