Skip to content

Commit

Permalink
chore: Make hid/usb/serial device configs be lists
Browse files Browse the repository at this point in the history
Will make it easier to merge data from user configurations
  • Loading branch information
qdot committed Apr 11, 2020
1 parent 576ac43 commit 3973697
Show file tree
Hide file tree
Showing 3 changed files with 159 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,36 @@
]
},
"serial-definition": {
"type": "object",
"properties": {
"baud-rate": {
"type": "integer"
},
"data-bits": {
"type": "integer"
},
"parity": {
"type": "string"
"type": "array",
"items": {
"type": "object",
"properties": {
"port": {
"type": "string"
},
"baud-rate": {
"type": "integer"
},
"data-bits": {
"type": "integer"
},
"parity": {
"type": "string"
},
"stop-bits": {
"type": "integer"
}
},
"stop-bits": {
"type": "integer"
}
"required": [
"port",
"baud-rate",
"data-bits",
"parity",
"stop-bits"
],
"additionalProperties": false
},
"required": [
"baud-rate",
"data-bits",
"parity",
"stop-bits"
],
"additionalProperties": false
"minItems": 1
},
"xinput-definition": {
"type": "object",
Expand All @@ -74,24 +82,28 @@
}
},
"usb-definition": {
"type": "object",
"properties": {
"vendor-id": {
"type": "integer",
"minimum": 0,
"maximum": 65535
"type": "array",
"items": {
"type": "object",
"properties": {
"vendor-id": {
"type": "integer",
"minimum": 0,
"maximum": 65535
},
"product-id": {
"type": "integer",
"minimum": 0,
"maximum": 65535
}
},
"product-id": {
"type": "integer",
"minimum": 0,
"maximum": 65535
}
"required": [
"vendor-id",
"product-id"
],
"additionalProperties": false
},
"required": [
"vendor-id",
"product-id"
],
"additionalProperties": false
"minItems": 1
},
"FeatureCount": {
"description": "Number of features on device.",
Expand Down Expand Up @@ -127,9 +139,15 @@
"description": "Attributes for device messages.",
"type": "object",
"properties": {
"FeatureCount": { "$ref": "#/components/FeatureCount" },
"StepCount": { "$ref": "#/components/StepCount" },
"FeatureOrder": { "$ref": "#/components/FeatureOrder" }
"FeatureCount": {
"$ref": "#/components/FeatureCount"
},
"StepCount": {
"$ref": "#/components/StepCount"
},
"FeatureOrder": {
"$ref": "#/components/FeatureOrder"
}
},
"additionalProperties": false,
"minProperties": 0
Expand All @@ -153,8 +171,12 @@
"description": "Attributes for PatternPlaybackCmd.",
"type": "object",
"properties": {
"FeatureCount": { "$ref": "#/components/FeatureCount" },
"StepCount": { "$ref": "#/components/StepCount" },
"FeatureCount": {
"$ref": "#/components/FeatureCount"
},
"StepCount": {
"$ref": "#/components/StepCount"
},
"ActuatorType": {
"description": "Types of actuators for pattern playback (Vibrate, Rotate, Linear)",
"type": "array",
Expand All @@ -180,8 +202,12 @@
"description": "Attributes for ShockCmd.",
"type": "object",
"properties": {
"FeatureCount": { "$ref": "#/components/FeatureCount" },
"StepCount": { "$ref": "#/components/StepCount" },
"FeatureCount": {
"$ref": "#/components/FeatureCount"
},
"StepCount": {
"$ref": "#/components/StepCount"
},
"MaxDuration": {
"description": "Maximum duration of shock for each actuator",
"type": "array",
Expand All @@ -198,23 +224,57 @@
"description": "A list of the messages a device will accept on this server implementation.",
"type": "object",
"properties": {
"StopDeviceCmd": { "$ref": "#/components/NullMessageAttributes" },
"VibrateCmd": { "$ref": "#/components/GenericMessageAttributes" },
"LinearCmd": { "$ref": "#/components/GenericMessageAttributes" },
"RotateCmd": { "$ref": "#/components/GenericMessageAttributes" },
"LovenseCmd": { "$ref": "#/components/NullMessageAttributes" },
"VorzeA10CycloneCmd": { "$ref": "#/components/NullMessageAttributes" },
"KiirooCmd": { "$ref": "#/components/NullMessageAttributes" },
"SingleMotorVibrateCmd": { "$ref": "#/components/NullMessageAttributes" },
"BatteryLevelCmd": { "$ref": "#/components/NullMessageAttributes" },
"RSSILevelCmd": { "$ref": "#/components/NullMessageAttributes" },
"RawReadCmd": { "$ref": "#/components/RawMessageAttributes" },
"RawWriteCmd": { "$ref": "#/components/RawMessageAttributes" },
"RawSubscribeCmd": { "$ref": "#/components/RawMessageAttributes" },
"RawUnsubscribeCmd": { "$ref": "#/components/RawMessageAttributes" },
"PatternPlaybackCmd": { "$ref": "#/components/PatternMessageAttributes" },
"ShockCmd": { "$ref": "#/components/ShockMessageAttributes" },
"ToneEmitterCmd": { "$ref": "#/components/GenericMessageAttributes" }
"StopDeviceCmd": {
"$ref": "#/components/NullMessageAttributes"
},
"VibrateCmd": {
"$ref": "#/components/GenericMessageAttributes"
},
"LinearCmd": {
"$ref": "#/components/GenericMessageAttributes"
},
"RotateCmd": {
"$ref": "#/components/GenericMessageAttributes"
},
"LovenseCmd": {
"$ref": "#/components/NullMessageAttributes"
},
"VorzeA10CycloneCmd": {
"$ref": "#/components/NullMessageAttributes"
},
"KiirooCmd": {
"$ref": "#/components/NullMessageAttributes"
},
"SingleMotorVibrateCmd": {
"$ref": "#/components/NullMessageAttributes"
},
"BatteryLevelCmd": {
"$ref": "#/components/NullMessageAttributes"
},
"RSSILevelCmd": {
"$ref": "#/components/NullMessageAttributes"
},
"RawReadCmd": {
"$ref": "#/components/RawMessageAttributes"
},
"RawWriteCmd": {
"$ref": "#/components/RawMessageAttributes"
},
"RawSubscribeCmd": {
"$ref": "#/components/RawMessageAttributes"
},
"RawUnsubscribeCmd": {
"$ref": "#/components/RawMessageAttributes"
},
"PatternPlaybackCmd": {
"$ref": "#/components/PatternMessageAttributes"
},
"ShockCmd": {
"$ref": "#/components/ShockMessageAttributes"
},
"ToneEmitterCmd": {
"$ref": "#/components/GenericMessageAttributes"
}
},
"additionalProperties": false
},
Expand Down Expand Up @@ -318,4 +378,4 @@
"protocols"
],
"additionalProperties": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1402,12 +1402,15 @@
]
},
"erostek-et312": {
"serial": {
"baud-rate": 19200,
"data-bits": 8,
"parity": "N",
"stop-bits": 1
},
"serial": [
{
"port": "default",
"baud-rate": 19200,
"data-bits": 8,
"parity": "N",
"stop-bits": 1
}
],
"defaults": {
"messages": {
"LinearCmd": {
Expand All @@ -1430,10 +1433,12 @@
]
},
"vorze-cyclone-x": {
"hid": {
"vendor-id": 1155,
"product-id": 22352
},
"hid": [
{
"vendor-id": 1155,
"product-id": 22352
}
],
"defaults": {
"messages": {
"RotateCmd": {
Expand All @@ -1456,10 +1461,12 @@
]
},
"rez-trancevibrator": {
"usb": {
"vendor-id": 2889,
"product-id": 1615
},
"usb": [
{
"vendor-id": 2889,
"product-id": 1615
}
],
"defaults": {
"messages": {
"VibrateCmd": {
Expand Down Expand Up @@ -1641,10 +1648,12 @@
]
},
"realtouch": {
"hid": {
"vendor-id": 8020,
"product-id": 1
},
"hid": [
{
"vendor-id": 8020,
"product-id": 1
}
],
"defaults": {
"messages": {
"LinearCmd": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1013,11 +1013,11 @@ protocols:
- 99
erostek-et312:
serial:
# Port names are defined in user configs
baud-rate: 19200
data-bits: 8
parity: N
stop-bits: 1
- port: default
baud-rate: 19200
data-bits: 8
parity: N
stop-bits: 1
defaults:
messages:
LinearCmd:
Expand All @@ -1031,8 +1031,8 @@ protocols:
en-us: Erostek ET312
vorze-cyclone-x:
hid:
vendor-id: 0x0483
product-id: 0x5750
- vendor-id: 0x0483
product-id: 0x5750
defaults:
messages:
RotateCmd:
Expand All @@ -1046,8 +1046,8 @@ protocols:
en-us: Rends Cyclone X10
rez-trancevibrator:
usb:
vendor-id: 0xb49
product-id: 0x064f
- vendor-id: 0xb49
product-id: 0x064f
defaults:
messages:
VibrateCmd:
Expand Down Expand Up @@ -1160,8 +1160,8 @@ protocols:
en-us: Youou Wand Vibrator
realtouch:
hid:
vendor-id: 0x1f54
product-id: 0x0001
- vendor-id: 0x1f54
product-id: 0x0001
defaults:
messages:
LinearCmd:
Expand Down

0 comments on commit 3973697

Please sign in to comment.