Hi @luis_maravilla. I been working on this still. I have made some research and it seems the table of addresses hasn't been correctly saved.
I use a lookup function to check what is the 64 bit mac address, because this parameters is the one im sending to the client by doing:
macAddress = ZPS_u64AplZdoLookupIeeeAddr(u16SrcAddr);
I tried a lot of things, and the one i think could work is by asking to the node the 64 bit address directly and forzing a ZPS_eAplZdoAddAddrMapEntry(u16nwkAddress, u64IeeeAddress)
DBG_vPrintf(TRACE_APP, "APP: Lookup FAILED for 0x%04x! Need ZDP.\n", u16SrcAddr);
// Allocate APDU instance
PDUM_thAPduInstance hAPduInst = PDUM_hAPduAllocateAPduInstance(apduZDP);
if (hAPduInst == PDUM_INVALID_HANDLE) {
DBG_vPrintf(TRACE_APP, "Failed to allocate APDU instance\n");
return;
}
// Prepare IEEE address request
ZPS_tsAplZdpIeeeAddrReq sIeeeAddrReq = {
.u16NwkAddrOfInterest = u16SrcAddr, // Network address we want to lookup
.u8RequestType = 0, // 0 = single response, 1 = extended response
.u8StartIndex = 0 // Start index for extended responses
};
// Create destination address (typically coordinator at 0x0000)
ZPS_tuAddress uDstAddr;
uDstAddr.u16Addr = 0x0000; // Coordinator address
// Maintain a sequence number (should be declared at module scope)
uint8 u8SeqNumber = 0;
// Send the request
ZPS_teStatus status = ZPS_eAplZdpIeeeAddrRequest(
hAPduInst, // PDU Instance
uDstAddr, // Destination address (coordinator)
FALSE, // FALSE = 16-bit network address (not IEEE)
&u8SeqNumber, // Sequence number
&sIeeeAddrReq // The actual request structure
);
if (status != ZPS_E_SUCCESS) {
DBG_vPrintf(TRACE_APP, "64bit Addr Request failed: %d\n", status);
PDUM_eAPduFreeAPduInstance(hAPduInst); // Free if failed
return;
} else DBG_vPrintf(TRACE_APP, "Succesfully Retrieve \n", status);
But this is response in the cluster 8001 for Address response:
(19:09:07.990) APP: vCheckStackEvent: ZPS_EVENT_AF_DATA_INDICATION
(19:09:07.990) Profile :0
(19:09:07.990) Cluster :8001
(19:09:07.990) EndPoint:0
(19:09:07.990) IEEE Addr Response len: 12 > 24
(19:09:07.990) IEEE Addr Response NULL: 0
(19:09:07.990) Raw Response Data (12 bytes): 41 81 ff ff ff ff ff ff ff ff 4a e4
Im failing in asking the address to the node. Somehow im getting MAC 0xFFFFFFFFFFFFFFF. (I'm pretty sure that is not the MAC, actually is 0x00158d0000554be0
Can you help with this? Also, @EduardoZamora @mario_castaneda i count on you guys. T_T