[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154 ScanP.nc, 1.8, 1.9
Jan-Hinrich Hauer
janhauer at users.sourceforge.net
Thu Apr 30 06:23:50 PDT 2009
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13878/tos/lib/mac/tkn154
Modified Files:
ScanP.nc
Log Message:
Energy scan returned wrong status code if EnergyDetectList array size was equal to number of scanned channels (as pointed out by D. Santos). This is now fixed.
Index: ScanP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/ScanP.nc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ScanP.nc 27 Apr 2009 09:42:08 -0000 1.8
--- ScanP.nc 30 Apr 2009 13:23:48 -0000 1.9
***************
*** 273,284 ****
if (m_terminateScan){
! // scan operation terminated prematurely because the max.
! // number of PAN descriptors/ED samples was reached
! result = IEEE154_LIMIT_REACHED;
!
! // mark the channel on which we received the last beacon
! // as unscanned, because it was not completely scanned
if (m_scanType == PASSIVE_SCAN || m_scanType == ACTIVE_SCAN)
! currentChannelBit >>= 1;
while (!(currentChannelBit & INVALID_CHANNEL_BITMASK) &&
(m_scanChannels & currentChannelBit)){
--- 273,283 ----
if (m_terminateScan){
! // Scan operation terminated because the max.
! // number of PAN descriptors/ED samples was reached.
! // Check if there are channels that were unscanned.
! // In active/passive scan we consider a channel
! // unscanned if it was not completely scanned.
if (m_scanType == PASSIVE_SCAN || m_scanType == ACTIVE_SCAN)
! currentChannelBit >>= 1; // last (partially) scanned channel
while (!(currentChannelBit & INVALID_CHANNEL_BITMASK) &&
(m_scanChannels & currentChannelBit)){
***************
*** 286,291 ****
--- 285,293 ----
currentChannelBit <<= 1;
}
+ if (unscannedChannels) // some channels were not (completely) scanned
+ result = IEEE154_LIMIT_REACHED;
} else if (m_scanType != ENERGY_DETECTION_SCAN && !m_resultIndex)
result = IEEE154_NO_BEACON;
+
if (m_scanType == PASSIVE_SCAN || m_scanType == ACTIVE_SCAN)
call MLME_SET.macPANId(m_PANID);
More information about the Tinyos-2-commits
mailing list