协议栈:Z-Stack2.51a
项目: Generic
问题叙述:仅修改static void GenericApp_SendTheMessage( void )函数,并增加宏定义
#define MULITCAST
#define BOARDCAST
实验1.
程序运行后,通过Sniffer抓包,发现广播包正常,组播包不正常,组ID变成了目标地址.
实验2.
注释f8wConfig.cfg中的-DZIGBEEPRO,即不采用ZigBee Pro
编译出错,修改连接的库Router-Pro.lib 为 Router.lib
再次编译,通过Sniffer抓包,发现广播包正常,此时,组播包也正常.
附件:sniffer 抓包截图
提问:请问原因是什么?
源代码:
/*********************************************************************
* @fn GenericApp_SendTheMessage
*
* @brief Send "the" message.
*
* @param none
*
* @return none
*/
static void GenericApp_SendTheMessage( void )
{
char theMessageData[] = "Hello World";
#ifdef BOARDCAST
GenericApp_DstAddr.addrMode = (afAddrMode_t)AddrBroadcast;
GenericApp_DstAddr.addr.shortAddr = 0xFFFF;
GenericApp_DstAddr.endPoint = GENERICAPP_ENDPOINT;
if ( AF_DataRequest( &GenericApp_DstAddr, &GenericApp_epDesc,
GENERICAPP_CLUSTERID,
(byte)osal_strlen( theMessageData ) + 1,
(byte *)&theMessageData,
&GenericApp_TransID,
AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )
{
// Successfully requested to be sent.
}
else
{
// Error occurred in request to send.
}
#endif
#ifdef MULTICAST
GenericApp_DstAddr.addrMode = (afAddrMode_t)AddrGroup;
GenericApp_DstAddr.addr.shortAddr = 0x8001;
GenericApp_DstAddr.endPoint = GENERICAPP_ENDPOINT;
if ( AF_DataRequest( &GenericApp_DstAddr, &GenericApp_epDesc,
GENERICAPP_CLUSTERID,
(byte)osal_strlen( theMessageData ) + 1,
(byte *)&theMessageData,
&GenericApp_TransID,
AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )
{
// Successfully requested to be sent.
}
else
{
// Error occurred in request to send.
}
#endif
// if ( AF_DataRequest( &GenericApp_DstAddr, &GenericApp_epDesc,
// GENERICAPP_CLUSTERID,
// (byte)osal_strlen( theMessageData ) + 1,
// (byte *)&theMessageData,
// &GenericApp_TransID,
// AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )
// {
// // Successfully requested to be sent.
// }
// else
// {
// // Error occurred in request to send.
// }
}