Class ButtplugClientDevice
java.lang.Object
io.github.blackspherefollower.buttplug4j.client.ButtplugClientDevice
ButtplugClientDevice.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the device features.intGet the device index.Get the device display name.Get the device message timing gap.getName()Get the device name.inthashCode()booleanhasInput(ButtplugInput inputType) Check if the device has a specific input type.booleanhasOutput(ButtplugOutput outputType) Check if the device has a specific output type.intRead the battery level.intreadRSSI()Read the RSSI.runConstrictFloat(float constrict) Run constrict.runHwPositionWithDurationFloat(float position, int duration) Run HW position with duration.runInput(int featureIndex, ButtplugInput inputType, InputCommandType inputCommand) Run an input command.runInputRead(int featureIndex, ButtplugInput inputType) Read an input.runInputSubscribe(int featureIndex, ButtplugInput inputType) Subscribe to an input.runInputUnsubscribe(int featureIndex, ButtplugInput inputType) Unsubscribe from an input.runLedFloat(float led) Run LED.runOscillateFloat(float oscillate) Run oscillate.runOutput(int featureIndex, OutputCmd.IOutputCommand outputCommand) Run an output command.runPositionFloat(float position) Run position.runRotateFloat(float rotate) Run rotate.runSprayFloat(float spray) Run spray.runTemperatureFloat(float temperature) Run temperature.runVibrateFloat(float vibrate) Run vibrate.Send a stop device command.sendStopDeviceCmd(boolean inputs, boolean outputs) Send a stop device command.sendStopDeviceCmd(int featureIndex) Send a stop device command for a specific feature.sendStopDeviceCmd(int featureIndex, boolean inputs, boolean outputs) Send a stop device command for a specific feature.
-
Constructor Details
-
ButtplugClientDevice
Constructor.- Parameters:
bpClient- clientdevice- device
-
-
Method Details
-
sendStopDeviceCmd
Send a stop device command.- Returns:
- future
-
sendStopDeviceCmd
Send a stop device command.- Parameters:
inputs- stop inputsoutputs- stop outputs- Returns:
- future
-
sendStopDeviceCmd
Send a stop device command for a specific feature.- Parameters:
featureIndex- feature index- Returns:
- future
-
sendStopDeviceCmd
Send a stop device command for a specific feature.- Parameters:
featureIndex- feature indexinputs- stop inputsoutputs- stop outputs- Returns:
- future
-
getDeviceIndex
public int getDeviceIndex()Get the device index.- Returns:
- device index
-
getName
Get the device name.- Returns:
- device name
-
getDisplayName
Get the device display name.- Returns:
- device display name
-
getMessageTimingGap
Get the device message timing gap.- Returns:
- device message timing gap
-
getDeviceFeatures
Get the device features.- Returns:
- device features
-
hasOutput
Check if the device has a specific output type.- Parameters:
outputType- output type- Returns:
- true if has output
-
runOutput
Run an output command.- Parameters:
featureIndex- feature indexoutputCommand- command- Returns:
- future
-
hasInput
Check if the device has a specific input type.- Parameters:
inputType- input type- Returns:
- true if has input
-
runInput
public Future<ButtplugMessage> runInput(int featureIndex, ButtplugInput inputType, InputCommandType inputCommand) Run an input command.- Parameters:
featureIndex- feature indexinputType- input typeinputCommand- command- Returns:
- future
-
runInputRead
Read an input.- Parameters:
featureIndex- feature indexinputType- input type- Returns:
- future
-
runInputSubscribe
Subscribe to an input.- Parameters:
featureIndex- feature indexinputType- input type- Returns:
- future
-
runInputUnsubscribe
Unsubscribe from an input.- Parameters:
featureIndex- feature indexinputType- input type- Returns:
- future
-
readBattery
public int readBattery() throws ExecutionException, InterruptedException, TimeoutException, ButtplugExceptionRead the battery level.- Returns:
- battery level
- Throws:
ExecutionException- if an error occursInterruptedException- if an error occursTimeoutException- if an error occursButtplugException- if an error occurs
-
readRSSI
public int readRSSI() throws ExecutionException, InterruptedException, TimeoutException, ButtplugExceptionRead the RSSI.- Returns:
- RSSI
- Throws:
ExecutionException- if an error occursInterruptedException- if an error occursTimeoutException- if an error occursButtplugException- if an error occurs
-
equals
-
hashCode
public int hashCode() -
runVibrateFloat
public List<Future<ButtplugMessage>> runVibrateFloat(float vibrate) throws ButtplugDeviceFeatureException Run vibrate.- Parameters:
vibrate- vibrate value- Returns:
- futures
- Throws:
ButtplugDeviceFeatureException- if an error occurs
-
runRotateFloat
public List<Future<ButtplugMessage>> runRotateFloat(float rotate) throws ButtplugDeviceFeatureException Run rotate.- Parameters:
rotate- rotate value- Returns:
- futures
- Throws:
ButtplugDeviceFeatureException- if an error occurs
-
runSprayFloat
public List<Future<ButtplugMessage>> runSprayFloat(float spray) throws ButtplugDeviceFeatureException Run spray.- Parameters:
spray- spray value- Returns:
- futures
- Throws:
ButtplugDeviceFeatureException- if an error occurs
-
runOscillateFloat
public List<Future<ButtplugMessage>> runOscillateFloat(float oscillate) throws ButtplugDeviceFeatureException Run oscillate.- Parameters:
oscillate- oscillate value- Returns:
- futures
- Throws:
ButtplugDeviceFeatureException- if an error occurs
-
runPositionFloat
public List<Future<ButtplugMessage>> runPositionFloat(float position) throws ButtplugDeviceFeatureException Run position.- Parameters:
position- position value- Returns:
- futures
- Throws:
ButtplugDeviceFeatureException- if an error occurs
-
runLedFloat
Run LED.- Parameters:
led- LED value- Returns:
- futures
- Throws:
ButtplugDeviceFeatureException- if an error occurs
-
runTemperatureFloat
public List<Future<ButtplugMessage>> runTemperatureFloat(float temperature) throws ButtplugDeviceFeatureException Run temperature.- Parameters:
temperature- temperature value- Returns:
- futures
- Throws:
ButtplugDeviceFeatureException- if an error occurs
-
runConstrictFloat
public List<Future<ButtplugMessage>> runConstrictFloat(float constrict) throws ButtplugDeviceFeatureException Run constrict.- Parameters:
constrict- constrict value- Returns:
- futures
- Throws:
ButtplugDeviceFeatureException- if an error occurs
-
runHwPositionWithDurationFloat
public List<Future<ButtplugMessage>> runHwPositionWithDurationFloat(float position, int duration) throws ButtplugDeviceFeatureException Run HW position with duration.- Parameters:
position- position valueduration- duration- Returns:
- futures
- Throws:
ButtplugDeviceFeatureException- if an error occurs
-