Skip to content

Commit 47e1bcf

Browse files
committed
chore: Update PositionWithDuration to use Value, not Position
No reason to switch here.
1 parent 58f0bbe commit 47e1bcf

File tree

26 files changed

+64
-62
lines changed

26 files changed

+64
-62
lines changed

crates/buttplug_core/schema/buttplug-schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,15 @@
394394
"PositionWithDuration": {
395395
"type": "object",
396396
"properties": {
397-
"Position": {
397+
"Value": {
398398
"$ref": "#/components/RangeInclusive"
399399
},
400400
"Duration": {
401401
"$ref": "#/components/RangeInclusive"
402402
}
403403
},
404404
"required": [
405-
"Position",
405+
"Value",
406406
"Duration"
407407
]
408408
}
@@ -469,7 +469,7 @@
469469
"^PositionWithDuration$": {
470470
"type": "object",
471471
"properties": {
472-
"Position": {
472+
"Value": {
473473
"type": "number",
474474
"minimum": 0
475475
},
@@ -479,7 +479,7 @@
479479
}
480480
},
481481
"required": [
482-
"Position",
482+
"Value",
483483
"Duration"
484484
]
485485
}

crates/buttplug_core/src/message/device_feature.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl DeviceFeatureOutputLimits for DeviceFeatureOutputValueProperties {
156156
pub struct DeviceFeatureOutputPositionWithDurationProperties {
157157
#[getset(get = "pub")]
158158
#[serde(serialize_with = "range_serialize")]
159-
position: RangeInclusive<i32>,
159+
value: RangeInclusive<i32>,
160160
#[getset(get = "pub")]
161161
#[serde(serialize_with = "range_serialize")]
162162
duration: RangeInclusive<i32>,
@@ -165,13 +165,13 @@ pub struct DeviceFeatureOutputPositionWithDurationProperties {
165165
impl DeviceFeatureOutputPositionWithDurationProperties {
166166
pub fn new(position: &RangeInclusive<i32>, duration: &RangeInclusive<i32>) -> Self {
167167
DeviceFeatureOutputPositionWithDurationProperties {
168-
position: position.clone(),
168+
value: position.clone(),
169169
duration: duration.clone(),
170170
}
171171
}
172172

173173
pub fn step_count(&self) -> u32 {
174-
*self.position.end() as u32
174+
*self.value.end() as u32
175175
}
176176
}
177177

@@ -180,7 +180,7 @@ impl DeviceFeatureOutputLimits for DeviceFeatureOutputPositionWithDurationProper
180180
self.step_count()
181181
}
182182
fn step_limit(&self) -> RangeInclusive<i32> {
183-
self.position.clone()
183+
self.value.clone()
184184
}
185185
}
186186

crates/buttplug_core/src/message/v4/output_cmd.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ impl OutputValue {
3535
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, CopyGetters)]
3636
#[getset(get_copy = "pub")]
3737
pub struct OutputPositionWithDuration {
38-
#[serde(rename = "Position")]
39-
position: u32,
38+
#[serde(rename = "Value")]
39+
value: u32,
4040
#[serde(rename = "Duration")]
4141
duration: u32,
4242
}
4343

4444
impl OutputPositionWithDuration {
45-
pub fn new(position: u32, duration: u32) -> Self {
46-
Self { position, duration }
45+
pub fn new(value: u32, duration: u32) -> Self {
46+
Self { value, duration }
4747
}
4848
}
4949

@@ -73,8 +73,8 @@ impl OutputCommand {
7373
| OutputCommand::Oscillate(x)
7474
| OutputCommand::Position(x)
7575
| OutputCommand::Rotate(x)
76-
| OutputCommand::Vibrate(x) => x.value(),
77-
OutputCommand::PositionWithDuration(x) => x.position() as i32,
76+
| OutputCommand::Vibrate(x) => x.value() as i32,
77+
| OutputCommand::PositionWithDuration(x) => x.value() as i32,
7878
}
7979
}
8080

@@ -88,7 +88,7 @@ impl OutputCommand {
8888
| OutputCommand::Position(x)
8989
| OutputCommand::Rotate(x)
9090
| OutputCommand::Vibrate(x) => x.value = value,
91-
OutputCommand::PositionWithDuration(x) => x.position = value as u32,
91+
OutputCommand::PositionWithDuration(x) => x.value = value as u32,
9292
}
9393
}
9494

crates/buttplug_server/src/device/protocol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ pub trait ProtocolHandler: Sync + Send {
277277
OutputCommand::PositionWithDuration(x) => self.handle_position_with_duration_cmd(
278278
cmd.feature_index(),
279279
cmd.feature_id(),
280-
x.position(),
280+
x.value(),
281281
x.duration(),
282282
),
283283
}

crates/buttplug_server_device_config/build-config/buttplug-device-config-v4.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": {
33
"major": 4,
4-
"minor": 145
4+
"minor": 147
55
},
66
"protocols": {
77
"activejoy": {
@@ -843,7 +843,7 @@
843843
0,
844844
100000
845845
],
846-
"position": [
846+
"value": [
847847
0,
848848
180
849849
]
@@ -1342,7 +1342,7 @@
13421342
0,
13431343
100000
13441344
],
1345-
"position": [
1345+
"value": [
13461346
0,
13471347
15
13481348
]
@@ -8833,7 +8833,7 @@
88338833
0,
88348834
100000
88358835
],
8836-
"position": [
8836+
"value": [
88378837
0,
88388838
4
88398839
]
@@ -8904,7 +8904,7 @@
89048904
0,
89058905
100000
89068906
],
8907-
"position": [
8907+
"value": [
89088908
0,
89098909
99
89108910
]
@@ -9302,7 +9302,7 @@
93029302
0,
93039303
100000
93049304
],
9305-
"position": [
9305+
"value": [
93069306
0,
93079307
99
93089308
]
@@ -9570,7 +9570,7 @@
95709570
0,
95719571
100000
95729572
],
9573-
"position": [
9573+
"value": [
95749574
0,
95759575
99
95769576
]
@@ -9595,7 +9595,7 @@
95959595
0,
95969596
100000
95979597
],
9598-
"position": [
9598+
"value": [
95999599
0,
96009600
99
96019601
]
@@ -9620,7 +9620,7 @@
96209620
0,
96219621
100000
96229622
],
9623-
"position": [
9623+
"value": [
96249624
0,
96259625
99
96269626
]
@@ -9646,7 +9646,7 @@
96469646
0,
96479647
100000
96489648
],
9649-
"position": [
9649+
"value": [
96509650
0,
96519651
99
96529652
]
@@ -9698,7 +9698,7 @@
96989698
0,
96999699
100000
97009700
],
9701-
"position": [
9701+
"value": [
97029702
0,
97039703
99
97049704
]
@@ -10532,7 +10532,7 @@
1053210532
0,
1053310533
100000
1053410534
],
10535-
"position": [
10535+
"value": [
1053610536
0,
1053710537
1000
1053810538
]
@@ -11812,7 +11812,7 @@
1181211812
0,
1181311813
100000
1181411814
],
11815-
"position": [
11815+
"value": [
1181611816
0,
1181711817
100
1181811818
]
@@ -15316,7 +15316,7 @@
1531615316
0,
1531715317
100000
1531815318
],
15319-
"position": [
15319+
"value": [
1532015320
0,
1532115321
99
1532215322
]
@@ -17888,7 +17888,7 @@
1788817888
0,
1788917889
100000
1789017890
],
17891-
"position": [
17891+
"value": [
1789217892
0,
1789317893
100
1789417894
]
@@ -20102,7 +20102,7 @@
2010220102
0,
2010320103
100000
2010420104
],
20105-
"position": [
20105+
"value": [
2010620106
0,
2010720107
100
2010820108
]
@@ -20182,7 +20182,7 @@
2018220182
0,
2018320183
100000
2018420184
],
20185-
"position": [
20185+
"value": [
2018620186
0,
2018720187
100
2018820188
]
@@ -20854,7 +20854,7 @@
2085420854
0,
2085520855
100000
2085620856
],
20857-
"position": [
20857+
"value": [
2085820858
0,
2085920859
99
2086020860
]

crates/buttplug_server_device_config/device-config-v4/buttplug-device-config-schema-v4.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@
204204
"^position_with_duration$": {
205205
"type": "object",
206206
"properties": {
207-
"position": {
207+
"value": {
208208
"$ref": "#/components/value-range"
209209
},
210210
"duration": {
211211
"$ref": "#/components/value-range"
212212
}
213213
},
214-
"required": [
215-
"position",
214+
"value": [
215+
"value",
216216
"duration"
217217
]
218218
}
@@ -309,7 +309,7 @@
309309
"^position_with_duration$": {
310310
"type": "object",
311311
"properties": {
312-
"position": {
312+
"value": {
313313
"$ref": "#/components/value-range"
314314
},
315315
"duration": {

crates/buttplug_server_device_config/device-config-v4/protocols/fleshy-thrust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defaults:
55
- id: a8185061-6d41-4eea-bc24-1ff1c5c405b9
66
output:
77
position_with_duration:
8-
position:
8+
value:
99
- 0
1010
- 180
1111
duration:

crates/buttplug_server_device_config/device-config-v4/protocols/fredorch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defaults:
55
- id: d3985f07-f95a-4f72-859e-8b0ac76f251f
66
output:
77
position_with_duration:
8-
position:
8+
value:
99
- 0
1010
- 15
1111
duration:

crates/buttplug_server_device_config/device-config-v4/protocols/kiiroo-v1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ configurations:
2323
- id: 2fe100ee-4665-4132-b4c6-d70a4037d6ac
2424
output:
2525
position_with_duration:
26-
position:
26+
value:
2727
- 0
2828
- 4
2929
duration:

crates/buttplug_server_device_config/device-config-v4/protocols/kiiroo-v2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defaults:
55
- id: 49b06ca8-dd4d-4306-91c6-931143dee212
66
output:
77
position_with_duration:
8-
position:
8+
value:
99
- 0
1010
- 99
1111
duration:

0 commit comments

Comments
 (0)