Hi ,
in tlm_reply and tlm_replyQuerythe argument userStatus is defined as an UINT16 insted an INT32 . This casting to UIN16 results in a bug, as negative values are changed.
The argument userStatus is defined as unsigned because the application's user reply status is defined to be ≥ 0 (see replyStatus in Table A.18 in IEC61375-2-3). Only the stack may send an ME with a negative reply value.
This is no bug, but the parameter size should be changed to UINT32 with an error check (parameter/range error), if the supplied value is larger than 0x7FFFFFFF.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The argument
userStatusis defined as unsigned because the application's user reply status is defined to be ≥ 0 (see replyStatus in Table A.18 in IEC61375-2-3). Only the stack may send an ME with a negative reply value.This is no bug, but the parameter size should be changed to UINT32 with an error check (parameter/range error), if the supplied value is larger than 0x7FFFFFFF.
Changed the ticket's title.
Changed to UINT32 plus range check.
Tested by Inspection