TinyOS 关于surge和路由

本文档详细介绍了如何在TinyOS中将路由协议应用作为标准应用程序进行配置和测试。通过修改代码和配置,实现了节点间的通信,并利用TinyViz进行模拟和调试。在TinyViz中设置了无线电模型和链接,展示了多跳路由的过程,但发现路由路径不最优且无法在TinyViz中查看无线电链接。
摘要由CSDN通过智能技术生成

However, unlike Internetprotocol development, since the routing protocol application for TinyOS is justlike a standard application. We have to specify the configuration, situation,topology and so on. To achieve the goal, we must have the control of the mode,including the mote identification number, the number of messages sent for anymote, even the data information such as size, type and so on.

 

I add some new codes and put the code together totest the routing:

1.     RoutingTest.nc

 

configuration RoutingTest {

}

implementation {

 components Main, RoutingTestM, TimerC, LedsC, NoLeds, Photo, RandomLFSR,

   GenericCommPromiscuous as Comm, Bcast, MultiHopRouter as MyRouting,QueuedSend, Sounder;

 

 Main.StdControl -> RoutingTestM.StdControl;

 Main.StdControl -> Bcast.StdControl;

  Main.StdControl-> MyRouting.StdControl;

 Main.StdControl -> QueuedSend.StdControl;

 Main.StdControl -> TimerC;

 Main.StdControl -> Comm;

 

 

 RoutingTestM.Timer -> TimerC.Timer[unique("Timer")];

 RoutingTestM.Leds  -> LedsC; //NoLeds;

 RoutingTestM.Sounder -> Sounder;

 

 RoutingTestM.Bcast -> Bcast.Receive[AM_RoutingTestCMDMSG];

 Bcast.ReceiveMsg[AM_RoutingTestCMDMSG] ->Comm.ReceiveMsg[AM_RoutingTestCMDMSG];

 

 RoutingTestM.RouteControl -> MyRouting;

 RoutingTestM.Send -> MyRouting.Send[AM_RoutingTestMSG];

 MyRouting.ReceiveMsg[AM_RoutingTestMSG] ->Comm.ReceiveMsg[AM_RoutingTestMSG];

 

}

 

2.     RoutingTestM.nc

 

module RoutingTestM {

 provides {

   interface StdControl;

 }

 uses {

   interface ADC;

   interface Timer;

   interface Leds;

   interface StdControl as Sounder;

   interface Send;

   interface Receive as Bcast;

   interface RouteControl;

 }

}

 

implementation {

 

 enum {

   TIMER_GETADC_COUNT = 1,           

   TIMER_CHIRP_COUNT = 10,           

 };

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值