关于berkely motes的SerialForwarder工具的一个问题
12-10
AM.h中
typedef struct TOS_Msg
{
/* The following fields are transmitted/received on the radio. */
uint16_t addr;
uint8_t type;
uint8_t group;
uint8_t length;
int8_t data[TOSH_DATA_LENGTH];
uint16_t crc;
/* The following fields are not actually transmitted or received
* on the radio! They are used for internal accounting only.
* The reason they are in this structure is that the AM interface
* requires them to be part of the TOS_Msg that is passed to
* send/receive operations.
*/
uint16_t strength;
uint8_t ack;
uint16_t time;
uint8_t sendSecurityMode;
uint8_t receiveSecurityMode;
} TOS_Msg;
TOSMsg.java中:
/**
* A class that represents packets as they are actually exchanged with
* motes:
* - the data array (payload) is of selectable size (per-application)
* - as a result, the crc field may be at different offsets
* - there are no strength, ack or time fields
*/
下面是对data,crc,strength,ack,time这5个成员(域)的操作,也就是说,这5个域
"are actually exchanged with motes".
但AM.h 中怎么说是前面的5个域"are transmitted/received on the radio".
程序应该没问题,请高手明示!
typedef struct TOS_Msg
{
/* The following fields are transmitted/received on the radio. */
uint16_t addr;
uint8_t type;
uint8_t group;
uint8_t length;
int8_t data[TOSH_DATA_LENGTH];
uint16_t crc;
/* The following fields are not actually transmitted or received
* on the radio! They are used for internal accounting only.
* The reason they are in this structure is that the AM interface
* requires them to be part of the TOS_Msg that is passed to
* send/receive operations.
*/
uint16_t strength;
uint8_t ack;
uint16_t time;
uint8_t sendSecurityMode;
uint8_t receiveSecurityMode;
} TOS_Msg;
TOSMsg.java中:
/**
* A class that represents packets as they are actually exchanged with
* motes:
* - the data array (payload) is of selectable size (per-application)
* - as a result, the crc field may be at different offsets
* - there are no strength, ack or time fields
*/
下面是对data,crc,strength,ack,time这5个成员(域)的操作,也就是说,这5个域
"are actually exchanged with motes".
但AM.h 中怎么说是前面的5个域"are transmitted/received on the radio".
程序应该没问题,请高手明示!
不觉得这两句话有什么问题呀。AM.h中定义的包是motes通过无线链路传输的包,而
java中定义的则是通过计算机向通过串行线连接的motes发的包。通常你可以通过
那个SerialForwarder从计算机向相连的mote注入包,然后这个mote通过无线链路发
出去。所以这两个定义应该是兼容的。
明白了,多谢!
射频专业培训教程推荐