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.
Tool/software:
I need to call into my code from the collector.c/csf.c file functions when devices are added to the network. I tried hooking into ApiMac_assocStatus_t cllcDeviceJoiningCB(
ApiMac_deviceDescriptor_t *pDevInfo,
ApiMac_capabilityInfo_t *pCapInfo)
here:
/* Make sure the device is in our PAN */
if(pDevInfo->panID == devicePanId)
{
/* Update the user that a device is joining */
status = Csf_deviceUpdate(pDevInfo, pCapInfo);
if(status==ApiMac_assocStatus_success)
{
#ifdef FEATURE_MAC_SECURITY
/* Add device to security device table */
Cllc_addSecDevice(pDevInfo->panID,
pDevInfo->shortAddress,
&pDevInfo->extAddress, 0);
#endif /* FEATURE_MAC_SECURITY */
// Indicate that the device has joined so that pairing can finish
deviceJoined(pDevInfo->shortAddress);
where deviceJoined is my function to indicate that devices are joined. This did not seem to work. Where can I get this indication?
Thank you,
Kevin
Hi Kevin,
If I understand correctly your deviceJoined() function is inserted before the #ifdef FEATURE_SECURE_COMMISSIONING and possibly sending the COLLECTOR_CONFIG_EVT?
Can you set a breakpoint here and verify that you're actually reaching this line of code when a device joins the network? You may need to lower the optimization to be able to set the breakpoint.
Cheers,
Marie H
Marie,
I was hoping you could tell me if that was a good place to put the indication that a sensor has been linked to the collector. I have placed the code in several places and I don't seem to get any acknowledgement of the event. What happens is I go into pairing mode and show that I am waiting for the pairing to occur and then when the timer goes off for waiting to pair, the indicator LED shows it is paired. Since I don't close the network yet, it is able to pair late. The season knows it is paired at about the same time.
Kevin
Hi Kevin,
What's deviceJoined() doing?
I would put it here or in Csf_deviceUpdate() in cfs.c if you want to output something over uart.
Cheers,
Marie H
Marie H,
Thank you for getting back to me. I think I have it figured out. There was another area of my code I needed to open the network at.
Kevin