ti的例子程序里找到的文档,现在进行一下简单的翻译
这是basicRfCfg_t结构体,如果想使用这个api必须要使用的结构体。
myAddr 16位的短地址,这是ZigBee模块自身的地址。
panId ZigBee协议使用一个16位的个域网标志符(PAN ID)来标识一个网络,panid不同即标志着不同的网络,可以说是网络的名字。
channel RF的通道(必须在11到26之间);
ackRequest 如果为真,则要求从目的地址的ZigBee模块得到ack信号
最后两个是安全用的,由于我不用安全信息,所以没有详细了解。
函数:
void basicRfInit(basicRfCfg_t* pRfConfig) ;初始化结构体。
uint8 basicRfSendPacket(uint16 destAddr, uint8* pPayload, uint8 length)
Send packet to the given destination short address. Returns TRUE if packet was sent
successfully, and FAILED otherwise. If ackRequest is TRUE the return value of this function
will only be TRUE if an acknowledgment is received from the destination.
发送包到指定的地址-destAddr,如果返回真,标志成功的发送了包,为假则相反。
uint8 basicRfPacketIsReady(void)
Returns TRUE if a received packet is ready to be retrieved by higher layer.
如果上层准备好了接收这个发来的包,则返回真。
int8 basicRfGetRssi(void)
Returns the RSSI value of the last received packet
返回得到最后一个包的RSSI值,这个函数一般应用于得到网络状况,以是否应该加大或减少发射功率。
uint8 basicRfReceive(uint8* pRxData, uint8 len, int16* pRssi)
Retrieve packet from basic RF layer. The caller is responsible for allocating buffer space for
data and the RSSI value.
//我也不懂
void basicRfReceiveOn(void)
Turn on receiveron radio. After calling this function the radio is kept on until
basicRfReceiveOff is called.
打开射频模块,只要这个函数被调用,如果不调用下面的函数,那么射频模块将一直开着
void basicRfReceiveOff(void)
Turn off receiver on radio, and keep it off unless for transmitting a packet with Clear Channel
Assessment.
关闭射频模块。
、、、、、