Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ptp-dev] Problem with creating enumerated attribute definitions?

I've made a change to my proxy to send enumerated attribute definition 
events to the front end. My intent is to use these attribute definitions 
to set the labels on a pair or radio buttons representing a boolean 
option. I've created a function in my proxy that sends the event to the 
front end in what I believe is the correct format <1, <n>, <id>, 
ENUMERATED, <short_name> <long_name> <default> <attr> <attr> ...> where 
<n> is the number of following tokens (5 + number of enumerations)

I did have a problem where even though I was sending across 2 
enumerations, the StringSetAttributeDefinition that gets created has only 
the first enumeration. I found a line of code in 
AbstractProxyRuntimeSystem line 832 which read 'if (pos < end) {' which 
was resulting in picking up only the first enumeration. If I changed the 
'<' to '<=' then I get a StringSetAttributeDefinition with the two 
enumeration values.

This is in the latest PTP code, since I updated my code this morning.

Is this a problem with the AbstractProxyRuntimeSystem code, or have I done 
something wrong in my proxy?

Also, when I send across an enumeration attribute definition, is it 
supposed to result in the creation of a StringSetAttributeDefinition 
object? I was expecting to see an EnumerationAttributeDefinition object 
created, but when I got a class cast exception based on that assumtion, I 
tracked down the code where the StringSetAttributeDefinition was created.

Generation of an EnumerationAttributeDefinition or a 
StringSetAttributeDefinition is fine either way. Leaving the code as-is 
means I don't have to get the attribute definition and then create a dummy 
attribute to get the value, but that's not frequently called code so isn't 
a big deal.
Dave


Back to the top