Buttplug sex toy control library
at dev 2366 lines 69 kB view raw
1{ 2 "$schema": "http://json-schema.org/draft-07/schema#", 3 "title": "Buttplug Message Schema", 4 "version": 3, 5 "description": "The JSON Protocol format for the Buttplug Protocol.", 6 "components": { 7 "ClientId": { 8 "description": "User-set id for the message. 0 denotes system message and is reserved.", 9 "type": "integer", 10 "minimum": 1, 11 "maximum": 4294967295 12 }, 13 "ServerId": { 14 "description": "User-set id for the message. 0 denotes system message and is reserved.", 15 "type": "integer", 16 "minimum": 0, 17 "maximum": 4294967295 18 }, 19 "SystemId": { 20 "description": "Used for non-direct-reply messages that can only be sent from server to client, using the reserved system message Id of 0.", 21 "type": "integer", 22 "minimum": 0, 23 "maximum": 0 24 }, 25 "DeviceName": { 26 "description": "Name of the device", 27 "type": "string" 28 }, 29 "DeviceIndex": { 30 "description": "Index used for referencing the device in device messages.", 31 "type": "integer", 32 "minimum": 0 33 }, 34 "ClientIdMessage": { 35 "description": "Message types that are expected to have an Id and nothing else.", 36 "properties": { 37 "Id": { 38 "$ref": "#/components/ClientId" 39 } 40 }, 41 "additionalProperties": false, 42 "minProperties": 1, 43 "maxProperties": 1, 44 "required": [ 45 "Id" 46 ] 47 }, 48 "ServerIdMessage": { 49 "description": "Message types that are expected to have an Id and nothing else, from the server side, which may be either a reply or an event (id 0).", 50 "properties": { 51 "Id": { 52 "$ref": "#/components/ServerId" 53 } 54 }, 55 "additionalProperties": false, 56 "minProperties": 1, 57 "maxProperties": 1, 58 "required": [ 59 "Id" 60 ] 61 }, 62 "SystemIdMessage": { 63 "description": "Message sent by the server that is not in direct reply to a message send from the client, and always uses system Id.", 64 "properties": { 65 "Id": { 66 "$ref": "#/components/SystemId" 67 } 68 }, 69 "additionalProperties": false, 70 "required": [ 71 "Id" 72 ] 73 }, 74 "SystemIdDeviceIndexMessage": { 75 "properties": { 76 "Id": { 77 "$ref": "#/components/SystemId" 78 }, 79 "DeviceIndex": { 80 "$ref": "#/components/DeviceIndex" 81 } 82 }, 83 "additionalProperties": false, 84 "required": [ 85 "Id", 86 "DeviceIndex" 87 ] 88 }, 89 "ClientIdDeviceIndexMessage": { 90 "properties": { 91 "Id": { 92 "$ref": "#/components/ClientId" 93 }, 94 "DeviceIndex": { 95 "$ref": "#/components/DeviceIndex" 96 } 97 }, 98 "additionalProperties": false, 99 "required": [ 100 "Id", 101 "DeviceIndex" 102 ] 103 }, 104 "DeviceMessages": { 105 "description": "A list of the messages a device will accept on this server implementation.", 106 "type": "array", 107 "items": { 108 "type": "string" 109 }, 110 "minItems": 1 111 }, 112 "NullMessageAttributes": { 113 "description": "Attributes for device message that have no attributes.", 114 "type": "object", 115 "additionalProperties": false, 116 "minProperties": 0, 117 "maxProperties": 0 118 }, 119 "GenericMessageAttributesV3": { 120 "description": "Attributes for device messages.", 121 "type": "object", 122 "properties": { 123 "FeatureDescriptor": { 124 "type": "string" 125 }, 126 "StepCount": { 127 "$ref": "#/components/StepCountV3" 128 }, 129 "ActuatorType": { 130 "description": "Denotes type of actuator (Vibrator, Linear, Oscillator, etc...)", 131 "type": "string" 132 } 133 }, 134 "additionalProperties": false, 135 "minProperties": 0 136 }, 137 "GenericMessageAttributesV2": { 138 "description": "Attributes for device messages.", 139 "type": "object", 140 "properties": { 141 "FeatureCount": { 142 "$ref": "#/components/FeatureCount" 143 }, 144 "StepCount": { 145 "$ref": "#/components/StepCountV2" 146 } 147 }, 148 "additionalProperties": false, 149 "minProperties": 0 150 }, 151 "GenericMessageAttributesV1": { 152 "description": "Attributes for device messages.", 153 "type": "object", 154 "properties": { 155 "FeatureCount": { 156 "$ref": "#/components/FeatureCount" 157 } 158 }, 159 "additionalProperties": false, 160 "minProperties": 0 161 }, 162 "RawMessageAttributes": { 163 "description": "Attributes for raw device messages.", 164 "type": "object", 165 "properties": { 166 "Endpoints": { 167 "type": "array", 168 "items": { 169 "type": "string" 170 }, 171 "minItems": 1 172 } 173 }, 174 "additionalProperties": false, 175 "minProperties": 0 176 }, 177 "RangeInclusive": { 178 "description": "Serialization of Rust's RangeInclusive Type", 179 "type": "array", 180 "items": { 181 "type": "integer", 182 "minItems": 2, 183 "maxItems": 2 184 } 185 }, 186 "SensorMessageAttributes": { 187 "description": "Attributes for sensor device messages.", 188 "type": "object", 189 "properties": { 190 "SensorType": { 191 "type": "string" 192 }, 193 "FeatureDescriptor": { 194 "type": "string" 195 }, 196 "SensorRange": { 197 "type": "array", 198 "items": { 199 "$ref": "#/components/RangeInclusive" 200 }, 201 "minItems": 1 202 } 203 }, 204 "additionalProperties": false, 205 "required": [ 206 "SensorType", 207 "FeatureDescriptor", 208 "SensorRange" 209 ] 210 }, 211 "DeviceMessagesV3": { 212 "description": "A list of the messages a device will accept on this server implementation.", 213 "type": "object", 214 "properties": { 215 "StopDeviceCmd": { 216 "$ref": "#/components/NullMessageAttributes" 217 }, 218 "ScalarCmd": { 219 "type": "array", 220 "items": { 221 "$ref": "#/components/GenericMessageAttributesV3" 222 }, 223 "minItems": 1 224 }, 225 "LinearCmd": { 226 "type": "array", 227 "items": { 228 "$ref": "#/components/GenericMessageAttributesV3", 229 "minItems": 1 230 } 231 }, 232 "RotateCmd": { 233 "type": "array", 234 "items": { 235 "$ref": "#/components/GenericMessageAttributesV3", 236 "minItems": 1 237 } 238 }, 239 "SensorReadCmd": { 240 "type": "array", 241 "items": { 242 "$ref": "#/components/SensorMessageAttributes", 243 "minItems": 1 244 } 245 }, 246 "SensorSubscribeCmd": { 247 "type": "array", 248 "items": { 249 "$ref": "#/components/SensorMessageAttributes", 250 "minItems": 1 251 } 252 }, 253 "RawReadCmd": { 254 "$ref": "#/components/RawMessageAttributes" 255 }, 256 "RawWriteCmd": { 257 "$ref": "#/components/RawMessageAttributes" 258 }, 259 "RawSubscribeCmd": { 260 "$ref": "#/components/RawMessageAttributes" 261 } 262 }, 263 "additionalProperties": false 264 }, 265 "DeviceMessagesV2": { 266 "description": "A list of the messages a device will accept on this server implementation.", 267 "type": "object", 268 "properties": { 269 "StopDeviceCmd": { 270 "$ref": "#/components/NullMessageAttributes" 271 }, 272 "VibrateCmd": { 273 "$ref": "#/components/GenericMessageAttributesV2" 274 }, 275 "LinearCmd": { 276 "$ref": "#/components/GenericMessageAttributesV2" 277 }, 278 "RotateCmd": { 279 "$ref": "#/components/GenericMessageAttributesV2" 280 }, 281 "BatteryLevelCmd": { 282 "$ref": "#/components/NullMessageAttributes" 283 }, 284 "RSSILevelCmd": { 285 "$ref": "#/components/NullMessageAttributes" 286 }, 287 "RawReadCmd": { 288 "$ref": "#/components/RawMessageAttributes" 289 }, 290 "RawWriteCmd": { 291 "$ref": "#/components/RawMessageAttributes" 292 }, 293 "RawSubscribeCmd": { 294 "$ref": "#/components/RawMessageAttributes" 295 }, 296 "RawUnsubscribeCmd": { 297 "$ref": "#/components/RawMessageAttributes" 298 } 299 }, 300 "additionalProperties": false 301 }, 302 "DeviceMessagesV1": { 303 "description": "A list of the messages a device will accept on this server implementation.", 304 "type": "object", 305 "properties": { 306 "StopDeviceCmd": { 307 "$ref": "#/components/NullMessageAttributes" 308 }, 309 "VibrateCmd": { 310 "$ref": "#/components/GenericMessageAttributesV1" 311 }, 312 "LinearCmd": { 313 "$ref": "#/components/GenericMessageAttributesV1" 314 }, 315 "RotateCmd": { 316 "$ref": "#/components/GenericMessageAttributesV1" 317 }, 318 "LovenseCmd": { 319 "$ref": "#/components/NullMessageAttributes" 320 }, 321 "VorzeA10CycloneCmd": { 322 "$ref": "#/components/NullMessageAttributes" 323 }, 324 "KiirooCmd": { 325 "$ref": "#/components/NullMessageAttributes" 326 }, 327 "SingleMotorVibrateCmd": { 328 "$ref": "#/components/NullMessageAttributes" 329 }, 330 "FleshlightLaunchFW12Cmd": { 331 "$ref": "#/components/NullMessageAttributes" 332 } 333 }, 334 "additionalProperties": false 335 }, 336 "DeviceMessagesV0": { 337 "description": "A list of the messages a device will accept on this server implementation.", 338 "type": "array", 339 "items": { 340 "type": "string", 341 "enum": [ 342 "FleshlightLaunchFW12Cmd", 343 "SingleMotorVibrateCmd", 344 "KiirooCmd", 345 "LovenseCmd", 346 "VorzeA10CycloneCmd" 347 ] 348 }, 349 "additionalProperties": false 350 }, 351 "FeatureCount": { 352 "description": "Number of features on device.", 353 "type": "integer", 354 "minimum": 1 355 }, 356 "StepCountV2": { 357 "description": "Specifies granularity of each feature on the device.", 358 "type": "array", 359 "items": { 360 "minimum": 1, 361 "type": "integer" 362 }, 363 "minItems": 1 364 }, 365 "StepCountV3": { 366 "description": "Specifies granularity of each feature on the device.", 367 "minimum": 1, 368 "type": "integer" 369 }, 370 "DeviceFeatureV4": { 371 "description": "Specifies feature for a device.", 372 "type": "object", 373 "properties": { 374 "FeatureDescription": { 375 "type": "string" 376 }, 377 "FeatureIndex": { 378 "type": "integer" 379 }, 380 "Output": { 381 "type": "object", 382 "patternProperties": { 383 "^(Vibrate|Rotate|Oscillate|Constrict|Spray|Position|Temperature|Led)$": { 384 "type": "object", 385 "properties": { 386 "Value": { 387 "$ref": "#/components/RangeInclusive" 388 } 389 }, 390 "required": [ 391 "Value" 392 ] 393 }, 394 "PositionWithDuration": { 395 "type": "object", 396 "properties": { 397 "Position": { 398 "$ref": "#/components/RangeInclusive" 399 }, 400 "Duration": { 401 "$ref": "#/components/RangeInclusive" 402 } 403 }, 404 "required": [ 405 "Position", 406 "Duration" 407 ] 408 } 409 } 410 }, 411 "Input": { 412 "type": "object", 413 "patternProperties": { 414 "^.*$": { 415 "type": "object", 416 "properties": { 417 "ValueRange": { 418 "type": "array", 419 "items": { 420 "type": "array", 421 "items": { 422 "type": "integer" 423 } 424 } 425 } 426 }, 427 "required": [ 428 "ValueRange" 429 ] 430 } 431 } 432 } 433 }, 434 "required": [ 435 "FeatureDescription", 436 "FeatureIndex" 437 ] 438 } 439 }, 440 "messages": { 441 "SpecV4Messages": { 442 "OutputCmd": { 443 "type": "object", 444 "description": "Sends a generic value set command to a device.", 445 "properties": { 446 "Id": { 447 "$ref": "#/components/ClientId" 448 }, 449 "DeviceIndex": { 450 "$ref": "#/components/DeviceIndex" 451 }, 452 "FeatureIndex": { 453 "$ref": "#/components/DeviceIndex" 454 }, 455 "Command": { 456 "type": "object", 457 "patternProperties": { 458 "^(Vibrate|Rotate|Oscillate|Constrict|Spray|Position|Temperature|Led)$": { 459 "type": "object", 460 "properties": { 461 "Value": { 462 "type": "number" 463 } 464 }, 465 "required": [ 466 "Value" 467 ] 468 }, 469 "^PositionWithDuration$": { 470 "type": "object", 471 "properties": { 472 "Position": { 473 "type": "number", 474 "minimum": 0 475 }, 476 "Duration": { 477 "type": "number", 478 "minimum": 0 479 } 480 }, 481 "required": [ 482 "Position", 483 "Duration" 484 ] 485 } 486 } 487 } 488 }, 489 "additionalProperties": false, 490 "required": [ 491 "Id", 492 "DeviceIndex", 493 "FeatureIndex", 494 "Command" 495 ] 496 }, 497 "InputCmd": { 498 "type": "object", 499 "description": "Sends a request to read a sensor value.", 500 "properties": { 501 "Id": { 502 "$ref": "#/components/ClientId" 503 }, 504 "DeviceIndex": { 505 "$ref": "#/components/DeviceIndex" 506 }, 507 "FeatureIndex": { 508 "type": "integer" 509 }, 510 "InputType": { 511 "type": "string" 512 }, 513 "InputCommand": { 514 "type": "string" 515 } 516 }, 517 "additionalProperties": false, 518 "required": [ 519 "Id", 520 "DeviceIndex", 521 "FeatureIndex", 522 "InputType", 523 "InputCommand" 524 ] 525 }, 526 "InputReading": { 527 "type": "object", 528 "description": "Returns from either a sensor read request or a subscribed sensor event.", 529 "properties": { 530 "Id": { 531 "$ref": "#/components/ServerId" 532 }, 533 "DeviceIndex": { 534 "$ref": "#/components/DeviceIndex" 535 }, 536 "FeatureIndex": { 537 "type": "integer" 538 }, 539 "Data": { 540 "type": "object", 541 "patternProperties": { 542 "^Battery|Rssi|Pressure|Button": { 543 "type": "integer" 544 } 545 }, 546 "maxProperties": 1 547 } 548 }, 549 "additionalProperties": false, 550 "required": [ 551 "Id", 552 "DeviceIndex", 553 "FeatureIndex", 554 "Data" 555 ] 556 }, 557 "DeviceList": { 558 "type": "object", 559 "description": "List of all available devices known to the system.", 560 "properties": { 561 "Id": { 562 "$ref": "#/components/ServerId" 563 }, 564 "Devices": { 565 "description": "Array of device ids and names.", 566 "type": "object", 567 "patternProperties": { 568 "^[0-9]*": { 569 "type": "object", 570 "properties": { 571 "DeviceName": { 572 "$ref": "#/components/DeviceName" 573 }, 574 "DeviceIndex": { 575 "$ref": "#/components/DeviceIndex" 576 }, 577 "DeviceDisplayName": { 578 "type": "string" 579 }, 580 "DeviceMessageTimingGap": { 581 "type": "integer" 582 }, 583 "DeviceFeatures": { 584 "type": "object", 585 "patternProperties": { 586 "^[0-9]*": { 587 "$ref": "#/components/DeviceFeatureV4" 588 } 589 } 590 } 591 }, 592 "additionalProperties": false, 593 "required": [ 594 "DeviceName", 595 "DeviceIndex", 596 "DeviceMessageTimingGap", 597 "DeviceFeatures" 598 ] 599 } 600 } 601 } 602 }, 603 "additionalProperties": false, 604 "required": [ 605 "Id", 606 "Devices" 607 ] 608 }, 609 "RequestServerInfo": { 610 "type": "object", 611 "description": "Request server version, and relay client name.", 612 "properties": { 613 "Id": { 614 "$ref": "#/components/ClientId" 615 }, 616 "ClientName": { 617 "description": "Name of the client software.", 618 "type": "string" 619 }, 620 "ProtocolVersionMajor": { 621 "description": "Message template version of the server software.", 622 "type": "integer", 623 "minimum": 0 624 }, 625 "ProtocolVersionMinor": { 626 "description": "Message template version of the server software.", 627 "type": "integer", 628 "minimum": 0 629 } 630 }, 631 "additionalProperties": false, 632 "required": [ 633 "Id", 634 "ClientName", 635 "ProtocolVersionMajor", 636 "ProtocolVersionMinor" 637 ] 638 }, 639 "ServerInfo": { 640 "type": "object", 641 "description": "Server version information, with API version in Major.Minor format.", 642 "properties": { 643 "Id": { 644 "$ref": "#/components/ClientId" 645 }, 646 "ServerName": { 647 "description": "Name of the server. Can be 0-length.", 648 "type": "string" 649 }, 650 "ProtocolVersionMajor": { 651 "description": "Message template version of the server software.", 652 "type": "integer", 653 "minimum": 0 654 }, 655 "ProtocolVersionMinor": { 656 "description": "Message template version of the server software.", 657 "type": "integer", 658 "minimum": 0 659 }, 660 "MaxPingTime": { 661 "description": "Maximum time (in milliseconds) the server will wait between ping messages from client before shutting down.", 662 "type": "integer", 663 "minimum": 0 664 } 665 } 666 } 667 }, 668 "SpecV3Messages": { 669 "DeviceList": { 670 "type": "object", 671 "description": "List of all available devices known to the system.", 672 "properties": { 673 "Id": { 674 "$ref": "#/components/ClientId" 675 }, 676 "Devices": { 677 "description": "Array of device ids and names.", 678 "type": "array", 679 "items": { 680 "type": "object", 681 "properties": { 682 "DeviceName": { 683 "$ref": "#/components/DeviceName" 684 }, 685 "DeviceIndex": { 686 "$ref": "#/components/DeviceIndex" 687 }, 688 "DeviceDisplayName": { 689 "type": "string" 690 }, 691 "DeviceMessageTimingGap": { 692 "type": "integer" 693 }, 694 "DeviceMessages": { 695 "$ref": "#/components/DeviceMessagesV3" 696 } 697 }, 698 "additionalProperties": false, 699 "required": [ 700 "DeviceName", 701 "DeviceIndex", 702 "DeviceMessages" 703 ] 704 } 705 } 706 }, 707 "additionalProperties": false, 708 "required": [ 709 "Id", 710 "Devices" 711 ] 712 }, 713 "DeviceAdded": { 714 "type": "object", 715 "description": "Notifies client that a device of a certain type has been added to the server.", 716 "properties": { 717 "Id": { 718 "$ref": "#/components/SystemId" 719 }, 720 "DeviceName": { 721 "$ref": "#/components/DeviceName" 722 }, 723 "DeviceIndex": { 724 "$ref": "#/components/DeviceIndex" 725 }, 726 "DeviceDisplayName": { 727 "type": "string" 728 }, 729 "DeviceMessageTimingGap": { 730 "type": "integer" 731 }, 732 "DeviceMessages": { 733 "$ref": "#/components/DeviceMessagesV3" 734 } 735 }, 736 "additionalProperties": false, 737 "required": [ 738 "Id", 739 "DeviceName", 740 "DeviceIndex", 741 "DeviceMessages" 742 ] 743 }, 744 "ScalarCmd": { 745 "type": "object", 746 "description": "Sends a generic scalar command to a device.", 747 "properties": { 748 "Id": { 749 "$ref": "#/components/ClientId" 750 }, 751 "DeviceIndex": { 752 "$ref": "#/components/DeviceIndex" 753 }, 754 "Scalars": { 755 "description": "Device actution scalar (floating point, range can vary) keyed on acutator index, stepping will be device specific.", 756 "type": "array", 757 "items": { 758 "type": "object", 759 "properties": { 760 "Index": { 761 "description": "Actuator index.", 762 "type": "integer", 763 "minimum": 0 764 }, 765 "Scalar": { 766 "description": "Actuator scalar (floating point, range can vary), stepping will be device specific.", 767 "type": "number" 768 }, 769 "ActuatorType": { 770 "description": "Actuator type that is expected to be controlled with this subcommand.", 771 "type": "string" 772 } 773 }, 774 "additionalProperties": false, 775 "required": [ 776 "Index", 777 "Scalar", 778 "ActuatorType" 779 ] 780 }, 781 "minItems": 1 782 } 783 }, 784 "additionalProperties": false, 785 "required": [ 786 "Id", 787 "DeviceIndex", 788 "Scalars" 789 ] 790 }, 791 "SensorReadCmd": { 792 "type": "object", 793 "description": "Sends a request to read a sensor value.", 794 "properties": { 795 "Id": { 796 "$ref": "#/components/ClientId" 797 }, 798 "DeviceIndex": { 799 "$ref": "#/components/DeviceIndex" 800 }, 801 "SensorIndex": { 802 "type": "integer" 803 }, 804 "SensorType": { 805 "type": "string" 806 } 807 }, 808 "additionalProperties": false, 809 "required": [ 810 "Id", 811 "DeviceIndex", 812 "SensorIndex", 813 "SensorType" 814 ] 815 }, 816 "SensorReading": { 817 "type": "object", 818 "description": "Returns from either a sensor read request or a subscribed sensor event.", 819 "properties": { 820 "Id": { 821 "$ref": "#/components/ServerId" 822 }, 823 "DeviceIndex": { 824 "$ref": "#/components/DeviceIndex" 825 }, 826 "SensorIndex": { 827 "type": "integer" 828 }, 829 "SensorType": { 830 "type": "string" 831 }, 832 "Data": { 833 "type": "array", 834 "items": { 835 "type": "integer", 836 "minimum": 0, 837 "maximum": 255 838 } 839 } 840 }, 841 "additionalProperties": false, 842 "required": [ 843 "Id", 844 "DeviceIndex", 845 "SensorIndex", 846 "SensorType", 847 "Data" 848 ] 849 }, 850 "SensorSubscribeCmd": { 851 "type": "object", 852 "description": "Sends a request to subscribe for updates to a sensor value.", 853 "properties": { 854 "Id": { 855 "$ref": "#/components/ClientId" 856 }, 857 "DeviceIndex": { 858 "$ref": "#/components/DeviceIndex" 859 }, 860 "SensorIndex": { 861 "type": "integer" 862 }, 863 "SensorType": { 864 "type": "string" 865 } 866 }, 867 "additionalProperties": false, 868 "required": [ 869 "Id", 870 "DeviceIndex", 871 "SensorIndex", 872 "SensorType" 873 ] 874 }, 875 "SensorUnsubscribeCmd": { 876 "type": "object", 877 "description": "Sends a request to subscribe for updates to a sensor value.", 878 "properties": { 879 "Id": { 880 "$ref": "#/components/ClientId" 881 }, 882 "DeviceIndex": { 883 "$ref": "#/components/DeviceIndex" 884 }, 885 "SensorIndex": { 886 "type": "integer" 887 }, 888 "SensorType": { 889 "type": "string" 890 } 891 }, 892 "additionalProperties": false, 893 "required": [ 894 "Id", 895 "DeviceIndex", 896 "SensorIndex", 897 "SensorType" 898 ] 899 } 900 }, 901 "SpecV2Messages": { 902 "DeviceList": { 903 "type": "object", 904 "description": "List of all available devices known to the system.", 905 "properties": { 906 "Id": { 907 "$ref": "#/components/ClientId" 908 }, 909 "Devices": { 910 "description": "Array of device ids and names.", 911 "type": "array", 912 "items": { 913 "type": "object", 914 "properties": { 915 "DeviceName": { 916 "$ref": "#/components/DeviceName" 917 }, 918 "DeviceIndex": { 919 "$ref": "#/components/DeviceIndex" 920 }, 921 "DeviceMessages": { 922 "$ref": "#/components/DeviceMessagesV2" 923 } 924 }, 925 "additionalProperties": false, 926 "required": [ 927 "DeviceName", 928 "DeviceIndex", 929 "DeviceMessages" 930 ] 931 } 932 } 933 }, 934 "additionalProperties": false, 935 "required": [ 936 "Id", 937 "Devices" 938 ] 939 }, 940 "DeviceAdded": { 941 "type": "object", 942 "description": "Notifies client that a device of a certain type has been added to the server.", 943 "properties": { 944 "Id": { 945 "$ref": "#/components/SystemId" 946 }, 947 "DeviceName": { 948 "$ref": "#/components/DeviceName" 949 }, 950 "DeviceIndex": { 951 "$ref": "#/components/DeviceIndex" 952 }, 953 "DeviceMessages": { 954 "$ref": "#/components/DeviceMessagesV2" 955 } 956 }, 957 "additionalProperties": false, 958 "required": [ 959 "Id", 960 "DeviceName", 961 "DeviceIndex", 962 "DeviceMessages" 963 ] 964 }, 965 "BatteryLevelCmd": { 966 "type": "object", 967 "description": "Requests that a BatteryLevel be retreived.", 968 "properties": { 969 "Id": { 970 "$ref": "#/components/ClientId" 971 }, 972 "DeviceIndex": { 973 "$ref": "#/components/DeviceIndex" 974 } 975 }, 976 "additionalProperties": false, 977 "required": [ 978 "Id", 979 "DeviceIndex" 980 ] 981 }, 982 "BatteryLevelReading": { 983 "type": "object", 984 "description": "Returns a BatteryLevel read from a device.", 985 "properties": { 986 "Id": { 987 "$ref": "#/components/ClientId" 988 }, 989 "DeviceIndex": { 990 "$ref": "#/components/DeviceIndex" 991 }, 992 "BatteryLevel": { 993 "description": "Battery Level", 994 "type": "number", 995 "minimum": 0, 996 "maximum": 1 997 } 998 }, 999 "additionalProperties": false, 1000 "required": [ 1001 "Id", 1002 "DeviceIndex", 1003 "BatteryLevel" 1004 ] 1005 }, 1006 "RSSILevelCmd": { 1007 "type": "object", 1008 "description": "Requests that a RSSI level be retreived.", 1009 "properties": { 1010 "Id": { 1011 "$ref": "#/components/ClientId" 1012 }, 1013 "DeviceIndex": { 1014 "$ref": "#/components/DeviceIndex" 1015 } 1016 }, 1017 "additionalProperties": false, 1018 "required": [ 1019 "Id", 1020 "DeviceIndex" 1021 ] 1022 }, 1023 "RSSILevelReading": { 1024 "type": "object", 1025 "description": "Returns a BatteryLevel read from a device.", 1026 "properties": { 1027 "Id": { 1028 "$ref": "#/components/ClientId" 1029 }, 1030 "DeviceIndex": { 1031 "$ref": "#/components/DeviceIndex" 1032 }, 1033 "RSSILevel": { 1034 "description": "RSSI Level", 1035 "type": "number", 1036 "minimum": 0, 1037 "maximum": 1 1038 } 1039 }, 1040 "additionalProperties": false, 1041 "required": [ 1042 "Id", 1043 "DeviceIndex", 1044 "RSSILevel" 1045 ] 1046 }, 1047 "RawWriteCmd": { 1048 "type": "object", 1049 "description": "Sends a raw byte array to a device. Should only be used for testing/development.", 1050 "properties": { 1051 "Id": { 1052 "$ref": "#/components/ClientId" 1053 }, 1054 "DeviceIndex": { 1055 "$ref": "#/components/DeviceIndex" 1056 }, 1057 "Endpoint": { 1058 "type": "string", 1059 "description": "Endpoint (from device config file) to send command to." 1060 }, 1061 "Data": { 1062 "description": "Raw byte string to send to device.", 1063 "type": "array", 1064 "minItems": 1, 1065 "items": { 1066 "type": "integer", 1067 "minimum": 0, 1068 "maximum": 255 1069 } 1070 }, 1071 "WriteWithResponse": { 1072 "type": "boolean", 1073 "description": "If true, BLE writes will use WriteWithResponse. Value ignored for all other types." 1074 } 1075 }, 1076 "additionalProperties": false, 1077 "required": [ 1078 "Id", 1079 "Endpoint", 1080 "DeviceIndex", 1081 "Data", 1082 "WriteWithResponse" 1083 ] 1084 }, 1085 "RawReadCmd": { 1086 "type": "object", 1087 "description": "Request a raw byte array from a device. Should only be used for testing/development.", 1088 "properties": { 1089 "Id": { 1090 "$ref": "#/components/ClientId" 1091 }, 1092 "DeviceIndex": { 1093 "$ref": "#/components/DeviceIndex" 1094 }, 1095 "Endpoint": { 1096 "type": "string", 1097 "description": "Endpoint (from device config file) from which the data was retrieved." 1098 }, 1099 "Length": { 1100 "type": "integer", 1101 "description": "Amount of data to read from device, 0 to exhaust whatever is in immediate buffer", 1102 "minimum": 0 1103 }, 1104 "WaitForData": { 1105 "type": "boolean", 1106 "description": "If true, then wait until Length amount of data is available." 1107 } 1108 }, 1109 "additionalProperties": false, 1110 "required": [ 1111 "Id", 1112 "Endpoint", 1113 "DeviceIndex", 1114 "Length", 1115 "WaitForData" 1116 ] 1117 }, 1118 "RawSubscribeCmd": { 1119 "type": "object", 1120 "description": "Subscribe to an endpoint on a device to receive raw info back.", 1121 "properties": { 1122 "Id": { 1123 "$ref": "#/components/ClientId" 1124 }, 1125 "DeviceIndex": { 1126 "$ref": "#/components/DeviceIndex" 1127 }, 1128 "Endpoint": { 1129 "type": "string", 1130 "description": "Endpoint (from device config file) from which the data was retrieved." 1131 } 1132 }, 1133 "additionalProperties": false, 1134 "required": [ 1135 "Id", 1136 "Endpoint", 1137 "DeviceIndex" 1138 ] 1139 }, 1140 "RawUnsubscribeCmd": { 1141 "type": "object", 1142 "description": "Unsubscribe to an endpoint on a device.", 1143 "properties": { 1144 "Id": { 1145 "$ref": "#/components/ClientId" 1146 }, 1147 "DeviceIndex": { 1148 "$ref": "#/components/DeviceIndex" 1149 }, 1150 "Endpoint": { 1151 "type": "string", 1152 "description": "Endpoint (from device config file) from which the data was retrieved." 1153 } 1154 }, 1155 "additionalProperties": false, 1156 "required": [ 1157 "Id", 1158 "Endpoint", 1159 "DeviceIndex" 1160 ] 1161 }, 1162 "RawReading": { 1163 "type": "object", 1164 "description": "Raw byte array received from a device. Should only be used for testing/development.", 1165 "properties": { 1166 "Id": { 1167 "$ref": "#/components/ServerId" 1168 }, 1169 "DeviceIndex": { 1170 "$ref": "#/components/DeviceIndex" 1171 }, 1172 "Endpoint": { 1173 "type": "string", 1174 "description": "Endpoint (from device config file) from which the data was retrieved." 1175 }, 1176 "Data": { 1177 "description": "Raw byte string received from device.", 1178 "type": "array", 1179 "minItems": 1, 1180 "items": { 1181 "type": "integer", 1182 "minimum": 0, 1183 "maximum": 255 1184 } 1185 } 1186 }, 1187 "additionalProperties": false, 1188 "required": [ 1189 "Id", 1190 "Endpoint", 1191 "DeviceIndex", 1192 "Data" 1193 ] 1194 }, 1195 "ServerInfo": { 1196 "type": "object", 1197 "description": "Server version information, in Major.Minor.Build format.", 1198 "properties": { 1199 "Id": { 1200 "$ref": "#/components/ClientId" 1201 }, 1202 "ServerName": { 1203 "description": "Name of the server. Can be 0-length.", 1204 "type": "string" 1205 }, 1206 "MessageVersion": { 1207 "description": "Message template version of the server software.", 1208 "type": "integer", 1209 "minimum": 0 1210 }, 1211 "MaxPingTime": { 1212 "description": "Maximum time (in milliseconds) the server will wait between ping messages from client before shutting down.", 1213 "type": "integer", 1214 "minimum": 0 1215 } 1216 }, 1217 "additionalProperties": false, 1218 "required": [ 1219 "Id", 1220 "MessageVersion", 1221 "MaxPingTime", 1222 "ServerName" 1223 ] 1224 } 1225 }, 1226 "SpecV1Messages": { 1227 "DeviceList": { 1228 "type": "object", 1229 "description": "List of all available devices known to the system.", 1230 "properties": { 1231 "Id": { 1232 "$ref": "#/components/ClientId" 1233 }, 1234 "Devices": { 1235 "description": "Array of device ids and names.", 1236 "type": "array", 1237 "items": { 1238 "type": "object", 1239 "properties": { 1240 "DeviceName": { 1241 "$ref": "#/components/DeviceName" 1242 }, 1243 "DeviceIndex": { 1244 "$ref": "#/components/DeviceIndex" 1245 }, 1246 "DeviceMessages": { 1247 "$ref": "#/components/DeviceMessagesV1" 1248 } 1249 }, 1250 "additionalProperties": false, 1251 "required": [ 1252 "DeviceName", 1253 "DeviceIndex", 1254 "DeviceMessages" 1255 ] 1256 } 1257 } 1258 }, 1259 "additionalProperties": false, 1260 "required": [ 1261 "Id", 1262 "Devices" 1263 ] 1264 }, 1265 "DeviceAdded": { 1266 "type": "object", 1267 "description": "Notifies client that a device of a certain type has been added to the server.", 1268 "properties": { 1269 "Id": { 1270 "$ref": "#/components/SystemId" 1271 }, 1272 "DeviceName": { 1273 "$ref": "#/components/DeviceName" 1274 }, 1275 "DeviceIndex": { 1276 "$ref": "#/components/DeviceIndex" 1277 }, 1278 "DeviceMessages": { 1279 "$ref": "#/components/DeviceMessagesV1" 1280 } 1281 }, 1282 "additionalProperties": false, 1283 "required": [ 1284 "Id", 1285 "DeviceName", 1286 "DeviceIndex", 1287 "DeviceMessages" 1288 ] 1289 }, 1290 "VibrateCmd": { 1291 "type": "object", 1292 "description": "Sends a vibrate command to a device that supports vibration.", 1293 "properties": { 1294 "Id": { 1295 "$ref": "#/components/ClientId" 1296 }, 1297 "DeviceIndex": { 1298 "$ref": "#/components/DeviceIndex" 1299 }, 1300 "Speeds": { 1301 "description": "Device vibration speeds (floating point, 0 < x < 1) keyed on vibrator number, stepping will be device specific.", 1302 "type": "array", 1303 "items": { 1304 "type": "object", 1305 "properties": { 1306 "Index": { 1307 "description": "Vibrator number.", 1308 "type": "integer", 1309 "minimum": 0 1310 }, 1311 "Speed": { 1312 "description": "Vibration speed (floating point, 0 < x < 1), stepping will be device specific.", 1313 "type": "number", 1314 "minimum": 0, 1315 "maximum": 1 1316 } 1317 }, 1318 "additionalProperties": false, 1319 "required": [ 1320 "Index", 1321 "Speed" 1322 ] 1323 }, 1324 "minItems": 1 1325 } 1326 }, 1327 "additionalProperties": false, 1328 "required": [ 1329 "Id", 1330 "DeviceIndex", 1331 "Speeds" 1332 ] 1333 }, 1334 "RotateCmd": { 1335 "type": "object", 1336 "description": "Sends a rotate command to a device that supports rotation.", 1337 "properties": { 1338 "Id": { 1339 "$ref": "#/components/ClientId" 1340 }, 1341 "DeviceIndex": { 1342 "$ref": "#/components/DeviceIndex" 1343 }, 1344 "Rotations": { 1345 "description": "Device rotation speeds (floating point, 0 < x < 1) keyed on rotator number, stepping will be device specific.", 1346 "type": "array", 1347 "items": { 1348 "type": "object", 1349 "properties": { 1350 "Index": { 1351 "description": "Rotator number.", 1352 "type": "integer", 1353 "minimum": 0 1354 }, 1355 "Speed": { 1356 "description": "Rotation speed (floating point, 0 < x < 1), stepping will be device specific.", 1357 "type": "number", 1358 "minimum": 0, 1359 "maximum": 1 1360 }, 1361 "Clockwise": { 1362 "description": "Rotation direction (boolean). Not all devices have a concept of actual clockwise.", 1363 "type": "boolean" 1364 } 1365 }, 1366 "additionalProperties": false, 1367 "required": [ 1368 "Index", 1369 "Speed", 1370 "Clockwise" 1371 ] 1372 }, 1373 "minItems": 1 1374 } 1375 }, 1376 "additionalProperties": false, 1377 "required": [ 1378 "Id", 1379 "DeviceIndex", 1380 "Rotations" 1381 ] 1382 }, 1383 "LinearCmd": { 1384 "type": "object", 1385 "description": "Sends a linear movement command to a device that supports linear movements.", 1386 "properties": { 1387 "Id": { 1388 "$ref": "#/components/ClientId" 1389 }, 1390 "DeviceIndex": { 1391 "$ref": "#/components/DeviceIndex" 1392 }, 1393 "Vectors": { 1394 "description": "Device linear movement times (milliseconds) and positions (floating point, 0 < x < 1) keyed on linear actuator number, stepping will be device specific.", 1395 "type": "array", 1396 "items": { 1397 "type": "object", 1398 "properties": { 1399 "Index": { 1400 "description": "Linear actuator number.", 1401 "type": "integer", 1402 "minimum": 0 1403 }, 1404 "Duration": { 1405 "description": "Linear movement time in milliseconds.", 1406 "type": "number", 1407 "minimum": 0 1408 }, 1409 "Position": { 1410 "description": "Linear movement position (floating point, 0 < x < 1), stepping will be device specific.", 1411 "type": "number", 1412 "minimum": 0, 1413 "maximum": 1 1414 } 1415 }, 1416 "additionalProperties": false, 1417 "required": [ 1418 "Index", 1419 "Duration", 1420 "Position" 1421 ] 1422 } 1423 } 1424 }, 1425 "additionalProperties": false, 1426 "required": [ 1427 "Id", 1428 "DeviceIndex", 1429 "Vectors" 1430 ] 1431 }, 1432 "ServerInfo": { 1433 "type": "object", 1434 "description": "Server version information, in Major.Minor.Build format.", 1435 "properties": { 1436 "Id": { 1437 "$ref": "#/components/ClientId" 1438 }, 1439 "ServerName": { 1440 "description": "Name of the server. Can be 0-length.", 1441 "type": "string" 1442 }, 1443 "MessageVersion": { 1444 "description": "Message template version of the server software.", 1445 "type": "integer", 1446 "minimum": 0 1447 }, 1448 "MajorVersion": { 1449 "description": "Major version of server.", 1450 "type": "integer", 1451 "minimum": 0 1452 }, 1453 "MinorVersion": { 1454 "description": "Minor version of server.", 1455 "type": "integer", 1456 "minimum": 0 1457 }, 1458 "BuildVersion": { 1459 "description": "Build version of server.", 1460 "type": "integer", 1461 "minimum": 0 1462 }, 1463 "MaxPingTime": { 1464 "description": "Maximum time (in milliseconds) the server will wait between ping messages from client before shutting down.", 1465 "type": "integer", 1466 "minimum": 0 1467 } 1468 }, 1469 "additionalProperties": false, 1470 "required": [ 1471 "Id", 1472 "MessageVersion", 1473 "MaxPingTime", 1474 "MajorVersion", 1475 "MinorVersion", 1476 "BuildVersion", 1477 "ServerName" 1478 ] 1479 }, 1480 "RequestServerInfo": { 1481 "type": "object", 1482 "description": "Request server version, and relay client name.", 1483 "properties": { 1484 "Id": { 1485 "$ref": "#/components/ClientId" 1486 }, 1487 "ClientName": { 1488 "description": "Name of the client software.", 1489 "type": "string" 1490 }, 1491 "MessageVersion": { 1492 "description": "Message template version of the client software.", 1493 "type": "integer", 1494 "minimum": 0 1495 } 1496 }, 1497 "additionalProperties": false, 1498 "required": [ 1499 "Id", 1500 "ClientName", 1501 "MessageVersion" 1502 ] 1503 } 1504 }, 1505 "SpecV0Messages": { 1506 "DeviceList": { 1507 "type": "object", 1508 "description": "List of all available devices known to the system.", 1509 "properties": { 1510 "Id": { 1511 "$ref": "#/components/ClientId" 1512 }, 1513 "Devices": { 1514 "description": "Array of device ids and names.", 1515 "type": "array", 1516 "items": { 1517 "type": "object", 1518 "properties": { 1519 "DeviceName": { 1520 "$ref": "#/components/DeviceName" 1521 }, 1522 "DeviceIndex": { 1523 "$ref": "#/components/DeviceIndex" 1524 }, 1525 "DeviceMessages": { 1526 "$ref": "#/components/DeviceMessagesV0" 1527 } 1528 }, 1529 "additionalProperties": false, 1530 "required": [ 1531 "DeviceName", 1532 "DeviceIndex", 1533 "DeviceMessages" 1534 ] 1535 } 1536 } 1537 }, 1538 "additionalProperties": false, 1539 "required": [ 1540 "Id", 1541 "Devices" 1542 ] 1543 }, 1544 "DeviceAdded": { 1545 "type": "object", 1546 "description": "Notifies client that a device of a certain type has been added to the server.", 1547 "properties": { 1548 "Id": { 1549 "$ref": "#/components/SystemId" 1550 }, 1551 "DeviceName": { 1552 "$ref": "#/components/DeviceName" 1553 }, 1554 "DeviceIndex": { 1555 "$ref": "#/components/DeviceIndex" 1556 }, 1557 "DeviceMessages": { 1558 "$ref": "#/components/DeviceMessagesV0" 1559 } 1560 }, 1561 "additionalProperties": false, 1562 "required": [ 1563 "Id", 1564 "DeviceName", 1565 "DeviceIndex", 1566 "DeviceMessages" 1567 ] 1568 }, 1569 "StopDeviceCmd": { 1570 "type": "object", 1571 "description": "Stops the all actions currently being taken by a device.", 1572 "properties": { 1573 "Id": { 1574 "$ref": "#/components/ClientId" 1575 }, 1576 "DeviceIndex": { 1577 "$ref": "#/components/DeviceIndex" 1578 } 1579 }, 1580 "additionalProperties": false, 1581 "required": [ 1582 "Id", 1583 "DeviceIndex" 1584 ] 1585 }, 1586 "StopAllDevices": { 1587 "type": "object", 1588 "description": "Stops all actions currently being taken by all connected devices.", 1589 "anyOf": [ 1590 { 1591 "$ref": "#/components/ClientIdMessage" 1592 } 1593 ] 1594 }, 1595 "VorzeA10CycloneCmd": { 1596 "type": "object", 1597 "description": "Sends a raw byte string to a Kiiroo Onyx/Pearl device.", 1598 "properties": { 1599 "Id": { 1600 "$ref": "#/components/ClientId" 1601 }, 1602 "DeviceIndex": { 1603 "$ref": "#/components/DeviceIndex" 1604 }, 1605 "Speed": { 1606 "description": "Rotation speed command for the Cyclone.", 1607 "type": "integer", 1608 "minimum": 0, 1609 "maximum": 100 1610 }, 1611 "Clockwise": { 1612 "description": "True for clockwise rotation (in relation to device facing user), false for Counter-clockwise", 1613 "type": "boolean" 1614 } 1615 }, 1616 "additionalProperties": false, 1617 "required": [ 1618 "Id", 1619 "DeviceIndex", 1620 "Speed", 1621 "Clockwise" 1622 ] 1623 }, 1624 "KiirooCmd": { 1625 "type": "object", 1626 "description": "Sends a raw byte string to a Kiiroo Onyx/Pearl device.", 1627 "properties": { 1628 "Id": { 1629 "$ref": "#/components/ClientId" 1630 }, 1631 "DeviceIndex": { 1632 "$ref": "#/components/DeviceIndex" 1633 }, 1634 "Command": { 1635 "description": "Command to send to Kiiroo device.", 1636 "type": "string" 1637 } 1638 }, 1639 "additionalProperties": false, 1640 "required": [ 1641 "Id", 1642 "DeviceIndex", 1643 "Command" 1644 ] 1645 }, 1646 "FleshlightLaunchFW12Cmd": { 1647 "type": "object", 1648 "description": "Sends speed and position command to the Fleshlight Launch Device denoted by the device index.", 1649 "properties": { 1650 "Id": { 1651 "$ref": "#/components/ClientId" 1652 }, 1653 "DeviceIndex": { 1654 "$ref": "#/components/DeviceIndex" 1655 }, 1656 "Speed": { 1657 "description": "Speed at which to move to designated position.", 1658 "type": "integer", 1659 "minimum": 0, 1660 "maximum": 99 1661 }, 1662 "Position": { 1663 "description": "Position to which to move Fleshlight.", 1664 "type": "integer", 1665 "minimum": 0, 1666 "maximum": 99 1667 } 1668 }, 1669 "additionalProperties": false, 1670 "required": [ 1671 "Id", 1672 "DeviceIndex", 1673 "Speed", 1674 "Position" 1675 ] 1676 }, 1677 "LovenseCmd": { 1678 "type": "object", 1679 "description": "Sends a command string to a Lovense device. Command string will be verified by sender.", 1680 "properties": { 1681 "Id": { 1682 "$ref": "#/components/ClientId" 1683 }, 1684 "DeviceIndex": { 1685 "$ref": "#/components/DeviceIndex" 1686 }, 1687 "Command": { 1688 "description": "Command to send to Lovense device.", 1689 "type": "string" 1690 } 1691 }, 1692 "additionalProperties": false, 1693 "required": [ 1694 "Id", 1695 "DeviceIndex", 1696 "Command" 1697 ] 1698 }, 1699 "SingleMotorVibrateCmd": { 1700 "type": "object", 1701 "description": "Sends a vibrate command to a device that supports vibration.", 1702 "properties": { 1703 "Id": { 1704 "$ref": "#/components/ClientId" 1705 }, 1706 "DeviceIndex": { 1707 "$ref": "#/components/DeviceIndex" 1708 }, 1709 "Speed": { 1710 "description": "Device vibration speed (floating point, 0 < x < 1), stepping will be device specific.", 1711 "type": "number", 1712 "minimum": 0, 1713 "maximum": 1 1714 } 1715 }, 1716 "additionalProperties": false, 1717 "required": [ 1718 "Id", 1719 "DeviceIndex", 1720 "Speed" 1721 ] 1722 }, 1723 "ServerInfo": { 1724 "type": "object", 1725 "description": "Server version information, in Major.Minor.Build format.", 1726 "properties": { 1727 "Id": { 1728 "$ref": "#/components/ClientId" 1729 }, 1730 "ServerName": { 1731 "description": "Name of the server. Can be 0-length.", 1732 "type": "string" 1733 }, 1734 "MessageVersion": { 1735 "description": "Message template version of the server software.", 1736 "type": "integer", 1737 "minimum": 0 1738 }, 1739 "MajorVersion": { 1740 "description": "Major version of server.", 1741 "type": "integer", 1742 "minimum": 0 1743 }, 1744 "MinorVersion": { 1745 "description": "Minor version of server.", 1746 "type": "integer", 1747 "minimum": 0 1748 }, 1749 "BuildVersion": { 1750 "description": "Build version of server.", 1751 "type": "integer", 1752 "minimum": 0 1753 }, 1754 "MaxPingTime": { 1755 "description": "Maximum time (in milliseconds) the server will wait between ping messages from client before shutting down.", 1756 "type": "integer", 1757 "minimum": 0 1758 } 1759 }, 1760 "additionalProperties": false, 1761 "required": [ 1762 "Id", 1763 "MessageVersion", 1764 "MaxPingTime", 1765 "MajorVersion", 1766 "MinorVersion", 1767 "BuildVersion", 1768 "ServerName" 1769 ] 1770 }, 1771 "RequestServerInfo": { 1772 "type": "object", 1773 "description": "Request server version, and relay client name.", 1774 "properties": { 1775 "Id": { 1776 "$ref": "#/components/ClientId" 1777 }, 1778 "ClientName": { 1779 "description": "Name of the client software.", 1780 "type": "string" 1781 } 1782 }, 1783 "additionalProperties": false, 1784 "required": [ 1785 "Id", 1786 "ClientName" 1787 ] 1788 }, 1789 "RequestLog": { 1790 "type": "object", 1791 "description": "Request for server to stream log messages of a certain level to client.", 1792 "properties": { 1793 "Id": { 1794 "$ref": "#/components/ClientId" 1795 }, 1796 "LogLevel": { 1797 "description": "Maximum level of log message to receive.", 1798 "enum": [ 1799 "Off", 1800 "Fatal", 1801 "Error", 1802 "Warn", 1803 "Info", 1804 "Debug", 1805 "Trace" 1806 ] 1807 } 1808 }, 1809 "additionalProperties": false, 1810 "required": [ 1811 "Id", 1812 "LogLevel" 1813 ] 1814 }, 1815 "Log": { 1816 "type": "object", 1817 "description": "Log message from the server.", 1818 "properties": { 1819 "Id": { 1820 "$ref": "#/components/SystemId" 1821 }, 1822 "LogLevel": { 1823 "description": "Log level of message.", 1824 "enum": [ 1825 "Off", 1826 "Fatal", 1827 "Error", 1828 "Warn", 1829 "Info", 1830 "Debug", 1831 "Trace" 1832 ] 1833 }, 1834 "LogMessage": { 1835 "description": "Log message from server.", 1836 "type": "string" 1837 } 1838 }, 1839 "additionalProperties": false, 1840 "required": [ 1841 "Id", 1842 "LogLevel", 1843 "LogMessage" 1844 ] 1845 }, 1846 "DeviceRemoved": { 1847 "type": "object", 1848 "description": "Notifies client that a device of a certain type has been removed from the server.", 1849 "anyOf": [ 1850 { 1851 "$ref": "#/components/SystemIdDeviceIndexMessage" 1852 } 1853 ] 1854 }, 1855 "RequestDeviceList": { 1856 "type": "object", 1857 "description": "Request for the server to send a list of devices to the client.", 1858 "anyOf": [ 1859 { 1860 "$ref": "#/components/ClientIdMessage" 1861 } 1862 ] 1863 }, 1864 "StartScanning": { 1865 "type": "object", 1866 "description": "Request for the server to start scanning for new devices.", 1867 "anyOf": [ 1868 { 1869 "$ref": "#/components/ClientIdMessage" 1870 } 1871 ] 1872 }, 1873 "StopScanning": { 1874 "type": "object", 1875 "description": "Request for the server to stop scanning for new devices.", 1876 "anyOf": [ 1877 { 1878 "$ref": "#/components/ClientIdMessage" 1879 } 1880 ] 1881 }, 1882 "ScanningFinished": { 1883 "type": "object", 1884 "description": "Server notification to client that scanning has ended.", 1885 "anyOf": [ 1886 { 1887 "$ref": "#/components/SystemIdMessage" 1888 } 1889 ] 1890 }, 1891 "Ok": { 1892 "type": "object", 1893 "description": "Signifies successful processing of the message indicated by the id.", 1894 "anyOf": [ 1895 { 1896 "$ref": "#/components/ClientIdMessage" 1897 } 1898 ] 1899 }, 1900 "Ping": { 1901 "type": "object", 1902 "description": "Connection keep-alive message.", 1903 "anyOf": [ 1904 { 1905 "$ref": "#/components/ClientIdMessage" 1906 } 1907 ] 1908 }, 1909 "Error": { 1910 "type": "object", 1911 "description": "Signifies the server encountered an error while processing the message indicated by the id.", 1912 "properties": { 1913 "Id": { 1914 "$ref": "#/components/ServerId" 1915 }, 1916 "ErrorMessage": { 1917 "type": "string" 1918 }, 1919 "ErrorCode": { 1920 "type": "number", 1921 "minimum": 0, 1922 "maximum": 4 1923 } 1924 }, 1925 "additionalProperties": false, 1926 "required": [ 1927 "Id", 1928 "ErrorMessage", 1929 "ErrorCode" 1930 ] 1931 }, 1932 "Test": { 1933 "type": "object", 1934 "description": "Used for connection/application testing. Causes server to echo back the string sent. Sending string of 'Error' will result in a server error. ", 1935 "properties": { 1936 "Id": { 1937 "$ref": "#/components/ClientId" 1938 }, 1939 "TestString": { 1940 "description": "String to be echo'd back from server. Setting this to 'Error' will cause an error to be thrown.", 1941 "type": "string" 1942 } 1943 }, 1944 "additionalProperties": false, 1945 "required": [ 1946 "Id", 1947 "TestString" 1948 ] 1949 } 1950 } 1951 }, 1952 "specs": { 1953 "MessageSpecV4": { 1954 "type": "array", 1955 "items": { 1956 "type": "object", 1957 "description": "All messages valid in Buttplug Spec v4", 1958 "properties": { 1959 "DeviceList": { 1960 "$ref": "#/messages/SpecV4Messages/DeviceList" 1961 }, 1962 "Error": { 1963 "$ref": "#/messages/SpecV0Messages/Error" 1964 }, 1965 "Ok": { 1966 "$ref": "#/messages/SpecV0Messages/Ok" 1967 }, 1968 "Ping": { 1969 "$ref": "#/messages/SpecV0Messages/Ping" 1970 }, 1971 "RequestDeviceList": { 1972 "$ref": "#/messages/SpecV0Messages/RequestDeviceList" 1973 }, 1974 "RequestServerInfo": { 1975 "$ref": "#/messages/SpecV4Messages/RequestServerInfo" 1976 }, 1977 "ScanningFinished": { 1978 "$ref": "#/messages/SpecV0Messages/ScanningFinished" 1979 }, 1980 "InputCmd": { 1981 "$ref": "#/messages/SpecV4Messages/InputCmd" 1982 }, 1983 "InputReading": { 1984 "$ref": "#/messages/SpecV4Messages/InputReading" 1985 }, 1986 "ServerInfo": { 1987 "$ref": "#/messages/SpecV4Messages/ServerInfo" 1988 }, 1989 "StartScanning": { 1990 "$ref": "#/messages/SpecV0Messages/StartScanning" 1991 }, 1992 "StopAllDevices": { 1993 "$ref": "#/messages/SpecV0Messages/StopAllDevices" 1994 }, 1995 "StopDeviceCmd": { 1996 "$ref": "#/messages/SpecV0Messages/StopDeviceCmd" 1997 }, 1998 "StopScanning": { 1999 "$ref": "#/messages/SpecV0Messages/StopScanning" 2000 }, 2001 "OutputCmd": { 2002 "$ref": "#/messages/SpecV4Messages/OutputCmd" 2003 } 2004 }, 2005 "additionalProperties": false, 2006 "minProperties": 1, 2007 "maxProperties": 1 2008 }, 2009 "minItems": 1 2010 }, 2011 "MessageSpecV3": { 2012 "type": "array", 2013 "items": { 2014 "type": "object", 2015 "description": "All messages valid in Buttplug Spec v3", 2016 "properties": { 2017 "DeviceList": { 2018 "$ref": "#/messages/SpecV3Messages/DeviceList" 2019 }, 2020 "DeviceAdded": { 2021 "$ref": "#/messages/SpecV3Messages/DeviceAdded" 2022 }, 2023 "DeviceRemoved": { 2024 "$ref": "#/messages/SpecV0Messages/DeviceRemoved" 2025 }, 2026 "Error": { 2027 "$ref": "#/messages/SpecV0Messages/Error" 2028 }, 2029 "ScalarCmd": { 2030 "$ref": "#/messages/SpecV3Messages/ScalarCmd" 2031 }, 2032 "LinearCmd": { 2033 "$ref": "#/messages/SpecV1Messages/LinearCmd" 2034 }, 2035 "Ok": { 2036 "$ref": "#/messages/SpecV0Messages/Ok" 2037 }, 2038 "Ping": { 2039 "$ref": "#/messages/SpecV0Messages/Ping" 2040 }, 2041 "RawReadCmd": { 2042 "$ref": "#/messages/SpecV2Messages/RawReadCmd" 2043 }, 2044 "RawReading": { 2045 "$ref": "#/messages/SpecV2Messages/RawReading" 2046 }, 2047 "RawWriteCmd": { 2048 "$ref": "#/messages/SpecV2Messages/RawWriteCmd" 2049 }, 2050 "RawSubscribeCmd": { 2051 "$ref": "#/messages/SpecV2Messages/RawSubscribeCmd" 2052 }, 2053 "RawUnsubscribeCmd": { 2054 "$ref": "#/messages/SpecV2Messages/RawUnsubscribeCmd" 2055 }, 2056 "RequestDeviceList": { 2057 "$ref": "#/messages/SpecV0Messages/RequestDeviceList" 2058 }, 2059 "RequestServerInfo": { 2060 "$ref": "#/messages/SpecV1Messages/RequestServerInfo" 2061 }, 2062 "RotateCmd": { 2063 "$ref": "#/messages/SpecV1Messages/RotateCmd" 2064 }, 2065 "ScanningFinished": { 2066 "$ref": "#/messages/SpecV0Messages/ScanningFinished" 2067 }, 2068 "SensorReadCmd": { 2069 "$ref": "#/messages/SpecV3Messages/SensorReadCmd" 2070 }, 2071 "SensorReading": { 2072 "$ref": "#/messages/SpecV3Messages/SensorReading" 2073 }, 2074 "SensorSubscribeCmd": { 2075 "$ref": "#/messages/SpecV3Messages/SensorSubscribeCmd" 2076 }, 2077 "SensorUnsubscribeCmd": { 2078 "$ref": "#/messages/SpecV3Messages/SensorUnsubscribeCmd" 2079 }, 2080 "ServerInfo": { 2081 "$ref": "#/messages/SpecV2Messages/ServerInfo" 2082 }, 2083 "StartScanning": { 2084 "$ref": "#/messages/SpecV0Messages/StartScanning" 2085 }, 2086 "StopAllDevices": { 2087 "$ref": "#/messages/SpecV0Messages/StopAllDevices" 2088 }, 2089 "StopDeviceCmd": { 2090 "$ref": "#/messages/SpecV0Messages/StopDeviceCmd" 2091 }, 2092 "StopScanning": { 2093 "$ref": "#/messages/SpecV0Messages/StopScanning" 2094 } 2095 }, 2096 "additionalProperties": false, 2097 "minProperties": 1, 2098 "maxProperties": 1 2099 }, 2100 "minItems": 1 2101 }, 2102 "MessageSpecV2": { 2103 "type": "array", 2104 "items": { 2105 "type": "object", 2106 "description": "All messages valid in Buttplug Spec v2.", 2107 "properties": { 2108 "BatteryLevelCmd": { 2109 "$ref": "#/messages/SpecV2Messages/BatteryLevelCmd" 2110 }, 2111 "BatteryLevelReading": { 2112 "$ref": "#/messages/SpecV2Messages/BatteryLevelReading" 2113 }, 2114 "DeviceList": { 2115 "$ref": "#/messages/SpecV2Messages/DeviceList" 2116 }, 2117 "DeviceAdded": { 2118 "$ref": "#/messages/SpecV2Messages/DeviceAdded" 2119 }, 2120 "DeviceRemoved": { 2121 "$ref": "#/messages/SpecV0Messages/DeviceRemoved" 2122 }, 2123 "Error": { 2124 "$ref": "#/messages/SpecV0Messages/Error" 2125 }, 2126 "LinearCmd": { 2127 "$ref": "#/messages/SpecV1Messages/LinearCmd" 2128 }, 2129 "Ok": { 2130 "$ref": "#/messages/SpecV0Messages/Ok" 2131 }, 2132 "Ping": { 2133 "$ref": "#/messages/SpecV0Messages/Ping" 2134 }, 2135 "RawReadCmd": { 2136 "$ref": "#/messages/SpecV2Messages/RawReadCmd" 2137 }, 2138 "RawReading": { 2139 "$ref": "#/messages/SpecV2Messages/RawReading" 2140 }, 2141 "RawWriteCmd": { 2142 "$ref": "#/messages/SpecV2Messages/RawWriteCmd" 2143 }, 2144 "RawSubscribeCmd": { 2145 "$ref": "#/messages/SpecV2Messages/RawSubscribeCmd" 2146 }, 2147 "RawUnsubscribeCmd": { 2148 "$ref": "#/messages/SpecV2Messages/RawUnsubscribeCmd" 2149 }, 2150 "RequestDeviceList": { 2151 "$ref": "#/messages/SpecV0Messages/RequestDeviceList" 2152 }, 2153 "RequestLog": { 2154 "$ref": "#/messages/SpecV0Messages/RequestLog" 2155 }, 2156 "RequestServerInfo": { 2157 "$ref": "#/messages/SpecV1Messages/RequestServerInfo" 2158 }, 2159 "RotateCmd": { 2160 "$ref": "#/messages/SpecV1Messages/RotateCmd" 2161 }, 2162 "RSSILevelCmd": { 2163 "$ref": "#/messages/SpecV2Messages/RSSILevelCmd" 2164 }, 2165 "RSSILevelReading": { 2166 "$ref": "#/messages/SpecV2Messages/RSSILevelReading" 2167 }, 2168 "ScanningFinished": { 2169 "$ref": "#/messages/SpecV0Messages/ScanningFinished" 2170 }, 2171 "ServerInfo": { 2172 "$ref": "#/messages/SpecV2Messages/ServerInfo" 2173 }, 2174 "StartScanning": { 2175 "$ref": "#/messages/SpecV0Messages/StartScanning" 2176 }, 2177 "StopAllDevices": { 2178 "$ref": "#/messages/SpecV0Messages/StopAllDevices" 2179 }, 2180 "StopDeviceCmd": { 2181 "$ref": "#/messages/SpecV0Messages/StopDeviceCmd" 2182 }, 2183 "StopScanning": { 2184 "$ref": "#/messages/SpecV0Messages/StopScanning" 2185 }, 2186 "VibrateCmd": { 2187 "$ref": "#/messages/SpecV1Messages/VibrateCmd" 2188 } 2189 }, 2190 "additionalProperties": false, 2191 "minProperties": 1, 2192 "maxProperties": 1 2193 }, 2194 "minItems": 1 2195 }, 2196 "MessageSpecV1": { 2197 "type": "array", 2198 "items": { 2199 "type": "object", 2200 "description": "One or more messages validated by the Buttplug Message schema list.", 2201 "properties": { 2202 "DeviceList": { 2203 "$ref": "#/messages/SpecV1Messages/DeviceList" 2204 }, 2205 "DeviceAdded": { 2206 "$ref": "#/messages/SpecV1Messages/DeviceAdded" 2207 }, 2208 "DeviceRemoved": { 2209 "$ref": "#/messages/SpecV0Messages/DeviceRemoved" 2210 }, 2211 "Error": { 2212 "$ref": "#/messages/SpecV0Messages/Error" 2213 }, 2214 "FleshlightLaunchFW12Cmd": { 2215 "$ref": "#/messages/SpecV0Messages/FleshlightLaunchFW12Cmd" 2216 }, 2217 "KiirooCmd": { 2218 "$ref": "#/messages/SpecV0Messages/KiirooCmd" 2219 }, 2220 "LinearCmd": { 2221 "$ref": "#/messages/SpecV1Messages/LinearCmd" 2222 }, 2223 "Log": { 2224 "$ref": "#/messages/SpecV0Messages/Log" 2225 }, 2226 "Ok": { 2227 "$ref": "#/messages/SpecV0Messages/Ok" 2228 }, 2229 "Ping": { 2230 "$ref": "#/messages/SpecV0Messages/Ping" 2231 }, 2232 "RequestDeviceList": { 2233 "$ref": "#/messages/SpecV0Messages/RequestDeviceList" 2234 }, 2235 "RequestLog": { 2236 "$ref": "#/messages/SpecV0Messages/RequestLog" 2237 }, 2238 "RequestServerInfo": { 2239 "$ref": "#/messages/SpecV1Messages/RequestServerInfo" 2240 }, 2241 "RotateCmd": { 2242 "$ref": "#/messages/SpecV1Messages/RotateCmd" 2243 }, 2244 "ServerInfo": { 2245 "$ref": "#/messages/SpecV1Messages/ServerInfo" 2246 }, 2247 "StartScanning": { 2248 "$ref": "#/messages/SpecV0Messages/StartScanning" 2249 }, 2250 "StopAllDevices": { 2251 "$ref": "#/messages/SpecV0Messages/StopAllDevices" 2252 }, 2253 "StopDeviceCmd": { 2254 "$ref": "#/messages/SpecV0Messages/StopDeviceCmd" 2255 }, 2256 "StopScanning": { 2257 "$ref": "#/messages/SpecV0Messages/StopScanning" 2258 }, 2259 "Test": { 2260 "$ref": "#/messages/SpecV0Messages/Test" 2261 }, 2262 "VibrateCmd": { 2263 "$ref": "#/messages/SpecV1Messages/VibrateCmd" 2264 }, 2265 "VorzeA10CycloneCmd": { 2266 "$ref": "#/messages/SpecV0Messages/VorzeA10CycloneCmd" 2267 } 2268 }, 2269 "additionalProperties": false, 2270 "minProperties": 1, 2271 "maxProperties": 1 2272 }, 2273 "minItems": 1 2274 }, 2275 "MessageSpecV0": { 2276 "type": "array", 2277 "items": { 2278 "type": "object", 2279 "description": "One or more messages validated by the Buttplug Message schema list.", 2280 "properties": { 2281 "DeviceList": { 2282 "$ref": "#/messages/SpecV0Messages/DeviceList" 2283 }, 2284 "DeviceAdded": { 2285 "$ref": "#/messages/SpecV0Messages/DeviceAdded" 2286 }, 2287 "DeviceRemoved": { 2288 "$ref": "#/messages/SpecV0Messages/DeviceRemoved" 2289 }, 2290 "Error": { 2291 "$ref": "#/messages/SpecV0Messages/Error" 2292 }, 2293 "Log": { 2294 "$ref": "#/messages/SpecV0Messages/Log" 2295 }, 2296 "Ok": { 2297 "$ref": "#/messages/SpecV0Messages/Ok" 2298 }, 2299 "Ping": { 2300 "$ref": "#/messages/SpecV0Messages/Ping" 2301 }, 2302 "RequestDeviceList": { 2303 "$ref": "#/messages/SpecV0Messages/RequestDeviceList" 2304 }, 2305 "RequestLog": { 2306 "$ref": "#/messages/SpecV0Messages/RequestLog" 2307 }, 2308 "RequestServerInfo": { 2309 "$ref": "#/messages/SpecV0Messages/RequestServerInfo" 2310 }, 2311 "ServerInfo": { 2312 "$ref": "#/messages/SpecV0Messages/ServerInfo" 2313 }, 2314 "StartScanning": { 2315 "$ref": "#/messages/SpecV0Messages/StartScanning" 2316 }, 2317 "StopAllDevices": { 2318 "$ref": "#/messages/SpecV0Messages/StopAllDevices" 2319 }, 2320 "StopDeviceCmd": { 2321 "$ref": "#/messages/SpecV0Messages/StopDeviceCmd" 2322 }, 2323 "StopScanning": { 2324 "$ref": "#/messages/SpecV0Messages/StopScanning" 2325 }, 2326 "Test": { 2327 "$ref": "#/messages/SpecV0Messages/Test" 2328 }, 2329 "FleshlightLaunchFW12Cmd": { 2330 "$ref": "#/messages/SpecV0Messages/FleshlightLaunchFW12Cmd" 2331 }, 2332 "KiirooCmd": { 2333 "$ref": "#/messages/SpecV0Messages/KiirooCmd" 2334 }, 2335 "SingleMotorVibrateCmd": { 2336 "$ref": "#/messages/SpecV0Messages/SingleMotorVibrateCmd" 2337 }, 2338 "VorzeA10CycloneCmd": { 2339 "$ref": "#/messages/SpecV0Messages/VorzeA10CycloneCmd" 2340 } 2341 }, 2342 "additionalProperties": false, 2343 "minProperties": 1, 2344 "maxProperties": 1 2345 }, 2346 "minItems": 1 2347 } 2348 }, 2349 "anyOf": [ 2350 { 2351 "$ref": "#/specs/MessageSpecV4" 2352 }, 2353 { 2354 "$ref": "#/specs/MessageSpecV3" 2355 }, 2356 { 2357 "$ref": "#/specs/MessageSpecV2" 2358 }, 2359 { 2360 "$ref": "#/specs/MessageSpecV1" 2361 }, 2362 { 2363 "$ref": "#/specs/MessageSpecV0" 2364 } 2365 ] 2366}