摘要:问题引入在编译下面一段代码时,无意中发现了这样一个错误:.....typedef nx_struct test_msg { nx_uint8_t data[];} test_msg_t.....错误:van9ogh@WSN:Git$ gcc test.c test.c:4: error: flexible array member in otherwise empty struct但如果换成这样:.....typedef nx_struct test_msg { nx_uint8_t counter; nx_uint8_t data[];} te...
阅读全文
摘要:Avr系列烧写程序,使用的工具为uisp,这个可以在每次使用make micaz install mib520,/dev/ttyUSB0看到,输出如下:cp build/micaz/main.srec build/micaz/main.srec.out installing micaz binary using mib510uisp -dprog=mib510 -dserial=/dev/ttyUSB0 --wr_fuse_h=0xd9 -dpart=ATmega128 --wr_fuse_e=ff --erase --upload if=build/micaz/main.srec...
阅读全文
摘要:由于节点的通信半径非常小(micaz大约15m),因此对于一个大型网络,节点数量可能成百上千个,因此往往数据包需要经过多跳才能到达目的地,这里我们使用ActiveMessageC组件提供的Snoop接口来完成这样的一个功能具体功能:该节点接受任意包,并且将它发送给目的节点直接贴代码了,很好懂的。ForwardAppC.nc#define NEW_PRINTF_SEMANTICS#include "printf.h"configuration ForwardAppC {}implementation { components ForwardC as App; componen
阅读全文