@@ -5,7 +5,7 @@ use buttplug_core::{
55 errors:: { ButtplugDeviceError , ButtplugError , ButtplugMessageError } ,
66 message:: {
77 ButtplugDeviceMessageNameV4 , ButtplugServerMessageV4 , DeviceFeature , DeviceFeatureOutputLimits ,
8- InputCmdV4 , InputCommandType , InputType , InputTypeData , OutputCmdV4 , OutputCommand ,
8+ InputCmdV4 , InputCommandType , InputType , InputTypeReading , OutputCmdV4 , OutputCommand ,
99 OutputPositionWithDuration , OutputType , OutputValue ,
1010 } ,
1111} ;
@@ -244,7 +244,7 @@ impl ClientDeviceFeature {
244244 )
245245 }
246246
247- fn read_sensor ( & self , sensor_type : InputType ) -> ButtplugClientResultFuture < InputTypeData > {
247+ fn read_input ( & self , sensor_type : InputType ) -> ButtplugClientResultFuture < InputTypeReading > {
248248 if let Some ( sensor_map) = self . feature . input ( )
249249 && let Some ( sensor) = sensor_map. get ( sensor_type)
250250 && sensor. input_commands ( ) . contains ( & InputCommandType :: Read )
@@ -259,8 +259,8 @@ impl ClientDeviceFeature {
259259 let reply = self . event_loop_sender . send_message ( msg) ;
260260 return async move {
261261 if let ButtplugServerMessageV4 :: InputReading ( data) = reply. await ? {
262- if sensor_type == data. data ( ) . as_input_type ( ) {
263- Ok ( data. data ( ) )
262+ if sensor_type == data. reading ( ) . into ( ) {
263+ Ok ( data. reading ( ) )
264264 } else {
265265 Err (
266266 ButtplugError :: ButtplugMessageError ( ButtplugMessageError :: UnexpectedMessageType (
@@ -295,10 +295,10 @@ impl ClientDeviceFeature {
295295 . unwrap ( )
296296 . contains ( InputType :: Battery )
297297 {
298- let send_fut = self . read_sensor ( InputType :: Battery ) ;
298+ let send_fut = self . read_input ( InputType :: Battery ) ;
299299 Box :: pin ( async move {
300300 let data = send_fut. await ?;
301- let battery_level = if let InputTypeData :: Battery ( level) = data {
301+ let battery_level = if let InputTypeReading :: Battery ( level) = data {
302302 level. data ( )
303303 } else {
304304 0
@@ -322,10 +322,10 @@ impl ClientDeviceFeature {
322322 . unwrap ( )
323323 . contains ( InputType :: Rssi )
324324 {
325- let send_fut = self . read_sensor ( InputType :: Rssi ) ;
325+ let send_fut = self . read_input ( InputType :: Rssi ) ;
326326 Box :: pin ( async move {
327327 let data = send_fut. await ?;
328- let rssi_level = if let InputTypeData :: Rssi ( level) = data {
328+ let rssi_level = if let InputTypeReading :: Rssi ( level) = data {
329329 level. data ( )
330330 } else {
331331 0
0 commit comments