[Bug Report] JN-SW-4170 build 1840 - eCLD_LevelControlSetLevel(…) calculates incorrect step size

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[Bug Report] JN-SW-4170 build 1840 - eCLD_LevelControlSetLevel(…) calculates incorrect step size

483 Views
Dadeos
Contributor I

I have observed that the eCLD_LevelControlSetLevel(…) implementation provided in build 1840 of the JN-SW-4170 JN516x ZigBee 3.0 SDK incorrectly calculates the psCommon->sTransition.iStepSize.

This issue may be trivially observed when the "JN-SW-4170/Components/ZCL/Clusters/General/Source/LevelControl.c" sources are compiled with the DEBUG_CLD_LEVEL_CONTROL pre-processor definition specified. An example of the resultant output is provided below:

--------

LC: Set Level=1 Time=3 Level=1 Time=3 Step*100=8433

LC: Updating EP:1 Target=100 Cur=25400 Step=8433 Time=3 OnOff=1

LC: Updating EP:1 Target=100 Cur=25400 Step=8433 Time=2 OnOff=1

LC: Updating EP:1 Target=100 Cur=25400 Step=8433 Time=1 OnOff=1

LC: Updating EP:1 Target=100 Cur=25400 Step=8433 Time=0 OnOff=1

--------

where it can be seen that the "Target" level is 100, the "Cur"rent level is 25400, and the "Step" is 8433, where the step value is subsequently added to the current value within the eCLD_LevelControlUpdate(…) function:

--------

PUBLIC teZCL_Status eCLD_LevelControlUpdate(uint8 u8SourceEndPointId)
{

    psCommon->sTransition.iCurrentLevel += psCommon->sTransition.iStepSize;

}

--------

The attached "JN-SW-4170 eCLD_LevelControlSetLevel().patch" addresses this issue by modifying the calculation of the psCommon->sTransition.iStepSize value so that the current value moves towards the target value when the step value is added iteratively.

Labels (1)
1 Reply

468 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi @Dadeos,

Thank you so much for your feedback. We are checking this by our side.

Regards,

Mario

0 Kudos