1、运行java 程序可以测试串口通信。 例如TestSerial
命令:java net.tinyos.tool.Listen -commserial@<prot>:<speed>
PORT 取决于平台,如果是Windows/Cygwin平台,则使用 COMN,而如果是Linux/Unix平台,则使用/dev/ttySN。输出时16进制的数据
例如ubuntu下 shimmer平台:
java net.tinyos.tools.Listen -comm serial@/dev/ttyUSB0:115200
java<程序名> -commserial@/dev/ttyUSB1:115200 输出时消息包
2、MIG消息生成工具
命令:javanet.tinyos.tools.MsgReader BlinkToRadioMsg –comm +端口
serialforward工具
命令:java net.tinyos.sf.Serialforward –comm srial@<port>:<speed>
例如:java net.tinyos.sf.Serialforward –comm srial/dev/ttyUSB1:115200
不同平台speed说明:
这些特定平台速率的映射关系的定义在:support/sdk/java/net/TinyOS/packet/BaudRate.java
package net.tinyos.packet;
class BaudRate {
static void init() throws Exception {
/* The Platform.x argument is there for when this code is#include'd
into C */
Platform.add(Platform.x,"mica", 19200);
Platform.add(Platform.x,"mica2", 57600);
Platform.add(Platform.x, "mica2dot", 19200);
Platform.add(Platform.x,"telos", 115200);
Platform.add(Platform.x,"telosb", 115200);
Platform.add(Platform.x,"tinynode", 115200);
Platform.add(Platform.x,"tmote", 115200);
Platform.add(Platform.x,"micaz", 57600);
Platform.add(Platform.x,"eyesIFX", 57600);
Platform.add(Platform.x, "intelmote2", 115200);
Platform.add(Platform.x,"iris", 57600);
Platform.add(Platform.x,"shimmer", 115200);
}
}