The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
3.2KB

  1. A blocks packet consists of a stream of packed bits.
  2. The first 7 bits of a message is the index of the device within the topology to which the
  3. message should be delivered, or from which it originated. The 0x40 bit of this will be set
  4. to indicate that it's a device->host message, or clear for host->device
  5. The next 32 bits are a timestamp, in milliseconds since the source device was booted.
  6. If sending from the host to the device, or for types of packet
  7. where the timestamp is irrelevant, this can be 0.
  8. This is followed by a sequence of 1 or more messages. Each message starts with
  9. a 7 bit message type, followed by message-type-specific data.
  10. ---------------------------------------------------------------------------------------
  11. Device topology update (device -> host)
  12. 7 bits - message type (0x01)
  13. 7 bits - number of device-info blocks to follow
  14. 8 bits - number of connection-info blocks to follow
  15. This is followed by a series of device-info blocks of the form:
  16. 10 bits - device model identifier (see code for list of types)
  17. 32 bits - device GUID
  18. 10 bits - device firmware version
  19. 6 bits - battery status
  20. Next follows by a series of connection-info blocks of ths form:
  21. 7 bits - device 1 index (i.e. index in the list of devices sent above)
  22. 5 bits - device 1 port type
  23. 7 bits - device 2 index
  24. 5 bits - device 2 port type
  25. Ports are indicated by being either North, South, East or West on a device, plus
  26. an index to indicate their position along that edge.
  27. ---------------------------------------------------------------------------------------
  28. Control button down/up (device -> host)
  29. 7 bits - message type (down = 0x20, up = 0x21)
  30. 7 bits - device index
  31. 12 bits - control button ID (see code for values)
  32. ---------------------------------------------------------------------------------------
  33. Touch start/move/end (device -> host)
  34. 7 bits - message type (start = 0x10, move = 0x11, end = 0x12)
  35. 7 bits - device index
  36. 5 bits - touch index
  37. 12 bits - touch X position
  38. 12 bits - touch Y position
  39. 8 bits - touch Z position
  40. ---------------------------------------------------------------------------------------
  41. Touch start/move/end with velocity (device -> host)
  42. 7 bits - message type (start = 0x13, move = 0x14, end = 0x15)
  43. 7 bits - device index
  44. 5 bits - touch index
  45. 12 bits - touch X position
  46. 12 bits - touch Y position
  47. 8 bits - touch Z position
  48. 8 bits - X velocity
  49. 8 bits - Y velocity
  50. 8 bits - Z velocity
  51. ---------------------------------------------------------------------------------------
  52. ---------------------------------------------------------------------------------------
  53. Device command message (host -> device)
  54. 7 bits - message type (0x01)
  55. 8 bits - command type
  56. Command types:
  57. resetDevice = 0x00,
  58. requestTopologyMessage = 0x01,
  59. setHighResTouchDetectionMode = 0x02,
  60. setLowResTouchDetectionMode = 0x03,
  61. ---------------------------------------------------------------------------------------
  62. Modify shared state data block
  63. 7 bits - message type (0x02)
  64. ..then repeatedly:
  65. 3 bits - type of data change command
  66. ...extra command-specific bits..
  67. 3 bits - type of data change command
  68. ..etc..
  69. 3 bits - end of sequence command