TinyOs开发-----TinyOs 串口通信设置

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);
    }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值