Hello Erlei, I hope you're doing well,
First of all, I'm really sorry for the delay on my response.
To solve the problem you're having, you'll have to change one of the functions located inside the
App_Znc_cmds.c source file:
bCredPresent = zps_bGetFlashCredential ( u64DeviceAddress, &uKey, &u16Location, FALSE, FALSE );
From the APP_bSendHATransportKey function in that file, as well as change the if condition from:
if ( ( bSetTclkFlashFeature) ||
( u8Status == 1) )
To:
if ( ( bSetTclkFlashFeature) &&
( u8Status == 1) )
And remove this credential check:
if(bCredPresent)
{
asTclkStruct[u16Location].u16TclkRetries = 0xFFFF;
}
The function should end up looking like this:
PUBLIC bool APP_bSendHATransportKey ( uint16 u16ShortAddress,
uint64 u64DeviceAddress,
uint64 u64ParentAddress,
uint8 u8Status,
uint16 u16Mac)
{
bool_t bStatus = TRUE;
ZPS_teStatus eStatus;
uint16 u16Location;
AESSW_Block_u uKey;
bool_t bCredPresent = FALSE;
if( bBlackListEnable )
{
ZPS_teDevicePermissions eDevicePermissions;
eStatus = ZPS_bAplZdoTrustCenterGetDevicePermissions ( u64DeviceAddress,
&eDevicePermissions );
if( eStatus == ZPS_E_SUCCESS )
{
if ( eDevicePermissions != ZPS_DEVICE_PERMISSIONS_ALL_PERMITED )
{
bStatus = FALSE;
}
else
{
bStatus = TRUE;
}
}
else
{
bStatus = FALSE;
}
if ( ( sZllState.u8DeviceType >= 2 ) &&
( eStatus == ZPS_E_SUCCESS ) &&
( eDevicePermissions == ZPS_DEVICE_PERMISSIONS_ALL_PERMITED )
)
{
u64CallbackMacAddress = u64DeviceAddress;
ZTIMER_eStart ( u8HaModeTimer , ZTIMER_TIME_MSEC ( 500 ) );
}
}
else
{
if(sZllState.u8DeviceType >= 2)
{
u64CallbackMacAddress = u64DeviceAddress;
ZTIMER_eStart ( u8HaModeTimer, ZTIMER_TIME_MSEC ( 500 ) );
}
}
if ( ( bSetTclkFlashFeature) &&
( u8Status == 1) )
{
extern uint32 sZpsIntStore;
extern PUBLIC void* zps_vGetZpsMutex ( void );
ZPS_u8ReleaseMutexLock ( zps_vGetZpsMutex , &sZpsIntStore );
uint8 au8Key[16] = { 0x5a, 0x69, 0x67, 0x42, 0x65, 0x65, 0x41,
0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x30, 0x39 };
ZPS_eAplZdoAddReplaceLinkKey( u64DeviceAddress, au8Key, ZPS_APS_UNIQUE_LINK_KEY);
ZPS_u8GrabMutexLock ( zps_vGetZpsMutex , &sZpsIntStore );
bStatus = TRUE;
}
return bStatus;
}
I hope this solves the problem you were having.
If you have any other questions, please let me know.
Best regards,
Sebastian