{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Buttplug Device Config Schema", "version": 2, "description": "JSON format for Buttplug Device Config Files.", "components": { "uuid": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" }, "endpoint": { "type": "object", "patternProperties": { "^(command|firmware|rx|rxaccel|rxblebattery|rxblemodel|rxpressure|rxtouch|tx|txmode|txshock|txvibrate|txvendorcontrol|whitelist|generic[1-2]?[0-9]|generic3[0-1])$": { "$ref": "#/components/uuid" } }, "additionalProperties": false, "minProperties": 1 }, "btle-definition": { "type": "object", "properties": { "names": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "manufacturer-data": { "type": "array", "items": { "type": "object", "properties": { "company": { "type": "integer" }, "expected-length": { "type": "integer" }, "data": { "type": "array", "items": { "type": "integer" } } }, "required": [ "company" ] } }, "advertised-services": { "type": "array", "items": { "type": "string", "$ref": "#/components/uuid" } }, "services": { "type": "object", "patternProperties": { "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$": { "$ref": "#/components/endpoint" } }, "minProperties": 1, "additionalProperties": false } }, "additionalProperties": false, "required": [ "names", "services" ] }, "websocket-definition": { "type": "object", "properties": { "names": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false, "required": [ "names" ] }, "serial-definition": { "type": "array", "items": { "type": "object", "properties": { "port": { "type": "string" }, "baud-rate": { "type": "integer" }, "data-bits": { "type": "integer" }, "parity": { "type": "string" }, "stop-bits": { "type": "integer" } }, "required": [ "port", "baud-rate", "data-bits", "parity", "stop-bits" ], "additionalProperties": false }, "minItems": 1 }, "xinput-definition": { "type": "object", "properties": { "exists": { "type": "boolean" } } }, "lovense-connect-service-definition": { "type": "object", "properties": { "exists": { "type": "boolean" } } }, "usb-definition": { "type": "array", "items": { "type": "object", "properties": { "vendor-id": { "type": "integer", "minimum": 0, "maximum": 65535 }, "product-id": { "type": "integer", "minimum": 0, "maximum": 65535 } }, "required": [ "vendor-id", "product-id" ], "additionalProperties": false }, "minItems": 1 }, "FeatureCount": { "description": "Number of features on device.", "type": "integer", "minimum": 1 }, "StepRange": { "description": "Specifies the range of steps to use for a device. Devices will use the low end value as a stop.", "type": "array", "items": { "type": "integer" }, "minItems": 2, "maxItems": 2 }, "FeatureOrder": { "description": "Specifies the order features are exposed in by the ButtplugMessages.", "minimum": 0, "type": "integer" }, "NullMessageAttributes": { "description": "Attributes for device message that have no attributes.", "type": "object", "additionalProperties": false, "minProperties": 0, "maxProperties": 0 }, "GenericMessageAttributes": { "description": "Attributes for device messages.", "type": "array", "items": { "type": "object", "properties": { "StepRange": { "$ref": "#/components/StepRange" }, "FeatureOrder": { "$ref": "#/components/FeatureOrder" }, "FeatureDescriptor": { "type": "string" }, "ActuatorType": { "type": "string", "pattern": "^(Vibrate|Rotate|Oscillate|Constrict|Inflate|Position)$" } }, "required": [ "StepRange", "ActuatorType" ], "additionalProperties": false, "minProperties": 0 }, "minItems": 1 }, "SensorMessageAttributes": { "description": "Attributes for sensor messages.", "type": "array", "items": { "type": "object", "properties": { "SensorType": { "type": "string" }, "FeatureDescriptor": { "type": "string" }, "SensorRange": { "type": "array", "items": { "$ref": "#/components/StepRange" }, "minItems": 1 } }, "required": [ "SensorType", "FeatureDescriptor", "SensorRange" ], "additionalProperties": false, "minProperties": 0 }, "minItems": 1 }, "DeviceMessagesEx": { "description": "A list of the messages a device will accept on this server implementation.", "type": "object", "properties": { "StopDeviceCmd": { "$ref": "#/components/NullMessageAttributes" }, "ScalarCmd": { "$ref": "#/components/GenericMessageAttributes" }, "VibrateCmd": { "$ref": "#/components/GenericMessageAttributes" }, "LinearCmd": { "$ref": "#/components/GenericMessageAttributes" }, "RotateCmd": { "$ref": "#/components/GenericMessageAttributes" }, "SensorReadCmd": { "$ref": "#/components/SensorMessageAttributes" }, "SensorSubscribeCmd": { "$ref": "#/components/SensorMessageAttributes" }, "SensorUnsubscribeCmd": { "$ref": "#/components/SensorMessageAttributes" }, "LovenseCmd": { "$ref": "#/components/NullMessageAttributes" }, "VorzeA10CycloneCmd": { "$ref": "#/components/NullMessageAttributes" }, "KiirooCmd": { "$ref": "#/components/NullMessageAttributes" }, "SingleMotorVibrateCmd": { "$ref": "#/components/NullMessageAttributes" }, "FleshlightLaunchFW12Cmd": { "$ref": "#/components/NullMessageAttributes" } }, "additionalProperties": false }, "UserDeviceMessagesEx": { "description": "A list of the messages that can be configured in user device settings.", "type": "object", "properties": { "ScalarCmd": { "$ref": "#/components/GenericMessageAttributes" }, "VibrateCmd": { "$ref": "#/components/GenericMessageAttributes" }, "LinearCmd": { "$ref": "#/components/GenericMessageAttributes" }, "RotateCmd": { "$ref": "#/components/GenericMessageAttributes" } }, "additionalProperties": false }, "user-config": { "type": "object", "properties": { "allow": { "type": "boolean" }, "deny": { "type": "boolean" }, "display-name": { "type": "string" }, "index": { "type": "integer" }, "messages": { "$ref": "#/components/UserDeviceMessagesEx" } }, "additionalProperties": false }, "defaults-definition": { "type": "object", "properties": { "name": { "type": "string" }, "messages": { "$ref": "#/components/DeviceMessagesEx" } }, "required": [ "name", "messages" ] }, "configurations-definition": { "type": "array", "items": { "type": "object", "properties": { "identifier": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "name": { "type": "string" }, "messages": { "$ref": "#/components/DeviceMessagesEx" } }, "required": [ "identifier" ], "additionalProperties": false }, "minItems": 1 } }, "type": "object", "properties": { "version": { "description": "Version of the device configuration file.", "type": "object", "properties": { "major": { "type": "integer", "minimum": 1 }, "minor": { "type": "integer", "minimum": 0 } } }, "protocols": { "type": "object", "patternProperties": { "^.*$": { "type": "object", "properties": { "btle": { "$ref": "#/components/btle-definition" }, "serial": { "$ref": "#/components/serial-definition" }, "websocket": { "$ref": "#/components/websocket-definition" }, "usb": { "$ref": "#/components/usb-definition" }, "hid": { "$ref": "#/components/usb-definition" }, "xinput": { "$ref": "#/components/xinput-definition" }, "lovense-connect-service": { "$ref": "#/components/lovense-connect-service-definition" }, "defaults": { "$ref": "#/components/defaults-definition" }, "configurations": { "$ref": "#/components/configurations-definition" } } } }, "additionalProperties": false }, "user-configs": { "type": "object", "properties": { "specifiers": { "type": "object", "patternProperties": { "^.*$": { "type": "object", "properties": { "btle": { "$ref": "#/components/btle-definition" }, "serial": { "$ref": "#/components/serial-definition" }, "websocket": { "$ref": "#/components/websocket-definition" }, "usb": { "$ref": "#/components/usb-definition" }, "hid": { "$ref": "#/components/usb-definition" } } }, "additionalProperties": false } }, "devices": { "type": "array", "items": { "type": "object", "properties": { "identifier": { "type": "object", "properties": { "address": { "type": "string" }, "protocol": { "type": "string" }, "identifier": { "type": "string" } }, "additionalProperties": false, "required": [ "address", "protocol" ] }, "config": { "$ref": "#/components/user-config" } }, "additionalProperties": false, "required": [ "identifier", "config" ] } } }, "additionalProperties": false }, "additionalProperties": false }, "required": [ "version" ], "additionalProperties": false }