Start a new topic

Contradictory error messages setting Switch attributes

Original Post by: rlopez3d Wed May 18 10:11:45 2011


If I create a new Switch record:


mgrec *switchRec = mgNewRec(fltSwitch);


and try to set the following attributes:


numAttributes = mgSetAttList(switchRec,

fltSwCurMask, fSwCurMask,

fltSwMaxMask, fSwMaxMask,

fltSwCount, fSwCount, MG_NULL);


I get as return value numAttributes = 3, i.e. the operation was successful for the 3 attributes, but at the same time I get two errors in the MS DOS window:


“Cannot set this switch node attribute” ( for fltSwMaxMask attribute)

“Cannot set this switch node attribute” (for fltSwCount attribute)


Original Post by: SteveThompson Wed May 18 14:17:49 2011


That certainly is not behavior you would expect. Thank you for bringing this to our attention, we will log a bug and look into this.


Just took a quick look at the code and see the culprit. In the case of the switch attribute values you note, the value returned by mgSetAttList reflects the number of attributes that are "valid" for the node type, not the actual number that were set successfully. In the case of "read only" attributes, they are "valid" for get but not for "set".


Again, we really appreciate your feedback and we'll see what we can do to fix this ;-)

Original Post by: rlopez3d Wed May 18 14:29:51 2011


Thanks for the prompt reply !


Due to ambiguity I checked the values of the attributes again after the call to mgSetAttList: fltSwMaxMask and fltSwCount where not changed by the command and they retained the default values. It means the error messages in MS DOS window were correct but not the returned value from mgSetAttList. The 3 listed attributes are not described as "read only" in the Reference Manual.

Original Post by: SteveThompson Wed May 18 14:38:31 2011


The 3 listed attributes are not described as “read only” in the Reference Manual.
I'll add a note in the bug to this effect to make sure the Data Dictionary (Reference) reflects this. Thanks again for your help.
Login to post a comment