Z-Stack 中发送数据通过在应用层调用函数
void SampleApp_SendFlashMessage( uint16 flashTime )
完成,其中flash Time 为发送的数据,这个函数在应用中通过调用
afStatus_t AF_DataRequest( afAddrType_t *dstAddr, endPointDesc_t *srcEP, uint16 cID, uint16 len, uint8 *buf, uint8 *transID, uint8 options, uint8 radius )
函数完成数据的发送。如果熟悉了其中的每个参数的含义,就可以很灵活的使用发送函数发送自己的数据。
afAddrType_t *dstAddr:目标地址
endPointDesc_t *srcEP:源端点
uint16 cID:簇ID
uint16 len:发送数据的长度
uint8 *buf:发送数据缓冲区
uint8 *transID:任务ID号
uint8 options:有效位掩码的发送选项
uint8 radius:传送跳数,通常设置为AF_DEFAULT_RADIUS