From: janhauer Date: Thu, 29 Oct 2009 17:42:55 +0000 (+0000) Subject: Updated all READMEs with an extra section that describes how a successful test is... X-Git-Tag: rc_6_tinyos_2_1_1~160 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=80fceacc55bd95a4ed6f0ff869c72738953f8b4a Updated all READMEs with an extra section that describes how a successful test is identified. Moved the TestPromiscuous application (it now uses the nonbeacon-enabled mode). --- diff --git a/apps/tests/tkn154/beacon-enabled/TestAssociate/README.txt b/apps/tests/tkn154/beacon-enabled/TestAssociate/README.txt index 94ad58ab..83cb0e68 100644 --- a/apps/tests/tkn154/beacon-enabled/TestAssociate/README.txt +++ b/apps/tests/tkn154/beacon-enabled/TestAssociate/README.txt @@ -4,25 +4,21 @@ Author/Contact: tinyos-help@millennium.berkeley.edu Description: In this application one node takes the role of a PAN coordinator in a -beacon-enabled 802.15.4 PAN; it transmits periodic beacons and waits for +beacon-enabled 802.15.4 PAN, it transmits periodic beacons and waits for devices to request association to its PAN. Whenever a device tries to -associate, the PAN coordinator allows association and assigns to the device a -unique short address (starting from zero, incremented for every device -requesting association). - -A second node acts as a device; it first scans the pre-defined channel for -beacons from the coordinator and once it finds a beacon it tries to associate -to the PAN and synchronize to and track all future beacons. A short time after -association the device then disassociates from the PAN. - -The third LED (Telos: blue) is toggled whenever the coordinator has transmitted -a beacon or whenever a device has received a beacon. On the coordinator the -second LED (Telos: green) is switched on whenever an association request was -successful and it is switched off, whenever a disassociation request was -received. On a device the second LED is switched on while the device is -associated to the PAN, i.e. it is switched off after disassociation. The first -LED (Telos: red) is used for debugging, it denotes an error in the protocol -stack and should never be on. +associate, the PAN coordinator accepts the association and assigns to the +device a unique short address (starting from zero, incremented for every device +new association). A second node acts as a device, it first scans the +pre-defined channel for beacons from the coordinator and once it finds a beacon +it tries to associate to the PAN and synchronize to and track all future +beacons. A short time after association the device then disassociates from the +PAN. + +Criteria for a successful test: + +Assuming one coordinator and one device has been installed, both should +simultaneously toggle (only) the second LED, about once every 5 seconds. + Tools: NONE diff --git a/apps/tests/tkn154/beacon-enabled/TestData/README.txt b/apps/tests/tkn154/beacon-enabled/TestData/README.txt index b767541b..50818c82 100644 --- a/apps/tests/tkn154/beacon-enabled/TestData/README.txt +++ b/apps/tests/tkn154/beacon-enabled/TestData/README.txt @@ -4,19 +4,19 @@ Author/Contact: tinyos-help@millennium.berkeley.edu Description: In this application one node takes the role of a PAN coordinator in a -beacon-enabled 802.15.4 PAN; it transmits periodic beacons and waits for -incoming DATA frames. A second node acts as a device; it first scans the +beacon-enabled 802.15.4 PAN, it transmits periodic beacons and waits for +incoming DATA frames. A second node acts as a device, it first scans the pre-defined channel for beacons from the coordinator and once it finds a beacon it tries to synchronize to and track all future beacons. It then starts to transmit DATA frames to the coordinator as fast as possible (direct transmission in the contention access period, CAP). -The third LED (Telos: blue) is toggled whenever the coordinator has transmitted -a beacon or whenever a device has received a beacon. On the coordinator the -second LED (Telos: green) is toggled for every 20 received DATA frames. On a -device the second LED is toggled for every 20 transmitted (and acknowledged) -DATA frames. The first LED (Telos: red) is used for debugging, it denotes an -error in the protocol stack and should never be on. +Criteria for a successful test: + +Assuming a clear channel and one coordinator and one device has been installed, +both should toggle (only) the second LED fast, about 5 times per second. They +don't have to toggle the LED simultaneously. + Tools: NONE diff --git a/apps/tests/tkn154/beacon-enabled/TestIndirect/README.txt b/apps/tests/tkn154/beacon-enabled/TestIndirect/README.txt index e25ab917..68122e6b 100644 --- a/apps/tests/tkn154/beacon-enabled/TestIndirect/README.txt +++ b/apps/tests/tkn154/beacon-enabled/TestIndirect/README.txt @@ -4,7 +4,7 @@ Author/Contact: tinyos-help@millennium.berkeley.edu Description: In this application one node takes the role of a PAN coordinator in a -beacon-enabled 802.15.4 PAN; it transmits periodic beacons and additionally in +beacon-enabled 802.15.4 PAN, it transmits periodic beacons and additionally in every beacon interval it tries to transmit one DATA frame to a device using indirect tranmission. A second node that takes the role of a device first scans the pre-defined channel for beacons from the coordinator and once it finds a @@ -12,12 +12,11 @@ beacon it tries to synchronize to and track all future beacons. Whenever the coordinator has data to send (indicated in the beacon), the device extracts the DATA frame from the coordinator. -The third LED (Telos: blue) is toggled whenever the coordinator has transmitted -a beacon, it is not used on the device. On the coordinator the second LED -(Telos: green) is toggled for every transmitted DATA frames. On a device the -second LED is toggled for every received DATA frame. The first LED (Telos: red) -is used for debugging, it denotes an error in the protocol stack and should -never be on. +Criteria for a successful test: + +Both nodes should simultaneously toggle (only) the second LED, about once every +half second. + Tools: NONE diff --git a/apps/tests/tkn154/beacon-enabled/TestPromiscuous/Makefile b/apps/tests/tkn154/beacon-enabled/TestPromiscuous/Makefile deleted file mode 100644 index 4feced10..00000000 --- a/apps/tests/tkn154/beacon-enabled/TestPromiscuous/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -COMPONENT=TestPromiscuousAppC -PFLAGS += -DPRINTF_BUFFER_SIZE=1000 -CFLAGS += -I$(TOSDIR)/lib/printf -CFLAGS += -DIEEE154_SCAN_DISABLED -DIEEE154_BEACON_SYNC_DISABLED -DIEEE154_BEACON_TX_DISABLED -DIEEE154_RXENABLE_DISABLED -DIEEE154_ASSOCIATION_DISABLED -DIEEE154_DISASSOCIATION_DISABLED -DIEEE154_COORD_REALIGNMENT_DISABLED -DIEEE154_COORD_BROADCAST_DISABLED -include ../../Makefile.include diff --git a/apps/tests/tkn154/beacon-enabled/TestPromiscuous/README.txt b/apps/tests/tkn154/beacon-enabled/TestPromiscuous/README.txt deleted file mode 100644 index 777d18e1..00000000 --- a/apps/tests/tkn154/beacon-enabled/TestPromiscuous/README.txt +++ /dev/null @@ -1,32 +0,0 @@ -README for TestPromiscuous -Author/Contact: tinyos-help@millennium.berkeley.edu - -Description: - -In this application the node enables promiscuous mode, i.e. its radio is -switched to receive mode and all incoming frames that pass the CRC check are -signalled to the upper layer. The application uses the TinyOS printf library -(tos/lib/printf) to output information on the MAC header fields and payload for -every received frame over the serial port. The second (TelosB: green) LED is -toggled whenever a frame is received. - -Tools: The printf java client in $TOSDIR/../apps/tests/TestPrintf - -Usage: - -Install the application on a node - - $ make install - -Start the printf client, e.g. - - $ java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSBXXX: - -(http://docs.tinyos.net/ has a section on how to use the TinyOS printf library) - -Known bugs/limitations: - -- The timestamps for ACKs are incorrect - -$Id$ - diff --git a/apps/tests/tkn154/beacon-enabled/TestPromiscuous/TestPromiscuousAppC.nc b/apps/tests/tkn154/beacon-enabled/TestPromiscuous/TestPromiscuousAppC.nc deleted file mode 100644 index c771d29d..00000000 --- a/apps/tests/tkn154/beacon-enabled/TestPromiscuous/TestPromiscuousAppC.nc +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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$ - * $Date$ - * @author: Jan Hauer - * ======================================================================== - */ - -configuration TestPromiscuousAppC -{ -} implementation { - components MainC, TestPromiscuousC as App, LedsC, - Ieee802154BeaconEnabledC as MAC; - - MainC.Boot <- App; - App.Leds -> LedsC; - - App.MLME_RESET -> MAC; - App.MLME_SET -> MAC; - App.MLME_GET -> MAC; - App.MCPS_DATA -> MAC; - App.Frame -> MAC; - App.BeaconFrame -> MAC; - App.PromiscuousMode -> MAC; -} diff --git a/apps/tests/tkn154/beacon-enabled/TestPromiscuous/TestPromiscuousC.nc b/apps/tests/tkn154/beacon-enabled/TestPromiscuous/TestPromiscuousC.nc deleted file mode 100644 index 8ffaa751..00000000 --- a/apps/tests/tkn154/beacon-enabled/TestPromiscuous/TestPromiscuousC.nc +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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$ - * $Date$ - * @author: Jan Hauer - * ======================================================================== - */ -#include "TKN154.h" -module TestPromiscuousC -{ - uses { - interface Boot; - interface MLME_RESET; - interface MLME_SET; - interface MLME_GET; - interface MCPS_DATA; - interface Leds; - interface IEEE154Frame as Frame; - interface IEEE154BeaconFrame as BeaconFrame; - interface SplitControl as PromiscuousMode; - } -} implementation { - - const char *m_frametype[] = {"Beacon", "Data","Acknowledgement","MAC command", "Unknown"}; - const char *m_cmdframetype[] = {"unknown command", "Association request","Association response", - "Disassociation notification","Data request","PAN ID conflict notification", - "Orphan notification", "Beacon request", "Coordinator realignment", "GTS request"}; - - enum { - RADIO_CHANNEL = 26, - }; - - event void Boot.booted() { - call MLME_RESET.request(TRUE); - } - - event void MLME_RESET.confirm(ieee154_status_t status) - { - call MLME_SET.phyCurrentChannel(RADIO_CHANNEL); - call PromiscuousMode.start(); - } - - event message_t* MCPS_DATA.indication (message_t* frame) - { - uint8_t i; - uint8_t *payload = call Frame.getPayload(frame); - uint8_t payloadLen = call Frame.getPayloadLength(frame); - uint8_t *header = call Frame.getHeader(frame); - uint8_t headerLen = call Frame.getHeaderLength(frame); - uint8_t SrcAddrMode, DstAddrMode; - uint8_t frameType, cmdFrameType; - ieee154_address_t SrcAddress, DstAddress; - uint16_t SrcPANId=0, DstPANId=0; - - if (call Frame.hasStandardCompliantHeader(frame)){ - frameType = call Frame.getFrameType(frame); - if (frameType > FRAMETYPE_CMD) - frameType = 4; - call Frame.getSrcPANId(frame, &SrcPANId); - call Frame.getDstPANId(frame, &DstPANId); - call Frame.getSrcAddr(frame, &SrcAddress); - call Frame.getDstAddr(frame, &DstAddress); - SrcAddrMode = call Frame.getSrcAddrMode(frame); - DstAddrMode = call Frame.getDstAddrMode(frame); - - printf("\n"); - printf("Frametype: %s", m_frametype[frameType]); - if (frameType == FRAMETYPE_CMD){ - cmdFrameType = payload[0]; - if (cmdFrameType > 9) - cmdFrameType = 0; - printf(" (%s)", m_cmdframetype[cmdFrameType]); - } - printf("\n"); - printf("SrcAddrMode: %d\n", SrcAddrMode); - printf("SrcAddr: "); - if (SrcAddrMode == ADDR_MODE_SHORT_ADDRESS){ - printf("0x%02X\n", SrcAddress.shortAddress); - printf("SrcPANId: 0x%02X\n", SrcPANId); - } else if (SrcAddrMode == ADDR_MODE_EXTENDED_ADDRESS){ - for (i=0; i<8; i++) - printf("0x%02X ", ((uint8_t*) &(SrcAddress.extendedAddress))[i]); - printf("\n"); - printf("SrcPANId: 0x%02X\n", SrcPANId); - } else printf("\n"); - printf("DstAddrMode: %d\n", DstAddrMode); - printf("DstAddr: "); - if ( DstAddrMode == ADDR_MODE_SHORT_ADDRESS){ - printf("0x%02X\n", DstAddress.shortAddress); - printf("DestPANId: 0x%02X\n", DstPANId); - } else if ( DstAddrMode == ADDR_MODE_EXTENDED_ADDRESS) { - for (i=0; i<8; i++) - printf("0x%02X ", ((uint8_t*) &(DstAddress.extendedAddress))[i]); - printf("\n"); - printf("DestPANId: 0x%02X\n", DstPANId); - } else printf("\n"); - - printf("DSN: %d\n", call Frame.getDSN(frame)); - printf("MHRLen: %d\n", headerLen); - printf("MHR: "); - for (i=0; i install + +Start the printf client, e.g. + + $ java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSBXXX: + +(http://docs.tinyos.net/ has a section on how to use the TinyOS printf library) + +Known bugs/limitations: + +- The timestamps for ACKs are incorrect + +$Id$ + diff --git a/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/TestPromiscuousAppC.nc b/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/TestPromiscuousAppC.nc new file mode 100644 index 00000000..fd752f0d --- /dev/null +++ b/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/TestPromiscuousAppC.nc @@ -0,0 +1,52 @@ +/* + * 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$ + * $Date$ + * @author: Jan Hauer + * ======================================================================== + */ + +configuration TestPromiscuousAppC +{ +} implementation { + components MainC, TestPromiscuousC as App, LedsC, + Ieee802154NonBeaconEnabledC as MAC; + + MainC.Boot <- App; + App.Leds -> LedsC; + + App.MLME_RESET -> MAC; + App.MLME_SET -> MAC; + App.MLME_GET -> MAC; + App.MCPS_DATA -> MAC; + App.Frame -> MAC; + App.BeaconFrame -> MAC; + App.PromiscuousMode -> MAC; +} diff --git a/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/TestPromiscuousC.nc b/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/TestPromiscuousC.nc new file mode 100644 index 00000000..8ffaa751 --- /dev/null +++ b/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/TestPromiscuousC.nc @@ -0,0 +1,158 @@ +/* + * 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$ + * $Date$ + * @author: Jan Hauer + * ======================================================================== + */ +#include "TKN154.h" +module TestPromiscuousC +{ + uses { + interface Boot; + interface MLME_RESET; + interface MLME_SET; + interface MLME_GET; + interface MCPS_DATA; + interface Leds; + interface IEEE154Frame as Frame; + interface IEEE154BeaconFrame as BeaconFrame; + interface SplitControl as PromiscuousMode; + } +} implementation { + + const char *m_frametype[] = {"Beacon", "Data","Acknowledgement","MAC command", "Unknown"}; + const char *m_cmdframetype[] = {"unknown command", "Association request","Association response", + "Disassociation notification","Data request","PAN ID conflict notification", + "Orphan notification", "Beacon request", "Coordinator realignment", "GTS request"}; + + enum { + RADIO_CHANNEL = 26, + }; + + event void Boot.booted() { + call MLME_RESET.request(TRUE); + } + + event void MLME_RESET.confirm(ieee154_status_t status) + { + call MLME_SET.phyCurrentChannel(RADIO_CHANNEL); + call PromiscuousMode.start(); + } + + event message_t* MCPS_DATA.indication (message_t* frame) + { + uint8_t i; + uint8_t *payload = call Frame.getPayload(frame); + uint8_t payloadLen = call Frame.getPayloadLength(frame); + uint8_t *header = call Frame.getHeader(frame); + uint8_t headerLen = call Frame.getHeaderLength(frame); + uint8_t SrcAddrMode, DstAddrMode; + uint8_t frameType, cmdFrameType; + ieee154_address_t SrcAddress, DstAddress; + uint16_t SrcPANId=0, DstPANId=0; + + if (call Frame.hasStandardCompliantHeader(frame)){ + frameType = call Frame.getFrameType(frame); + if (frameType > FRAMETYPE_CMD) + frameType = 4; + call Frame.getSrcPANId(frame, &SrcPANId); + call Frame.getDstPANId(frame, &DstPANId); + call Frame.getSrcAddr(frame, &SrcAddress); + call Frame.getDstAddr(frame, &DstAddress); + SrcAddrMode = call Frame.getSrcAddrMode(frame); + DstAddrMode = call Frame.getDstAddrMode(frame); + + printf("\n"); + printf("Frametype: %s", m_frametype[frameType]); + if (frameType == FRAMETYPE_CMD){ + cmdFrameType = payload[0]; + if (cmdFrameType > 9) + cmdFrameType = 0; + printf(" (%s)", m_cmdframetype[cmdFrameType]); + } + printf("\n"); + printf("SrcAddrMode: %d\n", SrcAddrMode); + printf("SrcAddr: "); + if (SrcAddrMode == ADDR_MODE_SHORT_ADDRESS){ + printf("0x%02X\n", SrcAddress.shortAddress); + printf("SrcPANId: 0x%02X\n", SrcPANId); + } else if (SrcAddrMode == ADDR_MODE_EXTENDED_ADDRESS){ + for (i=0; i<8; i++) + printf("0x%02X ", ((uint8_t*) &(SrcAddress.extendedAddress))[i]); + printf("\n"); + printf("SrcPANId: 0x%02X\n", SrcPANId); + } else printf("\n"); + printf("DstAddrMode: %d\n", DstAddrMode); + printf("DstAddr: "); + if ( DstAddrMode == ADDR_MODE_SHORT_ADDRESS){ + printf("0x%02X\n", DstAddress.shortAddress); + printf("DestPANId: 0x%02X\n", DstPANId); + } else if ( DstAddrMode == ADDR_MODE_EXTENDED_ADDRESS) { + for (i=0; i<8; i++) + printf("0x%02X ", ((uint8_t*) &(DstAddress.extendedAddress))[i]); + printf("\n"); + printf("DestPANId: 0x%02X\n", DstPANId); + } else printf("\n"); + + printf("DSN: %d\n", call Frame.getDSN(frame)); + printf("MHRLen: %d\n", headerLen); + printf("MHR: "); + for (i=0; i