Class ButtplugClientDeviceFeature
java.lang.Object
io.github.blackspherefollower.buttplug4j.client.ButtplugClientDeviceFeature
ButtplugClientDeviceFeature.
-
Constructor Summary
ConstructorsConstructorDescriptionButtplugClientDeviceFeature(ButtplugClientDevice device, DeviceFeature feature) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet feature description.intGet feature index.getInput()Get inputs.Get outputs.booleanCheck if battery is supported.booleanCheck if constrict is supported.inthashCode()booleanCheck if HW position with duration is supported.booleanhasInput(ButtplugInput inputType) Check if input is supported.booleanhasLed()Check if LED is supported.booleanCheck if oscillate is supported.booleanhasOutput(ButtplugOutput type) Check if output is supported.booleanCheck if position is supported.booleanCheck if rotate is supported.booleanhasRSSI()Check if RSSI is supported.booleanhasSpray()Check if spray is supported.booleanCheck if temperature is supported.booleanCheck if vibrate is supported.intRead battery level.intreadRSSI()Read RSSI level.runConstrict(int constrict) Run constrict.runConstrictFloat(float constrict) Run constrict.runHwPositionWithDuration(int position, int duration) Run HW position with duration.runHwPositionWithDurationFloat(float position, int duration) Run HW position with duration.runLed(int led) Run LED.runLedFloat(float led) Run LED.runOscillate(int oscillate) Run oscillate.runOscillateFloat(float oscillate) Run oscillate.runPosition(int position) Run position.runPositionFloat(float position) Run position.runRotate(int rotate) Run rotate.runRotateFloat(float rotate) Run rotate.runSpray(int spray) Run spray.runSprayFloat(float spray) Run spray.runTemperature(int temperature) Run temperature.runTemperatureFloat(float temperature) Run temperature.runVibrate(int vibrate) Run vibrate.runVibrateFloat(float vibrate) Run vibrate.
-
Constructor Details
-
ButtplugClientDeviceFeature
Constructor.- Parameters:
device- parent devicefeature- protocol feature
-
-
Method Details
-
getOutput
Get outputs.- Returns:
- outputs
-
getInput
Get inputs.- Returns:
- inputs
-
getFeatureIndex
public int getFeatureIndex()Get feature index.- Returns:
- feature index
-
getDescription
Get feature description.- Returns:
- description
-
hasOutput
Check if output is supported.- Parameters:
type- output type- Returns:
- true if supported
-
hasVibrate
public boolean hasVibrate()Check if vibrate is supported.- Returns:
- true if supported
-
runVibrate
Run vibrate.- Parameters:
vibrate- step count- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
runVibrateFloat
Run vibrate.- Parameters:
vibrate- float value (0.0 to 1.0)- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
hasRotate
public boolean hasRotate()Check if rotate is supported.- Returns:
- true if supported
-
runRotate
Run rotate.- Parameters:
rotate- step count- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
runRotateFloat
Run rotate.- Parameters:
rotate- float value (0.0 to 1.0)- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
hasConstrict
public boolean hasConstrict()Check if constrict is supported.- Returns:
- true if supported
-
runConstrict
Run constrict.- Parameters:
constrict- step count- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
runConstrictFloat
public Future<ButtplugMessage> runConstrictFloat(float constrict) throws ButtplugDeviceFeatureException Run constrict.- Parameters:
constrict- float value (0.0 to 1.0)- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
hasSpray
public boolean hasSpray()Check if spray is supported.- Returns:
- true if supported
-
runSpray
Run spray.- Parameters:
spray- step count- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
runSprayFloat
Run spray.- Parameters:
spray- float value (0.0 to 1.0)- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
hasPosition
public boolean hasPosition()Check if position is supported.- Returns:
- true if supported
-
runPosition
Run position.- Parameters:
position- step count- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
runPositionFloat
public Future<ButtplugMessage> runPositionFloat(float position) throws ButtplugDeviceFeatureException Run position.- Parameters:
position- float value (0.0 to 1.0)- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
hasHwPositionWithDuration
public boolean hasHwPositionWithDuration()Check if HW position with duration is supported.- Returns:
- true if supported
-
runHwPositionWithDuration
public Future<ButtplugMessage> runHwPositionWithDuration(int position, int duration) throws ButtplugDeviceFeatureException Run HW position with duration.- Parameters:
position- step countduration- duration in ms- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
runHwPositionWithDurationFloat
public Future<ButtplugMessage> runHwPositionWithDurationFloat(float position, int duration) throws ButtplugDeviceFeatureException Run HW position with duration.- Parameters:
position- float value (0.0 to 1.0)duration- duration in ms- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
hasLed
public boolean hasLed()Check if LED is supported.- Returns:
- true if supported
-
runLed
Run LED.- Parameters:
led- step count- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
runLedFloat
Run LED.- Parameters:
led- float value (0.0 to 1.0)- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
hasOscillate
public boolean hasOscillate()Check if oscillate is supported.- Returns:
- true if supported
-
runOscillate
Run oscillate.- Parameters:
oscillate- step count- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
runOscillateFloat
public Future<ButtplugMessage> runOscillateFloat(float oscillate) throws ButtplugDeviceFeatureException Run oscillate.- Parameters:
oscillate- float value (0.0 to 1.0)- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
hasTemperature
public boolean hasTemperature()Check if temperature is supported.- Returns:
- true if supported
-
runTemperature
public Future<ButtplugMessage> runTemperature(int temperature) throws ButtplugDeviceFeatureException Run temperature.- Parameters:
temperature- step count- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
runTemperatureFloat
public Future<ButtplugMessage> runTemperatureFloat(float temperature) throws ButtplugDeviceFeatureException Run temperature.- Parameters:
temperature- float value (0.0 to 1.0)- Returns:
- future
- Throws:
ButtplugDeviceFeatureException- if error occurs
-
hasBattery
public boolean hasBattery()Check if battery is supported.- Returns:
- true if supported
-
readBattery
public int readBattery() throws ButtplugException, ExecutionException, InterruptedException, TimeoutExceptionRead battery level.- Returns:
- battery level
- Throws:
ButtplugException- if error occursExecutionException- if error occursInterruptedException- if error occursTimeoutException- if error occurs
-
hasRSSI
public boolean hasRSSI()Check if RSSI is supported.- Returns:
- true if supported
-
readRSSI
public int readRSSI() throws ButtplugException, ExecutionException, InterruptedException, TimeoutExceptionRead RSSI level.- Returns:
- RSSI level
- Throws:
ButtplugException- if error occursExecutionException- if error occursInterruptedException- if error occursTimeoutException- if error occurs
-
equals
-
hashCode
public int hashCode() -
hasInput
Check if input is supported.- Parameters:
inputType- input type- Returns:
- true if supported
-