From 9a76bacaa58ef34041ccc024d211360e0bca2866 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 17 Sep 2008 12:09:03 +0000 Subject: [PATCH] initialize from int[] (mspsim standard) --- .../sics/cooja/mspmote/interfaces/CC2420RadioPacket.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/CC2420RadioPacket.java b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/CC2420RadioPacket.java index 0385b9d28..787ad57a2 100644 --- a/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/CC2420RadioPacket.java +++ b/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/CC2420RadioPacket.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: CC2420RadioPacket.java,v 1.1 2008/03/18 13:34:29 fros4943 Exp $ + * $Id: CC2420RadioPacket.java,v 1.2 2008/09/17 12:09:03 fros4943 Exp $ */ package se.sics.cooja.mspmote.interfaces; @@ -39,6 +39,13 @@ public class CC2420RadioPacket implements RadioPacket { this.data = data; } + public CC2420RadioPacket(int[] intData) { + this.data = new byte[intData.length]; + for (int i=0; i < intData.length; i++) { + this.data[i] = (byte) intData[i]; + } + } + public byte[] getPacketData() { return data; }