sensors: rework sensor assertion

Prior to this patch the sensor assertion logic would generate an invalid
DBus message or undefined behavior in several scenarios.

 - A bit is both asserted and desasserted:
A well behaving client won't do this but the existing logic would
generate an invalid property-set message with signature ssvv.  Rework
the logic such that no dbus traffic occurs.

 -  No bits are asserted:
Results in an invalid message with signature ss.
Rework such that no dbus traffic occurs.

 - Empty offset value map in configuration:
Results in an invalid message with signature s.
Rework such that no dbus traffic occurs.

 - Empty offset value map entry (either assert or deassert) in
   configuration:
Results in an invalid variant signature.
Rework such that no dbus traffic occurs.

 - The same bit is specified in the configuration for multiple
   properties or interfaces:
Can result in invalid messages with a wide variety of signatures.
Rework such that one message is sent for each property
being updated.

 - Invalid bit specified in value map entry
Results in undefined behavior calling bitset::test.
Rework such that entries in the value map with invalid bits
are ignored.

Tested: Verified the OperatingSystemStatus sensor can be set by a BIOS
Change-Id: I4df9472a8bdc9e44e98e1a963838da0912d10683
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
1 file changed