Anytime an error code is returned from any API function, errno should be set to indicate the error which occured.
Actual Behavior:
Initially, vision_read_by_size fills the signature of each element in the output array with VISION_OBJ_ERR_SIG. If object_count is greater than the number of available objects (as given by vexDeviceVisionObjectCountGet), then one or more entries at the end of the array will not be touched by the second for loop, leaving them with a value which signifies that an error occurred. Meanwhile, unless an actual error occurs in the underlying VEX API, errno will not be set, leaving it at whatever value it happened to be when the function was called.
Steps to reproduce:
I don't have the hardware to test, but you should be able to reproduce by requesting more objects than exist. Try setting errno to something distinctive before calling vision_read_by_size and note that it won't have changed afterwards.
Expected Behavior:
Anytime an error code is returned from any API function,
errno
should be set to indicate the error which occured.Actual Behavior:
Initially,
vision_read_by_size
fills thesignature
of each element in the output array withVISION_OBJ_ERR_SIG
. Ifobject_count
is greater than the number of available objects (as given byvexDeviceVisionObjectCountGet
), then one or more entries at the end of the array will not be touched by the secondfor
loop, leaving them with a value which signifies that an error occurred. Meanwhile, unless an actual error occurs in the underlying VEX API,errno
will not be set, leaving it at whatever value it happened to be when the function was called.Steps to reproduce:
I don't have the hardware to test, but you should be able to reproduce by requesting more objects than exist. Try setting
errno
to something distinctive before callingvision_read_by_size
and note that it won't have changed afterwards.System information:
Platform: V5 PROS Kernel Version: latest develop branch