📄 beacmanage.nc
字号:
/* * BeacManage.nc * David Moore <dcm@csail.mit.edu> */interface BeacManage { /* Stores a new distance as measured by us to a neighbor * specified by its ID. The distance should be in timer ticks and * is converted to microseconds internally. */ command result_t NewMeasurement(uint8_t * id, uint16_t d, uint16_t timestamp, uint8_t flags); /* Fills a packet of data with distances measured locally suitable for * being relayed to neighboring nodes. */ command uint8_t GetMeasurements(uint8_t * buf, uint16_t len); /* Given a new relay packet from a neighbor, incorporate the * contained information into our database (such as distances * to that neighbor's neighbors) */ command result_t NewRelay(uint8_t * id, uint8_t * buf, uint8_t len, uint16_t timediff); /* Specifies our local ID. This is necessary so we recognize distances to * ourselves measured by other nodes. */ command result_t SetId(uint8_t * id); /* Stores flags about ourselves, such as if we are moving or not. */ command result_t SetFlags(uint8_t flags); /* Print the entire contents of the distance table to the serial port * if id is NULL. Otherwise, print only the distances measured by that * node. */ command result_t DebugPrint(uint8_t * id); /* Converting an ID to an integer index used internally. */ command uint8_t FindId(uint8_t * id); /* Print useful information about all nodes we are aware of. */ command result_t ListNodes(); /* This function is called by the localization code in order to * copy recorded distance measurements into a form that is * useful for localization. Specifically, we discard nodes for * which we have no distance information or no relayed information. * We also average distances since we have two measurements for * each pair. */ command int RefineDistances(uint8_t o[MAX_NEIGHBORS+1], struct NodeInfo ** info, uint16_t d_norm[MAX_NEIGHBORS+1][MAX_NEIGHBORS+1]); /* Set the time at which we will perform the next static localization */ command result_t SetLocTime(uint16_t t); /* Looks through the list of beacons from mobile nodes and * localizes any nodes whose beacons occured long enough ago * to allow time for measurements to propagate from neighboring * nodes. */ command result_t LocalizeMovingNodes();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -