Hello,
1. I've found the IP6_GetRoute function, which "Returns the pointer to the entry corresponding to the give index in routing table". So, in router_eligible_device.c, I declared as public global variables:
/* Index and Pointer to Routing Table */
uint32_t index = 1; // second entry of table
ip6RoutingTblEntry_t *pTblEntry = NULL;
Then, in Stack_to_APP_Handler, in the switch case gThrEv_GeneralInd_Connected_c: triggered by a connection of the device, I defined the following:
// /* Set application CoAP destination to all nodes on connected network */
// THR_GetIP6Addr(mThrInstanceId, gAllThreadNodes_c, &gCoapDestAddress, NULL);
/* Set application CoAP destination to the second node on connected network */
pTblEntry = IP6_GetRoute(index);
gCoapDestAddress = pTblEntry->dstPrefix;
However, after successfully connecting, the nodes do not send the CoAP commands (whether the index is 0 or 1).
2. I've used the Periodic Interrupt Timer (Pit), so your proposal seems like a good approach; any further recommendations?
Regards,
Santiago