@@ -25,8 +25,128 @@ public bool CanVibrate()
2525
2626 public async Task VibrateAsync ( uint speed )
2727 {
28- var outputCmd = new OutputCommand ( ) ;
29- outputCmd . Vibrate = new OutputCommandValue ( speed ) ;
28+ var outputCmd = new OutputCommand
29+ {
30+ Vibrate = new OutputCommandValue ( speed )
31+ } ;
32+ await _handler . SendMessageExpectOk ( new OutputCmd ( _deviceIndex , _feature . FeatureIndex , outputCmd ) ) ;
33+ }
34+
35+ public bool CanOscillate ( )
36+ {
37+ return _feature . Output . ContainsKey ( OutputType . Oscillate ) ;
38+ }
39+
40+ public async Task OscillateAsync ( uint speed )
41+ {
42+ var outputCmd = new OutputCommand
43+ {
44+ Oscillate = new OutputCommandValue ( speed )
45+ } ;
46+ await _handler . SendMessageExpectOk ( new OutputCmd ( _deviceIndex , _feature . FeatureIndex , outputCmd ) ) ;
47+ }
48+
49+ public bool CanRotate ( )
50+ {
51+ return _feature . Output . ContainsKey ( OutputType . Rotate ) ;
52+ }
53+
54+ public async Task RotateAsync ( uint speed )
55+ {
56+ var outputCmd = new OutputCommand
57+ {
58+ Rotate = new OutputCommandValue ( speed )
59+ } ;
60+ await _handler . SendMessageExpectOk ( new OutputCmd ( _deviceIndex , _feature . FeatureIndex , outputCmd ) ) ;
61+ }
62+
63+ public bool CanConstrict ( )
64+ {
65+ return _feature . Output . ContainsKey ( OutputType . Constrict ) ;
66+ }
67+
68+ public async Task ConstrictAsync ( uint speed )
69+ {
70+ var outputCmd = new OutputCommand
71+ {
72+ Constrict = new OutputCommandValue ( speed )
73+ } ;
74+ await _handler . SendMessageExpectOk ( new OutputCmd ( _deviceIndex , _feature . FeatureIndex , outputCmd ) ) ;
75+ }
76+
77+ public bool CanHeater ( )
78+ {
79+ return _feature . Output . ContainsKey ( OutputType . Heater ) ;
80+ }
81+
82+ public async Task HeaterAsync ( uint speed )
83+ {
84+ var outputCmd = new OutputCommand
85+ {
86+ Heater = new OutputCommandValue ( speed )
87+ } ;
88+ await _handler . SendMessageExpectOk ( new OutputCmd ( _deviceIndex , _feature . FeatureIndex , outputCmd ) ) ;
89+ }
90+
91+ public bool CanSpray ( )
92+ {
93+ return _feature . Output . ContainsKey ( OutputType . Spray ) ;
94+ }
95+
96+ public async Task SprayAsync ( uint speed )
97+ {
98+ var outputCmd = new OutputCommand
99+ {
100+ Spray = new OutputCommandValue ( speed )
101+ } ;
102+ await _handler . SendMessageExpectOk ( new OutputCmd ( _deviceIndex , _feature . FeatureIndex , outputCmd ) ) ;
103+ }
104+
105+ public bool CanLed ( )
106+ {
107+ return _feature . Output . ContainsKey ( OutputType . Led ) ;
108+ }
109+
110+ public async Task LedAsync ( uint speed )
111+ {
112+ var outputCmd = new OutputCommand
113+ {
114+ Led = new OutputCommandValue ( speed )
115+ } ;
116+ await _handler . SendMessageExpectOk ( new OutputCmd ( _deviceIndex , _feature . FeatureIndex , outputCmd ) ) ;
117+ }
118+
119+ public bool CanPositionWithDuration ( )
120+ {
121+ return _feature . Output . ContainsKey ( OutputType . PositionWithDuration ) ;
122+ }
123+
124+ public async Task PositionWithDurationAsync ( uint position , uint duration )
125+ {
126+ var outputCmd = new OutputCommand
127+ {
128+ PositionWithDuration = new OutputCommandPositionWithDuration {
129+ Position = position ,
130+ Duration = duration
131+ }
132+ } ;
133+ await _handler . SendMessageExpectOk ( new OutputCmd ( _deviceIndex , _feature . FeatureIndex , outputCmd ) ) ;
134+ }
135+
136+ public bool CanRotateWithDirection ( )
137+ {
138+ return _feature . Output . ContainsKey ( OutputType . RotateWithDirection ) ;
139+ }
140+
141+ public async Task RotateWithDirectionAsync ( uint speed , bool clockwork )
142+ {
143+ var outputCmd = new OutputCommand
144+ {
145+ RotateWithDirection = new OutputCommandRotationWithDirection {
146+ Speed = speed ,
147+ Clockwise = clockwork
148+ }
149+ } ;
30150 await _handler . SendMessageExpectOk ( new OutputCmd ( _deviceIndex , _feature . FeatureIndex , outputCmd ) ) ;
31151 }
32152 }
0 commit comments