[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/tkn154/TestData/device Makefile, 1.1, 1.2 TestDataAppC.nc, 1.1, 1.2 TestDeviceSenderC.nc, 1.1, 1.2
Jan-Hinrich Hauer
janhauer at users.sourceforge.net
Wed Mar 4 10:32:02 PST 2009
Update of /cvsroot/tinyos/tinyos-2.x/apps/tests/tkn154/TestData/device
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17605/apps/tests/tkn154/TestData/device
Modified Files:
Makefile TestDataAppC.nc TestDeviceSenderC.nc
Log Message:
- re-designed the radio driver interfaces, restructured/improved the CC2420 radio driver
- split the main MAC configuration (was TKN154P.nc) in two: one for beacon-enabled mode the other for nonbeacon-enabled mode (this decision has to be made at compile time now)
- added (serial) debugging functions (compile with "TKN154_DEBUG=1 make telosb" and use the java PrintfClient, see tinyos-2.x/apps/tests/TestPrintf/README.txt)
- improved readability, added comments
Index: Makefile
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/tkn154/TestData/device/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Makefile 21 Jul 2008 15:18:16 -0000 1.1
--- Makefile 4 Mar 2009 18:31:00 -0000 1.2
***************
*** 1,3 ****
--- 1,4 ----
COMPONENT=TestDataAppC
+ PFLAGS += -DIEEE154_BEACON_TX_DISABLED
CFLAGS += -I$(shell pwd)/..
include ../../Makefile.include
Index: TestDataAppC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/tkn154/TestData/device/TestDataAppC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestDataAppC.nc 21 Jul 2008 15:18:16 -0000 1.1
--- TestDataAppC.nc 4 Mar 2009 18:31:00 -0000 1.2
***************
*** 33,56 ****
* ========================================================================
*/
!
configuration TestDataAppC
{
} implementation {
! components MainC, LedsC, Ieee802154MacC;
components TestDeviceSenderC as App;
! App.MLME_SCAN -> Ieee802154MacC;
! App.MLME_SYNC -> Ieee802154MacC;
! App.MLME_BEACON_NOTIFY -> Ieee802154MacC;
! App.MLME_SYNC_LOSS -> Ieee802154MacC;
! App.MCPS_DATA -> Ieee802154MacC;
! App.Frame -> Ieee802154MacC;
! App.BeaconFrame -> Ieee802154MacC;
! App.Packet -> Ieee802154MacC;
MainC.Boot <- App;
App.Leds -> LedsC;
! App.MLME_RESET -> Ieee802154MacC;
! App.MLME_SET -> Ieee802154MacC;
! App.MLME_GET -> Ieee802154MacC;
}
--- 33,56 ----
* ========================================================================
*/
! #include "app_profile.h"
configuration TestDataAppC
{
} implementation {
! components MainC, LedsC, Ieee802154BeaconEnabledC as MAC;
components TestDeviceSenderC as App;
! App.MLME_SCAN -> MAC;
! App.MLME_SYNC -> MAC;
! App.MLME_BEACON_NOTIFY -> MAC;
! App.MLME_SYNC_LOSS -> MAC;
! App.MCPS_DATA -> MAC;
! App.Frame -> MAC;
! App.BeaconFrame -> MAC;
! App.Packet -> MAC;
MainC.Boot <- App;
App.Leds -> LedsC;
! App.MLME_RESET -> MAC;
! App.MLME_SET -> MAC;
! App.MLME_GET -> MAC;
}
Index: TestDeviceSenderC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/tkn154/TestData/device/TestDeviceSenderC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestDeviceSenderC.nc 21 Jul 2008 15:18:16 -0000 1.1
--- TestDeviceSenderC.nc 4 Mar 2009 18:31:00 -0000 1.2
***************
*** 74,78 ****
if (m_payloadLen <= call Packet.maxPayloadLength()){
memcpy(payloadRegion, payload, m_payloadLen);
! call MLME_RESET.request(TRUE, BEACON_ENABLED_PAN);
}
}
--- 74,78 ----
if (m_payloadLen <= call Packet.maxPayloadLength()){
memcpy(payloadRegion, payload, m_payloadLen);
! call MLME_RESET.request(TRUE);
}
}
***************
*** 111,114 ****
--- 111,115 ----
);
}
+ bool m_ready;
event message_t* MLME_BEACON_NOTIFY.indication (message_t* frame)
***************
*** 118,121 ****
--- 119,124 ----
ieee154_macBSN_t beaconSequenceNumber = call BeaconFrame.getBSN(frame);
+ if (m_ready)
+ post packetSendTask();
if (beaconSequenceNumber & 1)
call Leds.led2On();
***************
*** 159,162 ****
--- 162,166 ----
);
post packetSendTask();
+ m_ready = TRUE;
} else
startApp();
***************
*** 170,178 ****
m_payloadLen, // payloadLength,
0, // msduHandle,
! TX_OPTIONS_ACK // TxOptions,
) == IEEE154_SUCCESS)
m_sending = TRUE;
}
event void MCPS_DATA.confirm (
message_t *msg,
--- 174,183 ----
m_payloadLen, // payloadLength,
0, // msduHandle,
! TX_OPTIONS_ACK // TxOptions,
) == IEEE154_SUCCESS)
m_sending = TRUE;
}
+ uint8_t m_useLeds = TRUE;
event void MCPS_DATA.confirm (
message_t *msg,
***************
*** 185,189 ****
if (status == IEEE154_SUCCESS && m_ledCount++ == 20){
m_ledCount = 0;
! call Leds.led1Toggle();
}
post packetSendTask();
--- 190,195 ----
if (status == IEEE154_SUCCESS && m_ledCount++ == 20){
m_ledCount = 0;
! if (m_useLeds)
! call Leds.led1Toggle();
}
post packetSendTask();
***************
*** 197,201 ****
ieee154_security_t *security)
{
! startApp();
}
--- 203,209 ----
ieee154_security_t *security)
{
! m_useLeds = FALSE;
! call Leds.led1Off();
! //startApp();
}
More information about the Tinyos-2-commits
mailing list