AnsweredAssumed Answered

It seems that there are some errors in the JN-AN-1216 (version:1010)

Question asked by pan jun on Apr 1, 2018
Latest reply on May 21, 2018 by Mario Ignacio Castaneda Lopez

The first doubtful error: It appears in the SerialLink.c

PUBLIC void vSL_LogSend(void)
{
int n;
uint8 u8CRC;
uint8 u8Length;

while (u8LogEnd - u8LogStart != 0)
{
/* Send start character */
vSL_TxByte(TRUE, SL_START_CHAR);

/* Send message type */
vSL_TxByte(FALSE, (E_SL_MSG_LOG >> 8) & 0xff);
vSL_TxByte(FALSE, (E_SL_MSG_LOG >> 0) & 0xff);

u8CRC = ((E_SL_MSG_LOG >> 8) & 0xff) ^ ((E_SL_MSG_LOG >> 0) & 0xff);

for (u8Length = 0; au8LogBuffer[(u8LogStart + u8Length) & 0xFF] |= '\0'; u8Length++)
{
u8CRC ^= au8LogBuffer[(u8LogStart + u8Length) & 0xFF];
}
u8CRC ^= 0;
u8CRC ^= u8Length;

/* Send message length */
vSL_TxByte(FALSE, 0);
vSL_TxByte(FALSE, u8Length);

/* Send message checksum */
vSL_TxByte(FALSE, u8CRC);

/* Send message payload */
for(n = 0; n < u8Length; n++)
{
vSL_TxByte(FALSE, au8LogBuffer[u8LogStart]);
u8LogStart++;
}
u8LogStart++;

/* Send end character */
vSL_TxByte(TRUE, SL_END_CHAR);
}
}

 

The above line of code:for (u8Length = 0; au8LogBuffer[(u8LogStart + u8Length) & 0xFF] |= '\0'; u8Length++)  ,should the part of the red code be changed to != ?

 

The second doubtful error: It appears in the app_Znc_cmds.c

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 ) );
}
}
bCredPresent = zps_bGetFlashCredential ( u64DeviceAddress, &uKey, &u16Location, FALSE, FALSE );
if ( ( bSetTclkFlashFeature) ||
( u8Status == 1) )
{
extern tsMicroIntStorage sZpsIntStore;
extern PUBLIC void* zps_vGetZpsMutex ( void );
bCredPresent =
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);
if(bCredPresent)
{
asTclkStruct[u16Location].u16TclkRetries = 0xFFFF;
}

ZPS_u8GrabMutexLock ( zps_vGetZpsMutex , &sZpsIntStore );
bStatus = TRUE;
}

return bStatus;
}

 

Above, The first time to use bCredPresent as the return value for zps_bGetFlashCredential, and then this return value bCredPresent is not used . The seconde time to use  bCredPresent as the return value for ZPS_u8ReleaseMutexLock, The type of variable bCredPresent is bool_t ,but the type of function  ZPS_u8ReleaseMutexLock is uint8. Feel that   bCredPresent as the return value for ZPS_u8ReleaseMutexLock is error.

 

In addition,i do not understand this line code->bCredPresent = zps_bGetFlashCredential ( u64DeviceAddress, &uKey, &u16Location, FALSE, FALSE ), and do not understand code after it, pls would you explain those to me? 

Outcomes