2012年5月6日

摘要: 问题引入在编译下面一段代码时,无意中发现了这样一个错误:.....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... 阅读全文
posted @ 2012-05-06 17:22 vincent Van Gogh 阅读(821) 评论(0) 推荐(0) 编辑

2012年5月5日

摘要: 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... 阅读全文
posted @ 2012-05-05 16:28 vincent Van Gogh 阅读(343) 评论(0) 推荐(0) 编辑

2012年5月4日

摘要: 由于节点的通信半径非常小(micaz大约15m),因此对于一个大型网络,节点数量可能成百上千个,因此往往数据包需要经过多跳才能到达目的地,这里我们使用ActiveMessageC组件提供的Snoop接口来完成这样的一个功能具体功能:该节点接受任意包,并且将它发送给目的节点直接贴代码了,很好懂的。ForwardAppC.nc#define NEW_PRINTF_SEMANTICS#include "printf.h"configuration ForwardAppC {}implementation { components ForwardC as App; componen 阅读全文
posted @ 2012-05-04 17:06 vincent Van Gogh 阅读(2209) 评论(1) 推荐(1) 编辑

2012年4月25日

摘要: static__inline__uint16_t_crc16_update(uint16_t__crc,uint8_t__data){uint8_t__tmp;uint16_t__ret;__asm____volatile__("eor%A0,%2""\n\t""mov%1,%A0""\n\t""swap%1""\n\t""eor%1,%A0""\n\t""mov__tmp_reg__,%1""\n\t&q 阅读全文
posted @ 2012-04-25 21:08 vincent Van Gogh 阅读(363) 评论(1) 推荐(0) 编辑

2012年4月8日

摘要: grep <string pattern> <dir name> -r | grep <string pattern>find <dir name> -name <file name> -exec grep <string pattern> {} \; 阅读全文
posted @ 2012-04-08 13:22 vincent Van Gogh 阅读(193) 评论(0) 推荐(0) 编辑

2012年4月2日

摘要: Prepare:ubuntu10.04的ftp的家目录在/srv/ftp,修改家目录:1$sudousermod-d/srv/ftpftp/etc/vsftpd.conflisten=YESpasv_enable=YESlocal_enable=YESwrite_enable=YESlocal_umask=022no_anon_password=YESanonymous_enable=YESanon_world_readable_only=YESanon_other_write_enable=YESanon_mkdir_write_enable=YESanon_upload_enable=YE 阅读全文
posted @ 2012-04-02 11:35 vincent Van Gogh 阅读(532) 评论(0) 推荐(0) 编辑

2012年4月1日

摘要: 1.下载compat-wireless stable releases:http://wireless.kernel.org/en/users/Download/stable/$tar-xvzfcompat-wireless-*.tar.gz$cdcompat-wireless-*$./scripts/driver-selectath9k_htc$make$sudomakeinstall2. 下载ar9271.fw:http://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=tree注意下载时点raw方式,你也可以将 阅读全文
posted @ 2012-04-01 22:04 vincent Van Gogh 阅读(411) 评论(0) 推荐(0) 编辑

2012年3月28日

摘要: tinyOS 2.x 的 App/tutorial/BlinkToRadio文件夹下面有demo:节点通信下面分析一下:BlinkToRadioAppC.nc#include<Timer.h>#include"BlinkToRadio.h"configurationBlinkToRadioAppC{}implementation{////////////////////////////////基本配线,连线MainC.Boot, LedsC.Leds, Timer0.TimercomponentsMainC;componentsLedsC;componentsB 阅读全文
posted @ 2012-03-28 20:59 vincent Van Gogh 阅读(1163) 评论(0) 推荐(0) 编辑

2012年3月27日

摘要: tinyos2.0的CRC16在tinyos/tos/lib/tosboot/crc.h文件中有关于ITU Standard CRC-16的实现生成多项式为:G_16(x) = x^16 + x^12 + x^5 + 11uint16_tcrcByte(uint16_tcrc,uint8_tb)2{3uint8_ti;45crc=crc^b<<8; //表示新的数据和生成的CRC可以进行合并,即先将crc左移8位再和b异或6i=8;7do8if(crc&0x8000) //如果最高位为1那么先将crc左移移位再与0x1021异或,其实这里的0x1021表示 //x^12+. 阅读全文
posted @ 2012-03-27 17:05 vincent Van Gogh 阅读(270) 评论(0) 推荐(0) 编辑

2012年3月26日

摘要: You call see this artical for quick start: http://www.madboa.com/geek/gpg-quickstart/Also, you can goto this site for future reading: http://www.gnupg.org/documentation/Private和public的钥匙是gpg加密和解密过程的主要部分,所以第一步就是创建为自己创建一对密匙.生成私钥$gpg--gen-key你需要回答一些这个命令提出的问题私钥的种类和size,这里缺省的答案已经足够好了私钥的有效期,我通常选择不会过期,呵呵.. 阅读全文
posted @ 2012-03-26 21:28 vincent Van Gogh 阅读(353) 评论(0) 推荐(0) 编辑

导航