📄 am_route.comp
字号:
/* tab:4 * * * "Copyright (c) 2000 and The Regents of the University * of California. All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice and the following * two paragraphs appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * * Authors: Jason Hill * * This component was our first attempt at ad-hoc networking. It contains two types * of messges. One that is for determining the routing topology, and one that is for * propagating data that is collected up to the base station. * *BASE_STATION.... If you are compiling the code to be a base station, you must define *the BASE_STATION macro (-DBASE_STATOIN). This will cause the application to change its *behavior. Instead of waiting for route updates, the base stations generates them. */TOS_MODULE AM_ROUTE;ACCEPTS{ char AM_ROUTE_INIT(void); char AM_ROUTE_START(void); char ROUTE_SEND_PACKET(char* data);};HANDLES{ TOS_MsgPtr ROUTE_UPDATE(TOS_MsgPtr data); TOS_MsgPtr DATA_MSG(TOS_MsgPtr data); void AM_ROUTE_SUB_CLOCK(void); char ROUTE_SEND_DONE(TOS_MsgPtr data);};USES{ char ROUTE_SUB_SEND_MSG(short addr,char type, TOS_MsgPtr data); char ROUTE_SUB_POWER(char mode); char ROUTE_SUB_INIT(); char ROUTE_SUB_CLOCK_INIT(char interval, char scale); char ROUTE_DATA_INIT(); char ROUTE_SUB_READ(); char PHOTO_PWR(char mode); char ROUTE_LED1_OFF(); char ROUTE_LED1_ON(); char ROUTE_LED1_TOGGLE(); char ROUTE_LED2_OFF(); char ROUTE_LED2_ON(); char ROUTE_LED2_TOGGLE(); char ROUTE_LED3_OFF(); char ROUTE_LED3_ON(); char ROUTE_LED3_TOGGLE(); char ROUTE_SUB_LED_INIT();};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -