[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154/dummies NoBeaconSynchronizeP.nc, NONE, 1.1 NoBeaconTransmitP.nc, NONE, 1.1 NoCapP.nc, NONE, 1.1 NoCapQueueP.nc, NONE, 1.1 NoCoordCfpP.nc, NONE, 1.1 NoDebugP.nc, NONE, 1.1 NoDeviceCapQueueP.nc, NONE, 1.1 NoDeviceCfpP.nc, NONE, 1.1 NoScanP.nc, NONE, 1.1
Jan-Hinrich Hauer
janhauer at users.sourceforge.net
Mon Jun 16 11:00:33 PDT 2008
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154/interfaces/MCPS MCPS_DATA.nc, NONE, 1.1 MCPS_PURGE.nc, NONE, 1.1
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154/interfaces/MLME MLME_ASSOCIATE.nc, NONE, 1.1 MLME_BEACON_NOTIFY.nc, NONE, 1.1 MLME_COMM_STATUS.nc, NONE, 1.1 MLME_DISASSOCIATE.nc, NONE, 1.1 MLME_GET.nc, NONE, 1.1 MLME_GTS.nc, NONE, 1.1 MLME_ORPHAN.nc, NONE, 1.1 MLME_POLL.nc, NONE, 1.1 MLME_RESET.nc, NONE, 1.1 MLME_RX_ENABLE.nc, NONE, 1.1 MLME_SCAN.nc, NONE, 1.1 MLME_SET.nc, NONE, 1.1 MLME_START.nc, NONE, 1.1 MLME_SYNC_LOSS.nc, NONE, 1.1 MLME_SYNC.nc, NONE, 1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/mac/tkn154/dummies
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30549/tos/lib/mac/tkn154/dummies
Added Files:
NoBeaconSynchronizeP.nc NoBeaconTransmitP.nc NoCapP.nc
NoCapQueueP.nc NoCoordCfpP.nc NoDebugP.nc NoDeviceCapQueueP.nc
NoDeviceCfpP.nc NoScanP.nc
Log Message:
Initial version of TKN15.4, a platform-independent IEEE 802.15.4-2006 MAC implementation (see tinyos-2.x/tos/lib/mac/tkn154/README.txt)
--- NEW FILE: NoBeaconSynchronizeP.nc ---
/*
* Copyright (c) 2008, Technische Universitaet Berlin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the Technische Universitaet Berlin nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* - Revision -------------------------------------------------------------
* $Revision: 1.1 $
* $Date: 2008/06/16 18:00:30 $
* @author Jan Hauer <hauer at tkn.tu-berlin.de>
* ========================================================================
*/
#include "TKN154_MAC.h"
module NoBeaconSynchronizeP
{
provides
{
interface Init;
interface MLME_SYNC;
interface MLME_BEACON_NOTIFY;
interface MLME_SYNC_LOSS;
interface Get<bool> as IsTrackingBeacons;
interface Get<uint32_t> as GetLastBeaconRxTime;
interface GetNow<uint32_t> as CapStart;
interface GetNow<ieee154_reftime_t*> as CapStartRefTime;
interface GetNow<uint32_t> as CapLen;
interface GetNow<uint32_t> as CapEnd;
interface GetNow<uint32_t> as CfpEnd;
interface GetNow<uint32_t> as CfpLen;
interface GetNow<uint32_t> as BeaconInterval;
interface GetNow<bool> as IsBLEActive;
interface GetNow<uint16_t> as BLELen;
interface GetNow<uint8_t*> as GtsField;
interface GetNow<uint32_t> as SfSlotDuration;
interface GetNow<uint8_t> as FinalCapSlot;
interface GetNow<uint8_t> as NumGtsSlots;
interface GetNow<bool> as IsRxBroadcastPending;
}
uses
{
interface MLME_GET;
interface MLME_SET;
interface FrameUtility;
interface IEEE154BeaconFrame as BeaconFrame;
interface Alarm<TSymbolIEEE802154,uint32_t> as TrackAlarm;
interface RadioRx as BeaconRx;
interface RadioOff;
interface Get<bool> as IsBeaconEnabledPAN;
interface DataRequest;
interface FrameRx as CoordRealignmentRx;
interface Resource as Token;
interface ResourceTransfer as TokenToCap;
interface ResourceTransferred as TokenTransferred;
interface GetNow<bool> as IsSendingBeacons;
interface TimeCalc;
interface IEEE154Frame as Frame;
interface Leds;
interface Ieee802154Debug as Debug;
}
}
implementation
{
command error_t Init.init() { return SUCCESS; }
command ieee154_status_t MLME_SYNC.request (
uint8_t logicalChannel,
uint8_t channelPage,
bool trackBeacon
)
{
return IEEE154_TRANSACTION_OVERFLOW;
}
event void Token.granted() { }
async event void TokenTransferred.transferred() { call Token.release(); }
async event void TrackAlarm.fired() {}
async event void BeaconRx.prepareDone() {}
event message_t* BeaconRx.received(message_t* frame, ieee154_reftime_t *timestamp) { return frame;}
async event void RadioOff.offDone() {}
command bool IsTrackingBeacons.get(){ return FALSE;}
command uint32_t GetLastBeaconRxTime.get(){ return 0;}
async command uint8_t* GtsField.getNow() { return 0; }
async command uint32_t SfSlotDuration.getNow() { return 0; }
async command uint8_t FinalCapSlot.getNow() { return 0; }
event void DataRequest.pollDone(){}
async command uint32_t CapEnd.getNow() { return 0; }
async command uint32_t CapStart.getNow() { return 0; }
async command uint32_t CapLen.getNow() { return 0; }
async command uint32_t CfpEnd.getNow() { return 0; }
async command ieee154_reftime_t* CapStartRefTime.getNow() { return NULL; }
async command uint32_t CfpLen.getNow(){ return 0;}
async command uint32_t BeaconInterval.getNow(){ return 0;}
async command bool IsBLEActive.getNow(){ return 0;}
async command uint16_t BLELen.getNow(){ return 0;}
async command uint8_t NumGtsSlots.getNow() { return 0; }
async command bool IsRxBroadcastPending.getNow() { return FALSE; }
event message_t* CoordRealignmentRx.received(message_t* frame) {return frame;}
}
--- NEW FILE: NoBeaconTransmitP.nc ---
/*
* Copyright (c) 2008, Technische Universitaet Berlin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the Technische Universitaet Berlin nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* - Revision -------------------------------------------------------------
* $Revision: 1.1 $
* $Date: 2008/06/16 18:00:30 $
* @author Jan Hauer <hauer at tkn.tu-berlin.de>
* ========================================================================
*/
#include "TKN154_MAC.h"
#include "TKN154_PHY.h"
module NoBeaconTransmitP
{
provides
{
interface Init;
interface MLME_START;
interface WriteBeaconField as SuperframeSpecWrite;
interface Get<bool> as IsSendingBeacons;
interface GetNow<uint32_t> as CapStart;
interface GetNow<ieee154_reftime_t*> as CapStartRefTime;
interface GetNow<uint32_t> as CapLen;
interface GetNow<uint32_t> as CapEnd;
interface GetNow<uint32_t> as CfpEnd;
interface GetNow<uint32_t> as CfpLen;
interface GetNow<bool> as IsBLEActive;
interface GetNow<uint16_t> as BLELen;
interface GetNow<uint8_t*> as GtsField;
interface GetNow<uint32_t> as SfSlotDuration;
interface GetNow<uint32_t> as BeaconInterval;
interface GetNow<uint8_t> as FinalCapSlot;
interface GetNow<uint8_t> as NumGtsSlots;
interface GetNow<bool> as BeaconFramePendingBit;
interface IEEE154TxBeaconPayload;
} uses {
interface Notify<bool> as GtsSpecUpdated;
interface Notify<bool> as PendingAddrSpecUpdated;
interface Notify<const void*> as PIBUpdate[uint8_t attributeID];
interface Alarm<TSymbolIEEE802154,uint32_t> as BeaconTxAlarm;
interface Timer<TSymbolIEEE802154> as BeaconPayloadUpdateTimer;
interface RadioOff;
interface Get<bool> as IsBeaconEnabledPAN;
interface RadioTx as BeaconTx;
interface MLME_GET;
interface MLME_SET;
interface Resource as Token;
interface ResourceTransfer as TokenToBroadcast;
interface FrameTx as RealignmentBeaconEnabledTx;
interface FrameTx as RealignmentNonBeaconEnabledTx;
interface FrameRx as BeaconRequestRx;
interface WriteBeaconField as GtsInfoWrite;
interface WriteBeaconField as PendingAddrWrite;
interface FrameUtility;
interface Get<bool> as IsTrackingBeacons;
interface GetNow<uint32_t> as LastBeaconRxTime;
interface GetNow<ieee154_reftime_t*> as LastBeaconRxRefTime;
interface Ieee802154Debug as Debug;
interface Set<ieee154_macSuperframeOrder_t> as SetMacSuperframeOrder;
interface Set<ieee154_macBeaconTxTime_t> as SetMacBeaconTxTime;
interface Set<ieee154_macPanCoordinator_t> as SetMacPanCoordinator;
interface GetSet<ieee154_txframe_t*> as GetSetRealignmentFrame;
interface GetNow<bool> as IsBroadcastReady;
interface TimeCalc;
interface Leds;
}
}
implementation
{
command error_t Init.init()
{
return SUCCESS;
}
command ieee154_status_t MLME_START.request (
uint16_t panID,
uint8_t logicalChannel,
uint8_t channelPage,
uint32_t startTime,
uint8_t beaconOrder,
uint8_t superframeOrder,
bool panCoordinator,
bool batteryLifeExtension,
bool coordRealignment,
ieee154_security_t *coordRealignSecurity,
ieee154_security_t *beaconSecurity)
{
return IEEE154_TRANSACTION_OVERFLOW;
}
event void Token.granted() { }
async event void RadioOff.offDone() { }
async event void BeaconTxAlarm.fired() {}
async event void BeaconTx.loadDone() {}
async event void BeaconTx.transmitDone(ieee154_txframe_t *frame,
ieee154_reftime_t *referenceTime, bool pendingFlag, error_t error) { }
command error_t IEEE154TxBeaconPayload.setBeaconPayload(void *beaconPayload, uint8_t length) { return ESIZE; }
command const void* IEEE154TxBeaconPayload.getBeaconPayload() { return NULL; }
command uint8_t IEEE154TxBeaconPayload.getBeaconPayloadLength() {return 0; }
command error_t IEEE154TxBeaconPayload.modifyBeaconPayload(uint8_t offset, void *buffer, uint8_t bufferLength)
{
return ESIZE;
}
event void PIBUpdate.notify[uint8_t attributeID](const void* attributeValue)
{
}
event void PendingAddrSpecUpdated.notify(bool val)
{
}
event void GtsSpecUpdated.notify(bool val)
{
}
event void BeaconPayloadUpdateTimer.fired()
{
}
command uint8_t SuperframeSpecWrite.write(uint8_t *superframeSpecField, uint8_t maxlen)
{
return 0;
}
command uint8_t SuperframeSpecWrite.getLength()
{
return 0;
}
event void RealignmentBeaconEnabledTx.transmitDone(ieee154_txframe_t *frame, ieee154_status_t status)
{
}
event void RealignmentNonBeaconEnabledTx.transmitDone(ieee154_txframe_t *frame, ieee154_status_t status)
{
}
event message_t* BeaconRequestRx.received(message_t* frame)
{
return frame;
}
command bool IsSendingBeacons.get(){ return FALSE;}
async command uint32_t CapStart.getNow() { return 0; }
async command ieee154_reftime_t* CapStartRefTime.getNow() { return NULL; }
async command uint32_t CapLen.getNow() { return 0;}
async command uint32_t CapEnd.getNow()
{
return 0;
}
async command uint32_t CfpEnd.getNow()
{
return 0;
}
async command uint32_t CfpLen.getNow()
{
return 0;
}
async command bool IsBLEActive.getNow(){ return FALSE;}
async command uint16_t BLELen.getNow(){ return 0;}
async command bool BeaconFramePendingBit.getNow(){ return FALSE;}
async command uint8_t* GtsField.getNow() { return NULL; }
async command uint32_t SfSlotDuration.getNow() { return 0; }
async command uint32_t BeaconInterval.getNow() { return 0; }
async command uint8_t FinalCapSlot.getNow() { return 0; }
async command uint8_t NumGtsSlots.getNow() { return 0; }
default event void MLME_START.confirm (
ieee154_status_t status
){}
default event void IEEE154TxBeaconPayload.setBeaconPayloadDone(void *beaconPayload, uint8_t length){}
default event void IEEE154TxBeaconPayload.modifyBeaconPayloadDone(uint8_t offset, void *buffer, uint8_t bufferLength){}
default event void IEEE154TxBeaconPayload.aboutToTransmit(){}
default event void IEEE154TxBeaconPayload.beaconTransmitted(){}
}
--- NEW FILE: NoCapP.nc ---
/*
* Copyright (c) 2008, Technische Universitaet Berlin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the Technische Universitaet Berlin nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* - Revision -------------------------------------------------------------
* $Revision: 1.1 $
* $Date: 2008/06/16 18:00:30 $
* @author Jan Hauer <hauer at tkn.tu-berlin.de>
* ========================================================================
*/
#include "TKN154_PHY.h"
#include "TKN154_MAC.h"
generic module NoCapP()
{
provides
{
interface Init as Reset;
interface FrameTx as CapTx;
interface FrameRx as FrameRx[uint8_t frameType];
interface FrameExtracted as FrameExtracted[uint8_t frameType];
interface FrameTxNow as BroadcastTx;
interface Notify<bool> as WasRxEnabled;
}
uses
{
interface Random;
interface Alarm<TSymbolIEEE802154,uint32_t> as CapEndAlarm;
interface Alarm<TSymbolIEEE802154,uint32_t> as BLEAlarm;
interface Alarm<TSymbolIEEE802154,uint32_t> as IndirectTxWaitAlarm;
interface Alarm<TSymbolIEEE802154,uint32_t> as BroadcastAlarm;
interface Resource as Token;
interface ResourceTransfer as TokenToCfp;
interface ResourceTransferred as TokenTransferred;
interface ResourceRequested as TokenRequested;
interface GetNow<bool> as IsTokenRequested;
interface GetNow<uint32_t> as CapStart;
interface GetNow<ieee154_reftime_t*> as CapStartRefTime;
interface GetNow<uint32_t> as CapLen;
interface GetNow<bool> as IsBLEActive;
interface GetNow<uint16_t> as BLELen;
interface GetNow<bool> as IsRxEnableActive;
interface GetNow<bool> as IsRxBroadcastPending;
interface Notify<bool> as RxEnableStateChange;
interface FrameUtility;
interface RadioTx;
interface RadioRx;
interface RadioOff;
interface Get<bool> as IsBeaconEnabledPAN;
interface MLME_GET;
interface MLME_SET;
interface Ieee802154Debug as Debug;
interface TimeCalc;
interface Leds;
interface SetNow<ieee154_cap_frame_backup_t*> as FrameBackup;
interface GetNow<ieee154_cap_frame_backup_t*> as FrameRestore;
}
}
implementation
{
command error_t Reset.init()
{
return SUCCESS;
}
async event void TokenTransferred.transferred()
{
call TokenToCfp.transfer();
}
command ieee154_status_t CapTx.transmit(ieee154_txframe_t *frame)
{
return IEEE154_TRANSACTION_OVERFLOW;
}
async event void RadioTx.loadDone(){ }
async event void RadioOff.offDone(){ }
async event void RadioRx.prepareDone(){ }
async event void CapEndAlarm.fired(){ }
async event void BLEAlarm.fired(){ }
event void RxEnableStateChange.notify(bool x){ }
async event void BroadcastAlarm.fired(){ }
async event void IndirectTxWaitAlarm.fired() { }
async event void RadioTx.transmitDone(ieee154_txframe_t *frame, ieee154_reftime_t
*referenceTime, bool ackPendingFlag, error_t error) { }
event message_t* RadioRx.received(message_t* frame, ieee154_reftime_t* referenceTime) { return frame; }
async command ieee154_status_t BroadcastTx.transmitNow(ieee154_txframe_t *frame){ return IEEE154_TRANSACTION_OVERFLOW; }
async event void TokenRequested.requested() {}
async event void TokenRequested.immediateRequested() {}
event void Token.granted(){}
command error_t WasRxEnabled.enable(){return FAIL;}
command error_t WasRxEnabled.disable(){return FAIL;}
}
--- NEW FILE: NoCapQueueP.nc ---
/*
* Copyright (c) 2008, Technische Universitaet Berlin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the Technische Universitaet Berlin nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* - Revision -------------------------------------------------------------
* $Revision: 1.1 $
* $Date: 2008/06/16 18:00:30 $
* @author Jan Hauer <hauer at tkn.tu-berlin.de>
* ========================================================================
*/
#include "TKN154_MAC.h"
generic module NoCapQueueP()
{
provides
{
interface Init;
interface FrameTx[uint8_t client];
interface FrameRx as FrameExtracted[uint8_t client];
interface Purge;
}
uses
{
interface Queue<ieee154_txframe_t*>;
interface FrameTx as CapTx;
interface FrameRx as SubFrameExtracted;
}
}
implementation
{
command error_t Init.init()
{
return SUCCESS;
}
command ieee154_status_t FrameTx.transmit[uint8_t client](ieee154_txframe_t *data)
{
return IEEE154_TRANSACTION_OVERFLOW;
}
event void CapTx.transmitDone(ieee154_txframe_t *data, ieee154_status_t status) { }
event message_t* SubFrameExtracted.received(message_t* frame) { return frame; }
command ieee154_status_t Purge.purge(uint8_t msduHandle) { return IEEE154_INVALID_HANDLE; }
}
--- NEW FILE: NoCoordCfpP.nc ---
/*
* Copyright (c) 2008, Technische Universitaet Berlin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the Technische Universitaet Berlin nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* - Revision -------------------------------------------------------------
* $Revision: 1.1 $
* $Date: 2008/06/16 18:00:30 $
* @author Jan Hauer <hauer at tkn.tu-berlin.de>
* ========================================================================
*/
/**
* The contention free period (CFP) in beacon mode, a.k.a. GTS, is not yet
* implemented - this is only an empty placeholder. In contrast to the CAP
* component the GTS component for an incoming superframe will probably be very
* different from the GTS for an outgoing superframe. That is why there are two
* separate placeholder components (DeviceCfpP and CoordCfpP) instead of one
* generic CfpP component. This component would deal with the GTS for an
* outgoing superframe, i.e. from the perspective of a coordinator.
*/
#include "TKN154_MAC.h"
module NoCoordCfpP
{
provides {
interface Init;
interface WriteBeaconField as GtsInfoWrite;
interface FrameTx as CfpTx;
interface Purge;
} uses {
interface Resource as Token;
interface ResourceTransferred as TokenTransferred;
interface ResourceRequested as TokenRequested;
interface GetNow<uint32_t> as CfpEnd;
interface GetNow<ieee154_reftime_t*> as CapStartRefTime;
interface GetNow<uint8_t*> as GtsField;
interface GetNow<uint32_t> as SfSlotDuration;
interface GetNow<uint8_t> as FinalCapSlot;
interface Alarm<TSymbolIEEE802154,uint32_t> as CfpSlotAlarm;
interface Alarm<TSymbolIEEE802154,uint32_t> as CfpEndAlarm;
interface RadioTx;
interface RadioRx;
interface RadioOff;
interface MLME_GET;
interface MLME_SET;
}
}
implementation
{
command error_t Init.init()
{
// initialize any module variables
return SUCCESS;
}
command ieee154_status_t CfpTx.transmit(ieee154_txframe_t *data)
{
// send a frame in a GTS slot (triggered by MCPS_DATA.request())
return IEEE154_INVALID_GTS;
}
command ieee154_status_t Purge.purge(uint8_t msduHandle)
{
// request to purge a frame (triggered by MCPS_DATA.purge())
return IEEE154_INVALID_HANDLE;
}
async event void TokenTransferred.transferred()
{
// the CFP has started, this component now owns the token -
// because GTS is not implemented we release the token
// immediately; the general rule is: as long as a component
// owns the token it has exclusive access to the radio
call Token.release();
}
async event void CfpEndAlarm.fired() { }
async event void CfpSlotAlarm.fired() {}
async event void RadioOff.offDone()
{
call Token.release();
}
command uint8_t GtsInfoWrite.write(uint8_t *gtsSpecField, uint8_t maxlen)
{
// write the current GTS spec at the given address
if (call GtsInfoWrite.getLength() > maxlen)
return 0;
gtsSpecField[0] = 0;
return 1;
}
command uint8_t GtsInfoWrite.getLength()
{
// returns the length of the current GTS spec
// must return the same value as GtsInfoWrite.write
return 1;
}
async event void RadioTx.loadDone(){}
async event void RadioTx.transmitDone(ieee154_txframe_t *frame,
ieee154_reftime_t *referenceTime, bool ackPendingFlag, error_t error){}
async event void RadioRx.prepareDone(){}
event message_t* RadioRx.received(message_t *frame, ieee154_reftime_t *timestamp){return frame;}
async event void TokenRequested.requested()
{
// someone (e.g. SCAN component) requested access to the radio,
// you might want to release the token...
}
async event void TokenRequested.immediateRequested(){ }
event void Token.granted(){ }
}
--- NEW FILE: NoDebugP.nc ---
/*
* Copyright (c) 2008, Technische Universitaet Berlin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the Technische Universitaet Berlin nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* - Revision -------------------------------------------------------------
* $Revision: 1.1 $
* $Date: 2008/06/16 18:00:31 $
* @author Jan Hauer <hauer at tkn.tu-berlin.de>
* ========================================================================
*/
#include "TKN154_DEBUG.h"
module NoDebugP
{
provides
{
interface Ieee802154Debug[uint8_t client];
}
}
implementation
{
async command void Ieee802154Debug.log[uint8_t client](
uint8_t priority,
uint8_t eventID,
uint32_t param1,
uint32_t param2,
uint32_t param3)
{
}
command void Ieee802154Debug.flush[uint8_t client](){}
}
--- NEW FILE: NoDeviceCapQueueP.nc ---
/*
* Copyright (c) 2008, Technische Universitaet Berlin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the Technische Universitaet Berlin nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* - Revision -------------------------------------------------------------
* $Revision: 1.1 $
* $Date: 2008/06/16 18:00:31 $
* @author Jan Hauer <hauer at tkn.tu-berlin.de>
* ========================================================================
*/
#include "TKN154_MAC.h"
module NoDeviceCapQueueP
{
provides
{
interface Init;
interface FrameTx[uint8_t client];
interface FrameRx as FrameExtracted[uint8_t client];
interface Purge;
}
uses
{
interface Queue<ieee154_txframe_t*>;
interface FrameTx as DeviceCapTx;
interface FrameRx as SubFrameExtracted;
}
}
implementation
{
command error_t Init.init() { return SUCCESS; }
command ieee154_status_t FrameTx.tx[uint8_t client](ieee154_txframe_t *data) { return TRANSACTION_OVERFLOW; }
event void DeviceCapTx.transmitDone(ieee154_txframe_t *data, ieee154_status_t status) { }
event message_t* SubFrameExtracted.received(message_t* data) { return data; }
command ieee154_status_t Purge.purge(uint8_t msduHandle) { return INVALID_HANDLE; }
}
--- NEW FILE: NoDeviceCfpP.nc ---
/*
* Copyright (c) 2008, Technische Universitaet Berlin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the Technische Universitaet Berlin nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* - Revision -------------------------------------------------------------
* $Revision: 1.1 $
* $Date: 2008/06/16 18:00:31 $
* @author Jan Hauer <hauer at tkn.tu-berlin.de>
* ========================================================================
*/
/**
* The contention free period (CFP) in beacon mode, a.k.a. GTS, is not yet
* implemented - this is only an empty placeholder. In contrast to the CAP
* component the GTS component for an incoming superframe will probably be very
* different from the GTS for an outgoing superframe. That is why there are two
* separate placeholder components (DeviceCfpP and CoordCfpP) instead of one
* generic CfpP component. This component would deal with the GTS for an
* incoming superframe, i.e. from the perspective of a device.
*/
#include "TKN154_MAC.h"
module NoDeviceCfpP
{
provides {
interface Init;
interface FrameTx as CfpTx;
interface Purge;
} uses {
interface Resource as Token;
interface ResourceTransferred as TokenTransferred;
interface ResourceRequested as TokenRequested;
interface GetNow<ieee154_reftime_t*> as CapStartRefTime;
interface GetNow<uint32_t> as CfpEnd;
interface GetNow<uint8_t*> as GtsField;
interface GetNow<uint32_t> as SfSlotDuration;
interface GetNow<uint8_t> as FinalCapSlot;
interface Alarm<TSymbolIEEE802154,uint32_t> as CfpSlotAlarm;
interface Alarm<TSymbolIEEE802154,uint32_t> as CfpEndAlarm;
interface RadioTx;
interface RadioRx;
interface RadioOff;
interface MLME_GET;
interface MLME_SET;
}
}
implementation
{
command error_t Init.init()
{
// initialize any module variables
return SUCCESS;
}
command ieee154_status_t CfpTx.transmit(ieee154_txframe_t *data)
{
// request to send a frame in a GTS slot (triggered by MCPS_DATA.request())
return IEEE154_INVALID_GTS;
}
command ieee154_status_t Purge.purge(uint8_t msduHandle)
{
// request to purge a frame (triggered by MCPS_DATA.purge())
return IEEE154_INVALID_HANDLE;
}
async event void TokenTransferred.transferred()
{
// the CFP has started, this component now owns the token -
// because GTS is not implemented we release the token
// immediately; the general rule is: as long as a component
// owns the token it has exclusive access to the radio
call Token.release();
}
async event void CfpEndAlarm.fired() { }
async event void CfpSlotAlarm.fired() {}
async event void RadioOff.offDone()
{
call Token.release();
}
async event void RadioTx.loadDone(){}
async event void RadioTx.transmitDone(ieee154_txframe_t *frame,
ieee154_reftime_t *referenceTime, bool ackPendingFlag, error_t error){}
async event void RadioRx.prepareDone(){}
event message_t* RadioRx.received(message_t *frame, ieee154_reftime_t *timestamp){return frame;}
async event void TokenRequested.requested()
{
// someone requested access to the radio, you might
// consider releasing it...
}
async event void TokenRequested.immediateRequested(){ }
event void Token.granted(){ }
}
--- NEW FILE: NoScanP.nc ---
/*
* Copyright (c) 2008, Technische Universitaet Berlin
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the Technische Universitaet Berlin nor the names
* of its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* - Revision -------------------------------------------------------------
* $Revision: 1.1 $
* $Date: 2008/06/16 18:00:31 $
* @author Jan Hauer <hauer at tkn.tu-berlin.de>
* ========================================================================
*/
#include "TKN154_MAC.h"
module NoScanP
{
provides
{
interface Init;
interface MLME_SCAN;
interface MLME_BEACON_NOTIFY;
}
uses
{
interface MLME_GET;
interface MLME_SET;
interface EnergyDetection;
interface RadioOff;
interface RadioRx;
interface RadioTx;
interface IEEE154Frame as Frame;
interface IEEE154BeaconFrame as BeaconFrame;
interface Timer<TSymbolIEEE802154> as ScanTimer;
interface Pool<ieee154_txframe_t> as TxFramePool;
interface Pool<ieee154_txcontrol_t> as TxControlPool;
interface Resource as Token;
interface FrameUtility;
interface Leds;
}
}
implementation
{
command error_t Init.init() { return SUCCESS;}
command ieee154_status_t MLME_SCAN.request (
uint8_t ScanType,
uint32_t ScanChannels,
uint8_t ScanDuration,
uint8_t ChannelPage,
uint8_t EnergyDetectListNumEntries,
int8_t* EnergyDetectList,
uint8_t PANDescriptorListNumEntries,
ieee154_PANDescriptor_t* PANDescriptorList,
ieee154_security_t *security
)
{
return IEEE154_TRANSACTION_OVERFLOW;
}
event void Token.granted()
{
call Token.release();
}
event void EnergyDetection.done(error_t status, int8_t EnergyLevel){}
async event void RadioRx.prepareDone() { }
event message_t* RadioRx.received(message_t *frame, ieee154_reftime_t *time)
{
return frame;
}
async event void RadioTx.loadDone() { }
async event void RadioTx.transmitDone(ieee154_txframe_t *frame, ieee154_reftime_t *t0,
bool ackPendingFlag, error_t error){}
event void ScanTimer.fired() { }
async event void RadioOff.offDone() { }
}
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154/interfaces/MCPS MCPS_DATA.nc, NONE, 1.1 MCPS_PURGE.nc, NONE, 1.1
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/mac/tkn154/interfaces/MLME MLME_ASSOCIATE.nc, NONE, 1.1 MLME_BEACON_NOTIFY.nc, NONE, 1.1 MLME_COMM_STATUS.nc, NONE, 1.1 MLME_DISASSOCIATE.nc, NONE, 1.1 MLME_GET.nc, NONE, 1.1 MLME_GTS.nc, NONE, 1.1 MLME_ORPHAN.nc, NONE, 1.1 MLME_POLL.nc, NONE, 1.1 MLME_RESET.nc, NONE, 1.1 MLME_RX_ENABLE.nc, NONE, 1.1 MLME_SCAN.nc, NONE, 1.1 MLME_SET.nc, NONE, 1.1 MLME_START.nc, NONE, 1.1 MLME_SYNC_LOSS.nc, NONE, 1.1 MLME_SYNC.nc, NONE, 1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-2-commits
mailing list