dbus-sdr: Update bitset usage for VR profile status
The assertions for getVrEventStatus is not used properly. It used to be
different with uint8_t which is set to 1 << index. With bitset, we can
just set it to the index directly. Wrapped with htole16 just in case.
Tested:
The profile status still works. With correct response this time
```
$ ipmitool raw 0x4 0x2b 0xd3
00 02 00 00 00
// Update the profile
$ ipmitool raw 0x4 0x30 0xd3 0 0 4 0 0 0 0 0 0
$ ipmitool raw 0x4 0x2b 0xd3
00 04 00 00 00
```
Change-Id: Ic59e88b65ff9b45ba759a8c62a141cf14e8bdc20
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/dbus-sdr/sensorcommands.cpp b/dbus-sdr/sensorcommands.cpp
index 05f5edf..1c19986 100644
--- a/dbus-sdr/sensorcommands.cpp
+++ b/dbus-sdr/sensorcommands.cpp
@@ -499,14 +499,10 @@
std::size_t index =
static_cast<std::size_t>(std::distance(profiles->begin(), itr));
- // map index to reponse event assertion bit.
- if (index < 8)
+ // map index to response event assertion bit.
+ if (index < 16)
{
- assertions.set(1u << index);
- }
- else if (index < 15)
- {
- assertions.set(1u << (index - 8));
+ assertions.set(index);
}
else
{