Skip to content
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

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

Fyustorm
Copy link
Contributor

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.

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.
@CLAassistant
Copy link

CLAassistant commented Nov 14, 2024

CLA assistant check
All committers have signed the CLA.

throw new ButtplugDeviceException("Device doesn't support SensorReadCmd!");
}

final SensorReadCmd cmd = new SensorReadCmd(index, index);

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

Copy link
Owner

@blackspherefollower blackspherefollower left a 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

@Fyustorm
Copy link
Contributor Author

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

@blackspherefollower blackspherefollower merged commit 5d7738d into blackspherefollower:master Nov 19, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants