[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154 DispatchSlottedCsmaP.nc, 1.4, 1.5 DispatchUnslottedCsmaP.nc, 1.6, 1.7 TKN154BeaconEnabledP.nc, 1.4, 1.5 TKN154NonBeaconEnabledP.nc, 1.5, 1.6
Jan-Hinrich Hauer
janhauer at users.sourceforge.net
Mon May 4 02:40:39 PDT 2009
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9684/tos/lib/mac/tkn154
Modified Files:
DispatchSlottedCsmaP.nc DispatchUnslottedCsmaP.nc
TKN154BeaconEnabledP.nc TKN154NonBeaconEnabledP.nc
Log Message:
Now supporting PIB attribute "macRxOnWhenIdle"
Index: DispatchSlottedCsmaP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/DispatchSlottedCsmaP.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** DispatchSlottedCsmaP.nc 28 Apr 2009 14:12:03 -0000 1.4
--- DispatchSlottedCsmaP.nc 4 May 2009 09:40:36 -0000 1.5
***************
*** 81,84 ****
--- 81,85 ----
interface Notify<bool> as RxEnableStateChange;
interface GetNow<bool> as IsTrackingBeacons;
+ interface Notify<const void*> as PIBUpdateMacRxOnWhenIdle;
interface FrameUtility;
interface SlottedCsmaCa;
***************
*** 122,125 ****
--- 123,127 ----
norace ieee154_txframe_t *m_lastFrame;
norace uint16_t m_remainingBackoff;
+ ieee154_macRxOnWhenIdle_t macRxOnWhenIdle;
/* variables for the slotted CSMA-CA */
***************
*** 407,411 ****
call TimeCalc.hasExpired(call SuperframeStructure.sfStartTime(),
call SuperframeStructure.battLifeExtDuration()) &&
! !call IsRxEnableActive.getNow()) {
dbg_push_state(5);
next = trySwitchOff();
--- 409,413 ----
call TimeCalc.hasExpired(call SuperframeStructure.sfStartTime(),
call SuperframeStructure.battLifeExtDuration()) &&
! !call IsRxEnableActive.getNow() && !macRxOnWhenIdle) {
dbg_push_state(5);
next = trySwitchOff();
***************
*** 419,429 ****
// Check 7: should we be in receive mode?
! else if (COORD_ROLE || call IsRxEnableActive.getNow()) {
dbg_push_state(7);
next = tryReceive(NO_ALARM);
if (next == DO_NOTHING) {
! // this means there is an active MLME_RX_ENABLE.request
! // and the radio was just switched to Rx mode - signal
! // a notify event to inform the respective component
post wasRxEnabledTask();
}
--- 421,430 ----
// Check 7: should we be in receive mode?
! else if (COORD_ROLE || call IsRxEnableActive.getNow() || macRxOnWhenIdle) {
dbg_push_state(7);
next = tryReceive(NO_ALARM);
if (next == DO_NOTHING) {
! // if there was an active MLME_RX_ENABLE.request then we'll
! // inform the next higher layer that radio is now in Rx mode
post wasRxEnabledTask();
}
***************
*** 525,528 ****
--- 526,533 ----
event void RxEnableStateChange.notify(bool whatever) { updateState();}
async event void BroadcastAlarm.fired() { m_broadcastRxPending = FALSE; updateState();}
+ event void PIBUpdateMacRxOnWhenIdle.notify( const void* val ) {
+ atomic macRxOnWhenIdle = *((ieee154_macRxOnWhenIdle_t*) val);
+ updateState();
+ }
async event void IndirectTxWaitAlarm.fired()
Index: DispatchUnslottedCsmaP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/DispatchUnslottedCsmaP.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** DispatchUnslottedCsmaP.nc 28 Apr 2009 14:12:04 -0000 1.6
--- DispatchUnslottedCsmaP.nc 4 May 2009 09:40:36 -0000 1.7
***************
*** 68,71 ****
--- 68,72 ----
interface Get<ieee154_txframe_t*> as GetIndirectTxFrame;
interface Notify<bool> as RxEnableStateChange;
+ interface Notify<const void*> as PIBUpdateMacRxOnWhenIdle;
interface FrameUtility;
interface UnslottedCsmaCa;
***************
*** 97,100 ****
--- 98,102 ----
norace ieee154_txframe_t *m_currentFrame;
norace ieee154_txframe_t *m_lastFrame;
+ norace ieee154_macRxOnWhenIdle_t macRxOnWhenIdle;
/* variables for the unslotted CSMA-CA */
***************
*** 276,285 ****
// Check 4: should we be in receive mode?
! else if (call IsRxEnableActive.getNow()) {
next = tryReceive(FALSE);
if (next == DO_NOTHING) {
! // this means there is an active MLME_RX_ENABLE.request
! // and the radio was just switched to Rx mode - signal
! // a notify event to inform the next higher layer
post wasRxEnabledTask();
}
--- 278,286 ----
// Check 4: should we be in receive mode?
! else if (call IsRxEnableActive.getNow() || macRxOnWhenIdle) {
next = tryReceive(FALSE);
if (next == DO_NOTHING) {
! // if there was an active MLME_RX_ENABLE.request then we'll
! // inform the next higher layer that radio is now in Rx mode
post wasRxEnabledTask();
}
***************
*** 363,366 ****
--- 364,371 ----
updateState();
}
+ event void PIBUpdateMacRxOnWhenIdle.notify( const void* val ) {
+ atomic macRxOnWhenIdle = *((ieee154_macRxOnWhenIdle_t*) val);
+ signal RxEnableStateChange.notify(TRUE);
+ }
event void IndirectTxWaitTimer.fired()
Index: TKN154BeaconEnabledP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/TKN154BeaconEnabledP.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TKN154BeaconEnabledP.nc 28 Apr 2009 14:12:04 -0000 1.4
--- TKN154BeaconEnabledP.nc 4 May 2009 09:40:36 -0000 1.5
***************
*** 414,417 ****
--- 414,418 ----
DeviceCap.RxEnableStateChange -> RxEnableP.RxEnableStateChange;
DeviceCap.IsTrackingBeacons -> BeaconSynchronizeP.IsTrackingBeacons;
+ DeviceCap.PIBUpdateMacRxOnWhenIdle -> PibP.PIBUpdate[IEEE154_macRxOnWhenIdle];
DeviceCap.FrameUtility -> PibP;
DeviceCap.SlottedCsmaCa -> DeviceCapRadioClient;
***************
*** 440,443 ****
--- 441,445 ----
CoordCap.RxEnableStateChange -> RxEnableP.RxEnableStateChange;
CoordCap.IsTrackingBeacons -> BeaconSynchronizeP.IsTrackingBeacons;
+ CoordCap.PIBUpdateMacRxOnWhenIdle -> PibP.PIBUpdate[IEEE154_macRxOnWhenIdle];
CoordCap.FrameUtility -> PibP;
CoordCap.SlottedCsmaCa -> CoordCapRadioClient;
Index: TKN154NonBeaconEnabledP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/TKN154NonBeaconEnabledP.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TKN154NonBeaconEnabledP.nc 28 Apr 2009 14:12:04 -0000 1.5
--- TKN154NonBeaconEnabledP.nc 4 May 2009 09:40:36 -0000 1.6
***************
*** 294,297 ****
--- 294,298 ----
DispatchP.GetIndirectTxFrame -> IndirectTxP;
DispatchP.RxEnableStateChange -> RxEnableP.RxEnableStateChange;
+ DispatchP.PIBUpdateMacRxOnWhenIdle -> PibP.PIBUpdate[IEEE154_macRxOnWhenIdle];
DispatchP.FrameUtility -> PibP;
DispatchP.UnslottedCsmaCa -> DispatchRadioClient;
More information about the Tinyos-2-commits
mailing list