Open Tommsy64 opened 6 years ago
Currently if a slot number that is too big is passed into the set, it defaults to 3. That's why you read 25 on slot 3 after attempting to set a value of 25 on slot15 (which is invalid).
Ok, thank you. Does that mean selectProfileSlot(slotIdx, pidIdx)
clamps slotIdx to [0,3] and pidIdx [0,2] without indication? Perhaps adding this to the documentation would be beneficial. Such behavior is not obvious without experimentation.
Likewise, is there a place where I can figure out what the ordinal for each value in ParamEnum does?
At first glance, the ordinal parameter appears to be the profile slot in which to store and retrieve the parameters? (For instance, eProfileParamSlot_P) Yet, the value appears to be ignored by other parameters such as eMotMag_Accel.
How can I tell when the ordinal is ignored? Or when the
subValue
is ignored inconfigSetParameter
?Since there are only 4 (?) profiles, what is happening when I set the eProfileParamSlot_P parameter, for instance, with an ordinal of 12? Shouldn't an error be thrown? Instead, the ErrorCode returned is
OK
. However, for an ordinal value greater than 15 aCAN_INVALID_PARAM
ErrorCode is returned.The following
outputs:
Reading the eProfileParamSlot_P parameter using
configGetParameter
only increases my confusion. I set the P value and read it like so:I am able to set the first 15 ordinals (or profile slots?).
Next, I can read the first 15 ordinals.
But it appears that ordinal values are clamped to a maximum of 3 when reading the parameter??? Yet an error is only caused when the ordinal is greater than 15. Shouldn't such behavior be documented?
Similarly, shouldn't there be an error thrown when invalid profile slots or PID slots are selected using
selectProfileSlot
?As you can tell, I am greatly confused. Some clarification would be appreciated.