Other Parts Discussed in Thread: CC1310
Tool/software: Code Composer Studio
Hey guys,
we use sensor/collector 15.4 stack and i went through the user guide, which tells me that in non beacon mode with security on, the collector waits for the sleepy sensor to poll to kick it. Therefore, only Cllc_sendDisassociationRequest() has to be called. However, this is not working, i can see in the sniffer, that no disassociation request is send when the collector is in pollIndCb(). Only if I remove the device from the list and I change the code within pollIndCb() as follows, a disassociation message is triggered.
static void pollIndCB(ApiMac_mlmePollInd_t *pPollInd) { ApiMac_sAddr_t addr; addr.addrMode = ApiMac_addrType_short; if (pPollInd->srcAddr.addrMode == ApiMac_addrType_short) { addr.addr.shortAddr = pPollInd->srcAddr.addr.shortAddr; } else { addr.addr.shortAddr = Csf_getDeviceShort( &pPollInd->srcAddr.addr.extAddr); } __________MY CHANGE START____________ #ifdef SMART_DIS if (findDevice(&pPollInd->srcAddr) == NULL && pPollInd->srcAddr.addrMode == ApiMac_addrType_short) { Cllc_sendDisassociationRequest(addr.addr.shortAddr, false); System_printf("disD 0x%02x\r\n", addr.addr.shortAddr); } #endif _________MY CHANGE END______________ processDataRetry(&addr); }
- Why is that?
- Why is there no highLevel Callback function like disassociateCnfCb() on the collector side? this could help debugging and I guess at some point the device has to be removed from the NV, too, why not at this point?
- What would be a correct disassociation sequence in the code?
I.e. (which does not work, because no disassociation message is send according to the sniffer, not during the call nor in pollindcb())
if(Csf_getDevice(&devAddr, &item)) { Cllc_sendDisassociationRequest(devAddr.addr.shortAddr, false); Cllc_removeDevice(&item.devInfo.extAddress); }
Besides, if I call Cllc_sendDisassociationRequest() in pollindcb() and the sensor gets disconnected, it tries to join again (which is desired). This works, however, every time an already in use short address is assigned. Checking whats in the NV memory, there are two entries with the same short and ext. address. Furthermore, the newly joined sensor can report data which is acknowledged and printed via uart. Note that the wrong assignment is not happening if I add a completely new sensor which was not connected before..
So why is this happening during association?!
EDIT!!! - Note that I kick the sensors via a UART message, for some reason I have to press the reset button after calling the 2nd code snippet because the application crashes. I think this is the reason that the short addresses are not assigned correctly. could this be the reason? The issue with Cllc_sendDisassociationRequest() has nothing to do with the reset, because also without reset, calling this function only works within pollindCb().
kind regards
Slev1n