Announcement

Collapse
No announcement yet.

Device Class question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Device Class question

    Hi

    I have created my device object as dev - I have no problem in getting dc, hc and the rest of the properties. But the misc part, or actually the interpretation, is causing me problems.

    How do I interpret the different combinations of values? What decimal value should I expect when:

    a device is status only? (&h10)
    a device is hidden? (&h20)
    a device is both of the above?

    Regards,

    Mav

    #2
    They're individual bits. To combine, you just need them OR'd together. Since each of the individual one's is exclusive of the others, you could just add them together to get the same thing as an OR.

    I.e.: dev.misc = &h10 + &h20

    Steve

    Comment


      #3
      Thanks Steve.

      So how would I interpret that dev.misc gives a value of 512?

      I know this potentially are "simple questions", but I have struggled with this for quite some time. Thanks

      Comment


        #4
        So to interpret a value (i.e., compare it to what HST documented for the DeviceClass) you need to convert it to HEX, then break down which bits are set.

        512 is two to the 9th, which in HEX is &h0200. Since it is a power of two, it also means that it has only one bit set, the 10th one from the right (the first bit is two to the 0th power, or 1). Looking at the docs, the misc mask indicates that this means "Create voice command(s) context for this device" which isn't exactly a helpful description, but....

        An example of combining would be if the value was 12. In hex that is &hB0, which you don't see in the table. This number has two bits set: the 3rd bit (2 to the 2nd power, or &h4) and the 4th bit (2 to the 3rd power, or &h8). So, 12 would indicate (from the DeviceClass docs) a SmartLinc switch (&h4) with no logging (&h8).

        Steve

        Comment

        Working...
        X