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.

End device connection event

I would like to capture on the router when an end device connects (I have roaming end devices and need to know when one joins a particular router). I tried the following on my router:

static void router_process_zdo_msg( zdoIncomingMsg_t *inMsg )
{
switch ( inMsg->clusterID )
{
case End_Device_Timeout_req:
{
//An end device is connecting to us. Let's chirp a little
//to indicate we were just connected to.
red_led_blink(3,50,100);
}
case End_Device_Bind_req:
{
//An end device is connecting to us. Let's chirp a little
//to indicate we were just connected to.
green_led_blink(3,50,100);
break;
}
}
}

Neither of these trigger when an end device connects. Also, I need to be able to distinguish between an end device and another router.

thank you

  • Hi,

    You can use ZDO_JoinIndicationCB() in ZDApp.c. This function is called for every device that joins, and provides its short address, IEEE address, the join type and capability flags (which will tell you whether this is and end device or a router).

    Best regards,
    OD
  • Thank you. I'm sorry if this sounds dense, but how do I use it? It's already a callback, and it takes the things I want to know as parameters, so I don't see how I can call this function. I don't see how I would use it with ZDO_RegisterForZDOMsg(), either. Am I supposed to put my code inside of this function?

  • This is a callback function which would be called when a device joins. You can add your call inside it to process what you want to do.