Hi Kenneth,

I am also using T2's serial-forwarder for T1 motes. There are several 
application in my company that's still using old T1.1.15. 

As far as I know, you just need to modify the Serial.h to match T1 
packet. 
-----------------------------
diff -u3 /opt/tinyos-2.x/support/sdk/c/serialprotocol.h ./serialprotocol.h
--- /opt/tinyos-2.x/support/sdk/c/serialprotocol.h  2007-08-23 
18:03:35.000000000 +0800
+++ ./serialprotocol.h  2007-08-24 15:02:51.000000000 +0800
@@ -4,15 +4,24 @@
  * /opt/tinyos-2.x/tos/lib/serial/Serial.h.
  */

+// Change it into TOS1.1.15
 enum {
     SERIAL_HDLC_CTLESC_BYTE = 125,
     SERIAL_TOS_SERIAL_802_15_4_ID = 2,
-    SERIAL_SERIAL_PROTO_ACK = 67,
+
+    //SERIAL_SERIAL_PROTO_ACK = 67,
+    SERIAL_SERIAL_PROTO_ACK = 64,
+
     SERIAL_TOS_SERIAL_CC1000_ID = 1,
-    SERIAL_SERIAL_PROTO_PACKET_NOACK = 69,
+
+    //SERIAL_SERIAL_PROTO_PACKET_NOACK = 69,
+    SERIAL_SERIAL_PROTO_PACKET_NOACK = 66,
+
     SERIAL_SERIAL_PROTO_PACKET_UNKNOWN = 255,
     SERIAL_HDLC_FLAG_BYTE = 126,
     SERIAL_TOS_SERIAL_ACTIVE_MESSAGE_ID = 0,
     SERIAL_TOS_SERIAL_UNKNOWN_ID = 255,
-    SERIAL_SERIAL_PROTO_PACKET_ACK = 68
+
+    //SERIAL_SERIAL_PROTO_PACKET_ACK = 68
+    SERIAL_SERIAL_PROTO_PACKET_ACK = 65
 };
diff -u3 /opt/tinyos-2.x/support/sdk/c/serialsource.c ./serialsource.c
--- /opt/tinyos-2.x/support/sdk/c/serialsource.c        2006-07-13 
00:59:53.000000000 +0800
+++ ./serialsource.c    2007-08-24 14:55:48.000000000 +0800
@@ -826,7 +826,7 @@
 #define throws ;
 #define Exception
 #define package
-#include "../java/net/tinyos/packet/BaudRate.java"
+#include "BaudRate.java"

   return args.rate;
 }
-----------------------------

The step to compile this was :
1) Configure the sf using T2 environment (because Serial.h is generated 
through autoconf)
2) Apply the patch
3) Copy BaudRate.java from T2/java/net/tinyos/packet/BaudRate.java
to your dir
4) Make...and done

The important thing is that you shouldn't run the autoconf (./configure)
once you have modified the Serial.h (The autoconf will override the patch).

Or, you can just ask me for the modified code =) It's still in BSD license 
anyway.

Regards,

-daniel

-------- Original Message --------
> From: "Chan kenniel" <[EMAIL PROTECTED]>
> Sent: Tuesday, September 25, 2007 1:55 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Tinyos-help] C and nesC problems
> 
> Thanks Daniel, but I am wondering whether the mechanism of C for sending
> packets to serial forwarder in tinyos-2.x is compatible with that in
> tinyos-1.x? since mine is tinyos-1.x right now, don't have such a directory
> u mentioned. Really thanks for your time.
> 
> Best regards,
> Kenneth




_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to