[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules MlmeDisassociateRequestConfirmM.nc, 1.1, 1.2 MlmeGetRequestConfirmM.nc, 1.1, 1.2 MlmePollRequestConfirmM.nc, 1.1, 1.2 PibAttributeM.nc, 1.3, 1.4 McpsDataRequestConfirmM.nc, 1.1, 1.2 MlmeAssociateIndicationResponseM.nc, 1.1, 1.2 MlmeGtsIndicationM.nc, 1.1, 1.2 McpsPurgeRequestConfirmM.nc, 1.1, 1.2 AddressM.nc, 1.1, 1.2 MlmeCommStatusIndicationM.nc, 1.1, 1.2 MlmeStartRequestConfirmM.nc, 1.1, 1.2 MlmeRxEnableRequestConfirmM.nc, 1.1, 1.2 MlmeSyncLossIndicationM.nc, 1.1, 1.2 MlmeSetRequestConfirmM.nc, 1.2, 1.3 MlmeResetRequestConfirmM.nc, 1.1, 1.2 MlmeBeaconNotifyIndicationM.nc, 1.3, 1.4 MlmeOrphanIndicationResponseM.nc, 1.1, 1.2 PanDescriptorM.nc, 1.2, 1.3 MlmeSyncRequestM.nc, 1.1, 1.2 SduM.nc, 1.1, 1.2 MlmeScanRequestConfirmM.nc, 1.2, 1.3 MlmeAssociateRequestConfirmM.nc, 1.2, 1.3 MlmeDisassociateIndicationM.nc, 1.1, 1.2 McpsDataIndicationM.nc, 1.2, 1.3 MlmeGtsRequestConfirmM.nc, 1.2, 1.3

Jan Flora janflora at users.sourceforge.net
Wed Aug 23 02:55:00 PDT 2006


Update of /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17970/tos/lib/ieee802154/mac/ADTModules

Modified Files:
	MlmeDisassociateRequestConfirmM.nc MlmeGetRequestConfirmM.nc 
	MlmePollRequestConfirmM.nc PibAttributeM.nc 
	McpsDataRequestConfirmM.nc MlmeAssociateIndicationResponseM.nc 
	MlmeGtsIndicationM.nc McpsPurgeRequestConfirmM.nc AddressM.nc 
	MlmeCommStatusIndicationM.nc MlmeStartRequestConfirmM.nc 
	MlmeRxEnableRequestConfirmM.nc MlmeSyncLossIndicationM.nc 
	MlmeSetRequestConfirmM.nc MlmeResetRequestConfirmM.nc 
	MlmeBeaconNotifyIndicationM.nc 
	MlmeOrphanIndicationResponseM.nc PanDescriptorM.nc 
	MlmeSyncRequestM.nc SduM.nc MlmeScanRequestConfirmM.nc 
	MlmeAssociateRequestConfirmM.nc MlmeDisassociateIndicationM.nc 
	McpsDataIndicationM.nc MlmeGtsRequestConfirmM.nc 
Log Message:
802.15.4 library updates

Index: MlmeDisassociateRequestConfirmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeDisassociateRequestConfirmM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmeDisassociateRequestConfirmM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmeDisassociateRequestConfirmM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,33 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
+ #include "MacPib.h"
  module MlmeDisassociateRequestConfirmM
  {
***************
*** 8,12 ****
  	{
  		interface IeeeBufferManagement as BufferMng;
! 		interface PibDatabase;
  	}
  }
--- 39,43 ----
  	{
  		interface IeeeBufferManagement as BufferMng;
! 		interface MacAddress;
  	}
  }
***************
*** 17,21 ****
  	{
  		uint8_t *frame;
! 		uint16_t myPanId = call PibDatabase.getPANId();
  		uint8_t frameSize = mhrFrameControlLength
  		                    + mhrSequenceNumberLength
--- 48,52 ----
  	{
  		uint8_t *frame;
! 		//uint16_t myPanId = call PibDatabase.getPANId();
  		uint8_t frameSize = mhrFrameControlLength
  		                    + mhrSequenceNumberLength
***************
*** 31,34 ****
--- 62,66 ----
  			return FAIL;
  		}
+ 		(*primitive)->msg.request.frameLength = frameSize;
  		frame = (*primitive)->msg.request.disassocNotificationFrame;
  		mhrFramePending(frame) = FALSE;
***************
*** 36,43 ****
  		mhrSecurityEnabled(frame) = FALSE;
  		mhrIntraPAN(frame) = TRUE;
  		mhrDestAddrMode(frame) = 3;
! 		mhrSrcAddrMode(frame) = 3;
! 		NTOUH16(&((uint8_t)myPanId), mhrDestPANId(frame));
! 		NTOUH64(aExtendedAddress, mhrSrcAddr(frame));
  		mhrFrameType(frame) = macCommandFrame;
  		msduCommandFrameIdent(frame) = macCommandDisassocNot;
--- 68,77 ----
  		mhrSecurityEnabled(frame) = FALSE;
  		mhrIntraPAN(frame) = TRUE;
+ 		
  		mhrDestAddrMode(frame) = 3;
! 		*((uint16_t*)mhrDestPANId(frame)) = macPanId;
! 		
! 		call MacAddress.setSrcLocal(frame, TRUE);
! 
  		mhrFrameType(frame) = macCommandFrame;
  		msduCommandFrameIdent(frame) = macCommandDisassocNot;

Index: MlmeGetRequestConfirmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeGetRequestConfirmM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmeGetRequestConfirmM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmeGetRequestConfirmM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module MlmeGetRequestConfirmM
  {
***************
*** 27,31 ****
  	{
  		request->msg.request.pibAttribute = pibAttribute;
- 		pibAttribute->destroyable = FALSE;
  	}
  	                              
--- 57,60 ----
***************
*** 37,41 ****
  	command Ieee_PibAttribute MlmeGetRequestConfirm.getPibAttribute( Mlme_GetRequestConfirm confirm )
  	{
- 		confirm->msg.confirm.pibAttribute->destroyable = TRUE;
  		return confirm->msg.confirm.pibAttribute;
  	}
--- 66,69 ----

Index: MlmePollRequestConfirmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmePollRequestConfirmM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmePollRequestConfirmM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmePollRequestConfirmM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,33 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
+ #include "MacPib.h"
  module MlmePollRequestConfirmM
  {
***************
*** 16,67 ****
  	                                                Ieee_Address coordAddr )
  	{
! 		uint8_t *frame;
! 		uint16_t myShortAddr = call PibDatabase.getShortAddress();
! 		uint16_t myPanId = call PibDatabase.getPANId();
! 		bool srcExtAddr = (myShortAddr == 0xFFFF || myShortAddr == 0xFFFE);
! 		uint8_t dstAddrMode = (call PibDatabase.isPanCoordinator(coordAddr)?0:coordAddr->mode);
! 		uint8_t frameSize = mhrFrameControlLength + mhrSequenceNumberLength
! 		                    + mhrSrcAddrModeLength((srcExtAddr?3:2), FALSE)
! 		                    + mhrDstAddrModeLength(dstAddrMode)
! 		                    + msduCommandFrameIdentLength;
  		if (FAIL == call BufferMng.claim(sizeof(mlmePollRequestConfirm_t), (uint8_t**)primitive)) {
  			return FAIL;
  		}
- 		if (FAIL == call BufferMng.claim(frameSize, &((uint8_t*)((*primitive)->msg.request.dataRequestFrame)))) {
- 			call BufferMng.release(sizeof(mlmePollRequestConfirm_t), (uint8_t*)(*primitive));
- 			return FAIL;
- 		}
- 		frame = (*primitive)->msg.request.dataRequestFrame;
- 		mhrFramePending(frame) = FALSE;
- 		mhrAckRequest(frame) = TRUE;
- 		mhrIntraPAN(frame) = FALSE;
- 		// Security disabled by default.
- 		mhrSecurityEnabled(frame) = FALSE;
  		
! 		// Set address info.
! 		mhrDestAddrMode(frame) = dstAddrMode;
! 		if (dstAddrMode) {
! 			NTOUH16(&((uint8_t)coordAddr->panId), mhrDestPANId(frame));
! 			if (coordAddr->mode == 2) {
! 				NTOUH16(coordAddr->address, mhrDestAddr(frame));
! 			} else {
! 				NTOUH64(coordAddr->address, mhrDestAddr(frame));
! 			}
! 		}
! 
! 		if (srcExtAddr) {
! 			// Use extended addressing.
! 			mhrSrcAddrMode(frame) = 3;
! 			NTOUH64(aExtendedAddress, mhrSrcAddr(frame));
! 		} else {
! 			// Use short addressing.
! 			mhrSrcAddrMode(frame) = 2;
! 			NTOUH16(&((uint8_t)myShortAddr), mhrSrcAddr(frame));
! 		}
! 		NTOUH16(&((uint8_t)myPanId), mhrSrcPANId(frame));
  		
! 		mhrFrameType(frame) = macCommandFrame;
! 		msduCommandFrameIdent(frame) = macCommandDataReq;
! 		return SUCCESS;
  	}
  	
--- 47,61 ----
  	                                                Ieee_Address coordAddr )
  	{
! 		ieeeAddress_t *myCoordAddr;
! 
  		if (FAIL == call BufferMng.claim(sizeof(mlmePollRequestConfirm_t), (uint8_t**)primitive)) {
  			return FAIL;
  		}
  		
! 		myCoordAddr = &((*primitive)->msg.request.coordAddr);
! 		(*primitive)->msg.request.useSecurity = FALSE;
  		
! 		// Copy the coordinator address.
! 		memcpy(myCoordAddr, coordAddr, sizeof(ieeeAddress_t));
  	}
  	
***************
*** 73,78 ****
  	command void MlmePollRequestConfirm.setSecurityEnable( Mlme_PollRequestConfirm request )
  	{
! 		uint8_t *frame = request->msg.request.dataRequestFrame;
! 		mhrSecurityEnabled(frame) = TRUE;
  	}
  	
--- 67,71 ----
  	command void MlmePollRequestConfirm.setSecurityEnable( Mlme_PollRequestConfirm request )
  	{
! 		request->msg.request.useSecurity = TRUE;
  	}
  	

Index: PibAttributeM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/PibAttributeM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PibAttributeM.nc	27 Feb 2006 22:13:01 -0000	1.3
--- PibAttributeM.nc	23 Aug 2006 09:54:57 -0000	1.4
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  #include <MacPib.h>
  #include <Ieee802154Adts.h>
***************
*** 16,30 ****
  	command result_t IeeePibAttribute.create( uint8_t size, Ieee_PibAttribute *pibAttribute )
  	{
! 		result_t res = call BufferMng.claim(size+2, (uint8_t**)pibAttribute);
  		if (res == SUCCESS) {
  			(*pibAttribute)->destroyable = TRUE;
  		}
  		return res;
  	}
  	
! 	command result_t IeeePibAttribute.destroy( uint8_t size, Ieee_PibAttribute pibAttribute )
  	{
  		if (pibAttribute->destroyable) {
! 			return call BufferMng.release(size+2, (uint8_t*)pibAttribute);
  		}
  		return FAIL;
--- 46,61 ----
  	command result_t IeeePibAttribute.create( uint8_t size, Ieee_PibAttribute *pibAttribute )
  	{
! 		result_t res = call BufferMng.claim(size+3, (uint8_t**)pibAttribute);
  		if (res == SUCCESS) {
  			(*pibAttribute)->destroyable = TRUE;
+ 			(*pibAttribute)->size = size+3;
  		}
  		return res;
  	}
  	
! 	command result_t IeeePibAttribute.destroy( Ieee_PibAttribute pibAttribute )
  	{
  		if (pibAttribute->destroyable) {
! 			return call BufferMng.release(pibAttribute->size, (uint8_t*)pibAttribute);
  		}
  		return FAIL;
***************
*** 91,95 ****
  	{
  		pibAttribute->attribute = IEEE802154_macBeaconPayloadLength;
!   		((uint16_t*)pibAttribute->value)[0] = _NTOUH16(payload->payloadLen);
  	}
  	// 0x47
--- 122,126 ----
  	{
  		pibAttribute->attribute = IEEE802154_macBeaconPayloadLength;
!   		((uint16_t*)pibAttribute->value)[0] = payload->payloadLen;
  	}
  	// 0x47
***************
*** 105,109 ****
  	{
  		pibAttribute->attribute = IEEE802154_macBeaconTxTime;
!   		((uint32_t*)pibAttribute->value)[0] = _NTOUH32(beaconTxTime);
  	}
  	// 0x49
--- 136,140 ----
  	{
  		pibAttribute->attribute = IEEE802154_macBeaconTxTime;
!   		((uint32_t*)pibAttribute->value)[0] = beaconTxTime;
  	}
  	// 0x49
***************
*** 119,123 ****
  	{
  		pibAttribute->attribute = IEEE802154_macCoordExtendedAddress;
! 		NTOUH64(coordExtendedAddress, pibAttribute->value);
  	}
  	// 0x4B
--- 150,154 ----
  	{
  		pibAttribute->attribute = IEEE802154_macCoordExtendedAddress;
! 		memcpy(pibAttribute->value, coordExtendedAddress, 8);
  	}
  	// 0x4B
***************
*** 126,130 ****
  	{
  		pibAttribute->attribute = IEEE802154_macCoordShortAddress;
!   		((uint16_t*)pibAttribute->value)[0] = _NTOUH16(coordShortAddress);
  	}
  	// 0x4C
--- 157,161 ----
  	{
  		pibAttribute->attribute = IEEE802154_macCoordShortAddress;
!   		((uint16_t*)pibAttribute->value)[0] = coordShortAddress;
  	}
  	// 0x4C
***************
*** 161,165 ****
  	{
  		pibAttribute->attribute = IEEE802154_macPANId;
!   		((uint16_t*)pibAttribute->value)[0] = _NTOUH16(panId);
  	}
  	// 0x51
--- 192,196 ----
  	{
  		pibAttribute->attribute = IEEE802154_macPANId;
!   		((uint16_t*)pibAttribute->value)[0] = panId;
  	}
  	// 0x51
***************
*** 182,186 ****
  	{
  		pibAttribute->attribute = IEEE802154_macShortAddress;
! 		((uint16_t*)pibAttribute->value)[0] = _NTOUH16(shortAddress);
  	}
  	// 0x54
--- 213,217 ----
  	{
  		pibAttribute->attribute = IEEE802154_macShortAddress;
! 		((uint16_t*)pibAttribute->value)[0] = shortAddress;
  	}
  	// 0x54
***************
*** 196,200 ****
  	{
  		pibAttribute->attribute = IEEE802154_macTransactionPersistenceTime;
! 		((uint16_t*)pibAttribute->value)[0] = _NTOUH16(transactionPersistenceTime);
  	}
  	
--- 227,231 ----
  	{
  		pibAttribute->attribute = IEEE802154_macTransactionPersistenceTime;
! 		((uint16_t*)pibAttribute->value)[0] = transactionPersistenceTime;
  	}
  	
***************
*** 290,294 ****
  	command uint32_t IeeePibAttribute.getMacBeaconTxTime( Ieee_PibAttribute pibAttribute )
  	{
! 		return _NTOUH32(*((uint32_t*)(pibAttribute->value)));
  	}
  	// 0x49
--- 321,325 ----
  	command uint32_t IeeePibAttribute.getMacBeaconTxTime( Ieee_PibAttribute pibAttribute )
  	{
! 		return *((uint32_t*)pibAttribute->value);
  	}
  	// 0x49
***************
*** 305,309 ****
  	command uint16_t IeeePibAttribute.getMacCoordShortAddress( Ieee_PibAttribute pibAttribute )
  	{
! 		return _NTOUH16(*((uint16_t*)pibAttribute->value));
  	}
  	// 0x4C
--- 336,340 ----
  	command uint16_t IeeePibAttribute.getMacCoordShortAddress( Ieee_PibAttribute pibAttribute )
  	{
! 		return *((uint16_t*)pibAttribute->value);
  	}
  	// 0x4C
***************
*** 330,334 ****
  	command uint16_t IeeePibAttribute.getMacPanId( Ieee_PibAttribute pibAttribute )
  	{
! 		return _NTOUH16(*((uint16_t*)pibAttribute->value));
  	}
  	// 0x51
--- 361,365 ----
  	command uint16_t IeeePibAttribute.getMacPanId( Ieee_PibAttribute pibAttribute )
  	{
! 		return *((uint16_t*)pibAttribute->value);
  	}
  	// 0x51
***************
*** 345,349 ****
  	command uint16_t IeeePibAttribute.getMacShortAddress( Ieee_PibAttribute pibAttribute )
  	{
! 		return _NTOUH16(*((uint16_t*)pibAttribute->value));
  	}
  	// 0x54
--- 376,380 ----
  	command uint16_t IeeePibAttribute.getMacShortAddress( Ieee_PibAttribute pibAttribute )
  	{
! 		return *((uint16_t*)pibAttribute->value);
  	}
  	// 0x54
***************
*** 355,359 ****
  	command uint16_t IeeePibAttribute.getMacTransactionPersistenceTime( Ieee_PibAttribute pibAttribute )
  	{
! 		return _NTOUH16(*((uint16_t*)pibAttribute->value));
  	}
  	// 0x70
--- 386,390 ----
  	command uint16_t IeeePibAttribute.getMacTransactionPersistenceTime( Ieee_PibAttribute pibAttribute )
  	{
! 		return *((uint16_t*)pibAttribute->value);
  	}
  	// 0x70

Index: McpsDataRequestConfirmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/McpsDataRequestConfirmM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** McpsDataRequestConfirmM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- McpsDataRequestConfirmM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  includes macTypes;
  
***************
*** 10,13 ****
--- 40,44 ----
  	{
  		interface IeeeBufferManagement as BufferMng;
+ 		interface MacAddress;
  	}
  }
***************
*** 37,62 ****
  		dataFrame = (*primitive)->msg.request.dataFrame;
  		mhrIntraPAN(dataFrame) = intraPAN;
! 		mhrDestAddrMode(dataFrame) = dstAddress->mode;
! 		if (dstAddress->mode) {
! 			uint8_t *frameDestAddr = mhrDestAddr(dataFrame);
! 			NTOUH16((uint8_t*)&(dstAddress->panId), mhrDestPANId(dataFrame));
! 			if (mhrDestAddrLength(dataFrame) == 2) {
! 				NTOUH16(dstAddress->address, frameDestAddr);
! 			} else {
! 				NTOUH64(dstAddress->address, frameDestAddr);
! 			}
! 		}
! 		mhrSrcAddrMode(dataFrame) = srcAddress->mode;
! 		if (srcAddress->mode) {
! 			uint8_t *frameSrcAddr = mhrSrcAddr(dataFrame);
! 			if (!intraPAN) {
! 				NTOUH16((uint8_t*)&(srcAddress->panId), mhrSrcPANId(dataFrame));
! 			}
! 			if (mhrSrcAddrLength(dataFrame) == 2) {
! 				NTOUH16(srcAddress->address, frameSrcAddr);
! 			} else {
! 				NTOUH64(srcAddress->address, frameSrcAddr);
! 			}
! 		}
  		mhrFrameType(dataFrame) = macDataFrame;
  		
--- 68,75 ----
  		dataFrame = (*primitive)->msg.request.dataFrame;
  		mhrIntraPAN(dataFrame) = intraPAN;
! 		
! 		call MacAddress.setDstAddr(dataFrame, dstAddress);
! 		call MacAddress.setSrcAddr(dataFrame, dstAddress);
! 
  		mhrFrameType(dataFrame) = macDataFrame;
  		

Index: MlmeAssociateIndicationResponseM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeAssociateIndicationResponseM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmeAssociateIndicationResponseM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmeAssociateIndicationResponseM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,34 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
+ #include "MacPib.h"
+ 
  module MlmeAssociateIndicationResponseM
  {
***************
*** 7,11 ****
  	uses
  	{
! 		interface PibDatabase;
  	}
  }
--- 39,43 ----
  	uses
  	{
! 		interface MacAddress;
  	}
  }
***************
*** 17,21 ****
  		// Destination is always 64 bit for this type of frame.
  		uint8_t *frame = indication->msg.indication.assocIndicationFrame;
! 		NTOUH64(mhrDestAddr(frame), deviceAddr);
  	}
  	
--- 49,53 ----
  		// Destination is always 64 bit for this type of frame.
  		uint8_t *frame = indication->msg.indication.assocIndicationFrame;
! 		NTOUH64(mhrSrcAddr(frame), deviceAddr);
  	}
  	
***************
*** 45,57 ****
  		// Always 64 bit addressing and intraPAN.
  		uint8_t *frame = response->msg.response.assocResponseFrame;
! 		uint16_t panId = call PibDatabase.getPANId();
  		mhrIntraPAN(frame) = TRUE;
  		mhrDestAddrMode(frame) = 3;
- 		mhrSrcAddrMode(frame) = 3;
  		NTOUH64(deviceAddress, mhrDestAddr(frame));
! 		NTOUH16(&((uint8_t)panId), mhrDestPANId(frame));
! 		NTOUH64(aExtendedAddress, mhrSrcAddr(frame));
  		// Security not enabled by default.
  		mhrSecurityEnabled(frame) = FALSE;
  		response->inited = TRUE;
  	}
--- 77,89 ----
  		// Always 64 bit addressing and intraPAN.
  		uint8_t *frame = response->msg.response.assocResponseFrame;
! 		//uint16_t panId = call PibDatabase.getPANId();
  		mhrIntraPAN(frame) = TRUE;
  		mhrDestAddrMode(frame) = 3;
  		NTOUH64(deviceAddress, mhrDestAddr(frame));
! 		*((uint16_t*)mhrDestPANId(frame)) = macPanId;
! 		call MacAddress.setSrcLocal(frame, TRUE);
  		// Security not enabled by default.
  		mhrSecurityEnabled(frame) = FALSE;
+ 		msduCommandFrameIdent(frame) = maccommandAssocResp;
  		response->inited = TRUE;
  	}
***************
*** 62,66 ****
  		uint8_t *frame = response->msg.response.assocResponseFrame;
  		if (response->inited) {
! 			NTOUH16(&((uint8_t)assocShortAddress), msduAssocResponseShortAddr(frame));
  			return SUCCESS;
  		}
--- 94,98 ----
  		uint8_t *frame = response->msg.response.assocResponseFrame;
  		if (response->inited) {
! 			NTOUH16(((uint8_t*)&assocShortAddress), msduAssocResponseShortAddr(frame));
  			return SUCCESS;
  		}

Index: MlmeGtsIndicationM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeGtsIndicationM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmeGtsIndicationM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmeGtsIndicationM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module MlmeGtsIndicationM
  {

Index: McpsPurgeRequestConfirmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/McpsPurgeRequestConfirmM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** McpsPurgeRequestConfirmM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- McpsPurgeRequestConfirmM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module McpsPurgeRequestConfirmM
  {

Index: AddressM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/AddressM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AddressM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- AddressM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module AddressM
  {
***************
*** 36,40 ****
  	{
  		if (addr->mode) {
! 			addr->panId = panId;
  			return SUCCESS;
  		}
--- 66,70 ----
  	{
  		if (addr->mode) {
! 			NTOUH16((uint8_t*)&panId, (uint8_t*)&(addr->panId));
  			return SUCCESS;
  		}
***************
*** 45,49 ****
  	{
  		if (addr->mode) {
! 			memcpy(addr->address, address, 8);
  			return SUCCESS;
  		}
--- 75,83 ----
  	{
  		if (addr->mode) {
! 			if (addr->mode == 3) {
! 				NTOUH64(address, addr->address);
! 			} else {
! 				NTOUH16(address, addr->address);
! 			} 
  			return SUCCESS;
  		}
***************
*** 58,67 ****
  	command uint16_t IeeeAddress.getPanId( Ieee_Address addr )
  	{
! 		return addr->panId;
  	}
  	
! 	command uint8_t *IeeeAddress.getAddress( Ieee_Address addr )
  	{
! 		return addr->address;
  	}
  }
--- 92,107 ----
  	command uint16_t IeeeAddress.getPanId( Ieee_Address addr )
  	{
! 		uint16_t ret;
! 		NTOUH16((uint8_t*)&(addr->panId), (uint8_t*)&ret);
! 		return ret;
  	}
  	
! 	command void IeeeAddress.getAddress( Ieee_Address addr, uint8_t *myAddress )
  	{
! 		if (addr->mode == 3) {
! 			NTOUH64(addr->address, myAddress);
! 		} else {
! 			NTOUH16(addr->address, myAddress);
! 		}
  	}
  }

Index: MlmeCommStatusIndicationM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeCommStatusIndicationM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmeCommStatusIndicationM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmeCommStatusIndicationM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module MlmeCommStatusIndicationM
  {
***************
*** 8,11 ****
--- 38,42 ----
  	{
  		interface IeeeBufferManagement as BufferMng;
+ 		interface MacAddress;
  	}
  }
***************
*** 27,43 ****
  	{
  		uint8_t *frame = indication->msg.indication.responseFrame;
! 		addr->mode = mhrSrcAddrMode(frame);
! 		if (addr->mode) {
! 			if (!mhrIntraPAN(frame)) {
! 				NTOUH16(mhrSrcPANId(frame), &((uint8_t)addr->panId));
! 			} else {
! 				NTOUH16(mhrDestPANId(frame), &((uint8_t)addr->panId));
! 			}
! 			if (mhrSrcAddrLength(frame) == 2) {
! 				NTOUH16(mhrSrcAddr(frame), addr->address);
! 			} else {
! 				NTOUH64(mhrSrcAddr(frame), addr->address);
! 			}
! 		}
  	}
  	
--- 58,62 ----
  	{
  		uint8_t *frame = indication->msg.indication.responseFrame;
! 		call MacAddress.getSrcAddr(frame, addr);
  	}
  	
***************
*** 46,58 ****
  	{
  		uint8_t *frame = indication->msg.indication.responseFrame;
! 		addr->mode = mhrDestAddrMode(frame);
! 		if (addr->mode) {
! 			NTOUH16(mhrDestPANId(frame), &((uint8_t)addr->panId));
! 			if (mhrDestAddrLength(frame) == 2) {
! 				NTOUH16(mhrDestAddr(frame), addr->address);
! 			} else {
! 				NTOUH64(mhrDestAddr(frame), addr->address);
! 			}
! 		}
  	}
  	
--- 65,69 ----
  	{
  		uint8_t *frame = indication->msg.indication.responseFrame;
! 		call MacAddress.getDstAddr(frame, addr);
  	}
  	

Index: MlmeStartRequestConfirmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeStartRequestConfirmM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmeStartRequestConfirmM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmeStartRequestConfirmM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,31 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
  
  module MlmeStartRequestConfirmM

Index: MlmeRxEnableRequestConfirmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeRxEnableRequestConfirmM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmeRxEnableRequestConfirmM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmeRxEnableRequestConfirmM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module MlmeRxEnableRequestConfirmM
  {

Index: MlmeSyncLossIndicationM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeSyncLossIndicationM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmeSyncLossIndicationM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmeSyncLossIndicationM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module MlmeSyncLossIndicationM
  {

Index: MlmeSetRequestConfirmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeSetRequestConfirmM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MlmeSetRequestConfirmM.nc	27 Feb 2006 22:13:01 -0000	1.2
--- MlmeSetRequestConfirmM.nc	23 Aug 2006 09:54:57 -0000	1.3
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  #include <macTypes.h>
  #include <Ieee802154Adts.h>
***************
*** 30,34 ****
  	{
  		request->msg.request.pibAttribute = pibAttribute;
- 		pibAttribute->destroyable = FALSE; 
  	}
  	
--- 60,63 ----
***************
*** 40,44 ****
  	command Ieee_PibAttribute MlmeSetRequestConfirm.getPibAttribute( Mlme_SetRequestConfirm confirm )
  	{
- 		confirm->msg.confirm.pibAttribute->destroyable = TRUE;
  		return confirm->msg.confirm.pibAttribute;
  	}
--- 69,72 ----

Index: MlmeResetRequestConfirmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeResetRequestConfirmM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmeResetRequestConfirmM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmeResetRequestConfirmM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module MlmeResetRequestConfirmM
  {

Index: MlmeBeaconNotifyIndicationM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeBeaconNotifyIndicationM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MlmeBeaconNotifyIndicationM.nc	24 Feb 2006 22:18:51 -0000	1.3
--- MlmeBeaconNotifyIndicationM.nc	23 Aug 2006 09:54:57 -0000	1.4
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module MlmeBeaconNotifyIndicationM
  {

Index: MlmeOrphanIndicationResponseM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeOrphanIndicationResponseM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmeOrphanIndicationResponseM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmeOrphanIndicationResponseM.nc	23 Aug 2006 09:54:57 -0000	1.2
***************
*** 1,2 ****
--- 1,33 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
+ #include "MacPib.h"
  module MlmeOrphanIndicationResponseM
  {
***************
*** 8,12 ****
  	{
  		interface IeeeBufferManagement as BufferMng;
! 		interface PibDatabase;
  	}
  }
--- 39,43 ----
  	{
  		interface IeeeBufferManagement as BufferMng;
! 		interface Realignment;
  	}
  }
***************
*** 36,49 ****
  	                                                            uint8_t *orphanAddress )
  	{
! 		uint8_t *frame = response->msg.response.coordRealignFrame;
! 		uint16_t myPanId = call PibDatabase.getPANId();
! 		mhrDestAddrMode(frame) = 3;
! 		NTOUH16(aBcastPANId, mhrDestPANId(frame));
! 		NTOUH64(orphanAddress, mhrDestAddr(frame));
! 		mhrSrcAddrMode(frame) = 3;
! 		NTOUH16(&((uint8_t)myPanId), mhrSrcPANId(frame));
! 		NTOUH64(aExtendedAddress, mhrSrcAddr(frame));
! 		mhrSecurityEnabled(frame) = FALSE;
! 		mhrFrameType(frame) = macCommandCoordRealign;
  		response->inited = TRUE;
  	}
--- 67,71 ----
  	                                                            uint8_t *orphanAddress )
  	{
! 		call Realignment.create(response->msg.response.coordRealignFrame, FALSE, orphanAddress);
  		response->inited = TRUE;
  	}
***************
*** 54,58 ****
  		uint8_t *frame = response->msg.response.coordRealignFrame;
  		if (response->inited) {
! 			NTOUH16(&((uint8_t)shortAddress), msduCoordRealignShortAddr(frame));
  			return SUCCESS;
  		}
--- 76,80 ----
  		uint8_t *frame = response->msg.response.coordRealignFrame;
  		if (response->inited) {
! 			NTOUH16((uint8_t*)&shortAddress, msduCoordRealignShortAddr(frame));
  			return SUCCESS;
  		}

Index: PanDescriptorM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/PanDescriptorM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PanDescriptorM.nc	27 Feb 2006 22:13:01 -0000	1.2
--- PanDescriptorM.nc	23 Aug 2006 09:54:58 -0000	1.3
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  #include <endianconv.h>
  module PanDescriptorM
***************
*** 21,27 ****
  	                                             Ieee_Address coordAddr )
  	{
! 		coordAddr->mode = panDescriptor->coordAddrMode;
! 		coordAddr->panId = panDescriptor->coordPanId;
! 		memcpy(coordAddr->address, panDescriptor->coordAddress, 8);
  	}
  	
--- 51,55 ----
  	                                             Ieee_Address coordAddr )
  	{
! 		memcpy(coordAddr, panDescriptor, sizeof(ieeeAddress_t));
  	}
  	

Index: MlmeSyncRequestM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeSyncRequestM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmeSyncRequestM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmeSyncRequestM.nc	23 Aug 2006 09:54:58 -0000	1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module MlmeSyncRequestM
  {

Index: SduM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/SduM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SduM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- SduM.nc	23 Aug 2006 09:54:58 -0000	1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module SduM
  {

Index: MlmeScanRequestConfirmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeScanRequestConfirmM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MlmeScanRequestConfirmM.nc	27 Feb 2006 22:13:01 -0000	1.2
--- MlmeScanRequestConfirmM.nc	23 Aug 2006 09:54:58 -0000	1.3
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  #include <Ieee802154Adts.h>
  #include <macTypes.h>
***************
*** 33,36 ****
--- 63,70 ----
  	{
  		request->msg.request.scanType = scanType;
+ 		if (scanType == IEEE802154_OrphanScan) {
+ 			// Set default scan duration.
+ 			request->msg.request.scanDuration = 5;
+ 		}
  	}
  	                           

Index: MlmeAssociateRequestConfirmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeAssociateRequestConfirmM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MlmeAssociateRequestConfirmM.nc	29 Dec 2005 12:54:31 -0000	1.2
--- MlmeAssociateRequestConfirmM.nc	23 Aug 2006 09:54:58 -0000	1.3
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  includes macTypes;
  
***************
*** 10,13 ****
--- 40,44 ----
  	{
  		interface IeeeBufferManagement as BufferMng;
+ 		interface MacAddress;
  	}
  }
***************
*** 39,56 ****
  		
  		// Set address info.
! 		mhrDestAddrMode(frame) = coordAddr->mode;
! 		if (coordAddr->mode) {
! 			uint8_t *frameDestAddr = mhrDestAddr(frame);
! 			NTOUH16((uint8_t*)&(coordAddr->panId), mhrDestPANId(frame));
! 			//(*primitive)->msg.request.coordPANId = coordAddr->panId;
! 			if (mhrDestAddrLength(frame) == 2) {
! 				NTOUH16(coordAddr->address, frameDestAddr);
! 			} else {
! 				NTOUH64(coordAddr->address, frameDestAddr);
! 			}
! 		}
! 		mhrSrcAddrMode(frame) = 3;
! 		NTOUH16(aBcastPANId, mhrSrcPANId(frame));
! 		NTOUH64(aExtendedAddress, mhrSrcAddr(frame));
  		
  		mhrFrameType(frame) = macCommandFrame;
--- 70,75 ----
  		
  		// Set address info.
! 		call MacAddress.setDstAddr(frame, coordAddr);
! 		call MacAddress.setSrcLocal(frame, TRUE);
  		
  		mhrFrameType(frame) = macCommandFrame;

Index: MlmeDisassociateIndicationM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeDisassociateIndicationM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MlmeDisassociateIndicationM.nc	23 Dec 2005 05:05:36 -0000	1.1
--- MlmeDisassociateIndicationM.nc	23 Aug 2006 09:54:58 -0000	1.2
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module MlmeDisassociateIndicationM
  {

Index: McpsDataIndicationM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/McpsDataIndicationM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** McpsDataIndicationM.nc	30 Dec 2005 15:49:15 -0000	1.2
--- McpsDataIndicationM.nc	23 Aug 2006 09:54:58 -0000	1.3
***************
*** 1,2 ****
--- 1,32 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
  module McpsDataIndicationM
  {
***************
*** 8,11 ****
--- 38,42 ----
  	{
  		interface IeeeBufferManagement as BufferMng;
+ 		interface MacAddress;
  	}
  }
***************
*** 24,58 ****
  	{
  		uint8_t *dataFrame = indication->msg.indication.dataFrame;
! 		addr->mode = mhrSrcAddrMode(dataFrame);
! 		if (addr->mode) {
! 			// Resolve PANId.
! 			if (mhrIntraPAN(dataFrame)) {
! 				// srcPan = dstPan. Use dstPan here.
! 				NTOUH16(mhrDestPANId(dataFrame), &((uint8_t)addr->panId));
! 			} else {
! 				NTOUH16(mhrSrcPANId(dataFrame), &((uint8_t)addr->panId));
! 			}
! 			// Resolve address.
! 			if (mhrSrcAddrLength(dataFrame) == 2) {
! 				NTOUH16(mhrSrcAddr(dataFrame), addr->address);
! 			} else {
! 				NTOUH64(mhrSrcAddr(dataFrame), addr->address);
! 			}
! 		}
  	}
  	command void McpsDataIndication.getDstAddress(  Mcps_DataIndication indication, Ieee_Address addr )
  	{
  		uint8_t *dataFrame = indication->msg.indication.dataFrame;
! 		addr->mode = mhrDestAddrMode(dataFrame);
! 		if (addr->mode) {
! 			// Resolve PANId.
! 			NTOUH16(mhrDestPANId(dataFrame), &((uint8_t)addr->panId));
! 			// Resolve address.
! 			if (mhrDestAddrLength(dataFrame) == 2) {
! 				NTOUH16(mhrDestAddr(dataFrame), addr->address);
! 			} else {
! 				NTOUH64((mhrDestAddr(dataFrame)), addr->address);
! 			}
! 		}
  	}
  	
--- 55,64 ----
  	{
  		uint8_t *dataFrame = indication->msg.indication.dataFrame;
! 		call MacAddress.getSrcAddr(dataFrame, addr);
  	}
  	command void McpsDataIndication.getDstAddress(  Mcps_DataIndication indication, Ieee_Address addr )
  	{
  		uint8_t *dataFrame = indication->msg.indication.dataFrame;
! 		call MacAddress.getDstAddr(dataFrame, addr);
  	}
  	

Index: MlmeGtsRequestConfirmM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/diku/evb13192/tos/lib/ieee802154/mac/ADTModules/MlmeGtsRequestConfirmM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MlmeGtsRequestConfirmM.nc	29 Dec 2005 12:54:31 -0000	1.2
--- MlmeGtsRequestConfirmM.nc	23 Aug 2006 09:54:58 -0000	1.3
***************
*** 1,2 ****
--- 1,33 ----
+ /* Copyright (c) 2006, Jan Flora <janflora at diku.dk>
+  * 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 University of Copenhagen 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.
+  */
+ 
+ /*
+   @author Jan Flora <janflora at diku.dk>
+ */
+ 
+ #include "MacPib.h"
  module MlmeGtsRequestConfirmM
  {
***************
*** 8,12 ****
  	{
  		interface IeeeBufferManagement as BufferMng;
! 		interface PibDatabase;
  	}
  }
--- 39,43 ----
  	{
  		interface IeeeBufferManagement as BufferMng;
! 		interface MacAddress;
  	}
  }
***************
*** 17,22 ****
  	{
  		uint8_t *frame;
! 		uint16_t myPanId = call PibDatabase.getPANId();
! 		uint16_t myShortAddr = call PibDatabase.getShortAddress();
  		uint8_t frameSize = mhrFrameControlLength
  		                    + mhrSequenceNumberLength
--- 48,53 ----
  	{
  		uint8_t *frame;
! 		//uint16_t myPanId = call PibDatabase.getPANId();
! 		//uint16_t myShortAddr = call PibDatabase.getShortAddress();
  		uint8_t frameSize = mhrFrameControlLength
  		                    + mhrSequenceNumberLength
***************
*** 37,44 ****
  		mhrSecurityEnabled(frame) = FALSE;
  		mhrIntraPAN(frame) = FALSE;
  		mhrDestAddrMode(frame) = 0;
! 		mhrSrcAddrMode(frame) = 2;
! 		NTOUH16((uint8_t*)&(myPanId), mhrSrcPANId(frame));
! 		NTOUH16((uint8_t*)&(myShortAddr), mhrSrcAddr(frame));
  		mhrFrameType(frame) = macCommandFrame;
  		msduCommandFrameIdent(frame) = macCommandGtsReq;
--- 68,75 ----
  		mhrSecurityEnabled(frame) = FALSE;
  		mhrIntraPAN(frame) = FALSE;
+ 		
  		mhrDestAddrMode(frame) = 0;
! 		call MacAddress.setSrcLocal(frame, FALSE);
! 		
  		mhrFrameType(frame) = macCommandFrame;
  		msduCommandFrameIdent(frame) = macCommandGtsReq;



More information about the Tinyos-contrib-commits mailing list