This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem sending an packet from Coordinator to End Device

Hi ,

like i was discussing in this thread http://e2e.ti.com/support/low_power_rf/f/158/p/17310/169314.aspx#169314

i am having problem to send menssage from coordinator to end device (or router) or like i realised, the probel is to receive message from the coordinator.

using the packet sniffer and the Daintree Network Analiser, i realised that i am sending the message correct (from 0x000 to broadcast), but it seems that i am not receiving it. 

I' m using the genericapp in this testing.

Im using the MessageMSGCB function, but it not working.

void GenericApp_MessageMSGCB( afIncomingMSGPacket_t *pkt )

{

  HalLcdWriteScreen( (char*)pkt->cmd.Data, "msg received" );

  switch ( pkt->clusterId )

  {

    case GENERICAPP_CLUSTERID:

      // "the" message

#if defined( LCD_SUPPORTED )

      HalLcdWriteScreen( (char*)pkt->cmd.Data, "rcvd" );

#elif defined( WIN32 )

      WPRINTSTR( pkt->cmd.Data );

#endif

      break;

  }

}

Do i need to use another interrupt, and not AF_INCOMING_MSG_CMD?

        case AF_INCOMING_MSG_CMD:

          GenericApp_MessageMSGCB( MSGpkt );

          break;

Or i need to send different from coordinator?

void GenericApp_SendTheMessage( void )

{

  char theMessageData[] = "Chikibumparatapau Giria de Pirata";

 

      GenericApp_DstAddr.addrMode = AddrBroadcast;

      GenericApp_DstAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR;

 

      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 )

  {

   osal_set_event(GenericApp_TransID, GENERICAPP_SEND_MSG_EVT);

   HalLcdWriteScreen( "WOOOOOW", "hehehhehe" );

    // Successfully requested to be sent.

  }

  else

  {

      HalLcdWriteScreen( "WOOOOOW", "ti peguei" );

    // Error occurred in request to send.

  }

}

 

Thanks for your attention

  • Hi Franz, I same a similar problem,  I need to send a message from coordinator to end device, (first I send a message from end device to coordinator, now I have to process data and send new data to end device.. bidirectional communication), ¿how can I send the message from coordinator to end device?

  • Dears,

    You can try to set a break point on zcl_event_loop() inside zcl.c. There is a statement like "if ( *msgPtr == AF_INCOMING_MSG_CMD )" and you can set the break point inside. Make sure you can receive the incoming message here first otherwise you can not receive it on you application.

    Regards!

    YK