1. 第一个cgywin,首先运行apps/SimpleCmd程序,用make pc 编译该程序。
输入:
export DBG=led
从而只观察led的情况。
要运行一个节点的模拟,输入:
build/pc/main.exe 1
2. 第二个cgywin,运行:
java net.tinyos.sf.SerialForwarder –comm tossim-serial
3. 第三个cgywin, 在/tools/java目录下运行:
java net.tinyos.tools.BcastInject command led_on或者
java net.tinyos.tools.BcastInject command led_off,
当前cgywin的console显示Sending payload:….,说明命令成功。
同时SerialForwarder界面显示写入了一个 packet,
同时第一个cgywin(SimpleCmd的)console会显示yellow led的变化。
命令可反复使用,每使用一次,SerialForwarder增加一个packet,相应的SimpleCmd发生一次变化。
可用的命令有:led_on, led_off, radio_louder, radio_quieter.