python-openzwave icon indicating copy to clipboard operation
python-openzwave copied to clipboard

1.6 Update - Support BitSet ValueID (python-openzwave)

Open Fishwaldo opened this issue 6 years ago • 7 comments

Per the OZW 1.6 Release Notes on the new BitSet ValueID

Need to ensure that the BitSet ValueID is supported.

Manager References: Manager::GetValueAsBitSet (ValueID const &_id, uint8 _pos, bool *o_value) SetValue (ValueID const &_id, uint8 _pos, bool const _value) GetBitMask (ValueID const &_id, int32 *o_mask) GetBitSetSize (ValueID const &_id, uint8 *o_size)

Fishwaldo avatar May 08 '19 15:05 Fishwaldo

OK I am working on this now. I have encountered a missing method for the Mnager class

bool Manager::GetValueAsBinaryString ( ValueID const & _id, string *  o_value )

I also noticed some errors in the documentation. under the section for the GetValueAsBitSet as well as for the overloaded SetValue. This is what the description of the returned value currently is.

true if the value was obtained. Returns false if the value is not a ValueID::ValueType_Bool. The type can be tested with a call to ValueID::GetType.

I believe it should read

true if the value was obtained. Returns false if the value is not a ValueID::ValueType_BitSet. The type can be tested with a call to ValueID::GetType.


kdschlosser avatar May 13 '19 07:05 kdschlosser

I just finished making the updates. It is going to compile and run the tests so we will see if it works.

I still have yet to check out the unittests to see if there are changes that need to be made there as well.

kdschlosser avatar May 13 '19 08:05 kdschlosser

quick question.

the index for the bit.. does the index run from right to left of left to right? I know you already know this that bit positions run from right to left. But you may have coded it to index the bit from left to right..

kdschlosser avatar May 15 '19 22:05 kdschlosser

LSB = 0, MSB is highest.

Fishwaldo avatar May 17 '19 13:05 Fishwaldo

ok. you got me with the geek speak. I am a green horn in the programming world. only 3 years. I am going to need some clarification. :flushed:

kdschlosser avatar May 17 '19 21:05 kdschlosser

LSB - least significant bit. Bit 1 which equals 1. MSB - most significant bit. Eg, bit 8 which equals 127.

Fishwaldo avatar May 18 '19 03:05 Fishwaldo

ok so it is indexed from right to left. good to know.

kdschlosser avatar May 18 '19 16:05 kdschlosser