-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add battery reading wrapper #46
feat: Add battery reading wrapper #46
Conversation
This change introduces hasBatterySensor, readBatteryLevel, and sendSensorReadCmd to handle battery level reading from devices. These functions allow checking for a battery sensor, reading the battery level, and sending a sensor read command to the device.
throw new ButtplugDeviceException("Device doesn't support SensorReadCmd!"); | ||
} | ||
|
||
final SensorReadCmd cmd = new SensorReadCmd(index, index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the first argument here should be deviceIndex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think one of the index's is off
...ug4j/src/main/java/io/github/blackspherefollower/buttplug4j/client/ButtplugClientDevice.java
Outdated
Show resolved
Hide resolved
In the last commit I changed to client.getNextMsgId() and I also added a timeout in the readBatteryLevel because in the case the device crashed or anything else it would hangs up indefinitely |
5d7738d
into
blackspherefollower:master
This change introduces hasBatterySensor, readBatteryLevel, and sendSensorReadCmd to handle battery level reading from devices. These functions allow checking for a battery sensor, reading the battery level, and sending a sensor read command to the device.