想做成的效果如下 (引用一个厂家的zigbee模块说明书的一段话):
//发送信息到目标地址
GenericApp_P2P_DstAddr.addrMode = (afAddrMode_t)Addr16Bit; // 点播
GenericApp_P2P_DstAddr.endPoint = GENERICAPP_ENDPOINT ; //GENERICAPP_P2P_ENDPOINT =10
GenericApp_P2P_DstAddr.addr.shortAddr = des_short_addr; //发给目标设备
if ( AF_DataRequest( &GenericApp_P2P_DstAddr, &GenericApp_epDesc,
GENERICAPP_P2P_CLUSTERID,
//(byte)osal_strlen( theMessageData ) + 1,
message_length,
//(byte *)&theMessageData,
message_uart0_buf,
&GenericApp_TransID,
AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )
{
//Successfully requested to be sent.
} // end of AF_DataRequest()