Other Parts Discussed in Thread: Z-STACK
Hi All,
Does anyone have an example of an Interpan application, using GenericApp?
In Texas Instruments Sniffer i see the packeges been sending in Interpan channel (0x18) but i didnt receive in the enddevice .
I read the Z-Stack Developer's Guide and compile the Z-Stack with INTER_PAN option and added the files in both sides of the network.
In GenericApp_Init of both applications i added this functions
StubAPS_RegisterApp( &GenericApp_epDesc );
StubAPS_SetInterPanChannel( 0x18 );
GenericApp_INTERPAN(); // only in app for sending
and the function
/*********************************************************************
* @fn GenericApp_SendTheMessage
*
* @brief Send "the" message.
*
* @param none
*
* @return none
*/
void GenericApp_INTERPAN( void )
{
// GenericApp_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;
//GenericApp_DstAddr.addr.shortAddr = 0x0000;
GenericApp_DstAddr.addrMode = (afAddrMode_t)AddrBroadcast;
GenericApp_DstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR;
GenericApp_DstAddr.endPoint = STUBAPS_INTER_PAN_EP;
GenericApp_DstAddr.panId = 0x6666;
char theMessageData[] = "666666";
valorEnv++;
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.
// HalLcdWriteStringValue( "Pongs ENV", valorEnv, 10, HAL_LCD_LINE_1 );
}
else
{
// Error occurred in request to send.
}
}
Thanks