The BLOCKS SDK
roli_BlocksProtocolDefinitions.h File Reference

Classes

struct  BlocksProtocol::BlockStringData< MaxSize >
 Structure for generic block data. More...
 
struct  BlocksProtocol::BlockSerialNumber
 Structure describing a block's serial number. More...
 
struct  BlocksProtocol::DeviceStatus
 Structure for the device status. More...
 
struct  BlocksProtocol::DeviceConnection
 Structure for the device connection. More...
 
struct  BlocksProtocol::DeviceVersion
 Structure for the device version. More...
 
struct  BlocksProtocol::DeviceName
 Structure used for the device name. More...
 
struct  BlocksProtocol::TouchPosition
 The coordinates of a touch. More...
 
struct  BlocksProtocol::TouchVelocity
 The velocities for each dimension of a touch. More...
 

Namespaces

 BlocksProtocol
 
 BlocksProtocol::SpecialMessageFromHost
 Messages that the host may send to a device that do not have the usual message format.
 

Typedefs

using BlocksProtocol::ProtocolVersion = IntegerWithBitSize< 8 >
 
using BlocksProtocol::PacketTimestamp = IntegerWithBitSize< 32 >
 A timestamp for a packet, in milliseconds since device boot-up. More...
 
using BlocksProtocol::PacketTimestampOffset = IntegerWithBitSize< 5 >
 This relative timestamp is for use inside a packet, and it represents a number of milliseconds that should be added to the packet's timestamp. More...
 
using BlocksProtocol::MessageType = IntegerWithBitSize< 7 >
 This is the first item in a BLOCKS message, identifying the message type. More...
 
using BlocksProtocol::TopologyIndex = juce::uint8
 This is a type of index identifier used to refer to a block within a group. More...
 
using BlocksProtocol::DeviceCount = IntegerWithBitSize< 7 >
 
using BlocksProtocol::ConnectionCount = IntegerWithBitSize< 8 >
 
using BlocksProtocol::BatteryLevel = IntegerWithBitSize< 5 >
 Battery charge level. More...
 
using BlocksProtocol::BatteryCharging = IntegerWithBitSize< 1 >
 Battery charger connection flag. More...
 
using BlocksProtocol::ConnectorPort = IntegerWithBitSize< 5 >
 ConnectorPort is an index, starting at 0 for the leftmost port on the top edge, and going clockwise. More...
 
using BlocksProtocol::VersionNumber = BlockStringData< 21 >
 
using BlocksProtocol::BlockName = BlockStringData< 33 >
 
using BlocksProtocol::TouchIndex = IntegerWithBitSize< 5 >
 The index of a touch, i.e. More...
 
using BlocksProtocol::PacketCounter = IntegerWithBitSize< 10 >
 
using BlocksProtocol::DeviceCommand = IntegerWithBitSize< 9 >
 
using BlocksProtocol::ConfigCommand = IntegerWithBitSize< 4 >
 
using BlocksProtocol::ConfigItemIndex = IntegerWithBitSize< 8 >
 
using BlocksProtocol::ConfigItemValue = IntegerWithBitSize< 32 >
 
using BlocksProtocol::ControlButtonID = IntegerWithBitSize< 12 >
 An ID for a control-block button type. More...
 
using BlocksProtocol::RotaryDialIndex = IntegerWithBitSize< 7 >
 
using BlocksProtocol::RotaryDialAngle = IntegerWithBitSize< 14 >
 
using BlocksProtocol::RotaryDialDelta = IntegerWithBitSize< 14 >
 
using BlocksProtocol::PacketIndex = IntegerWithBitSize< 16 >
 
using BlocksProtocol::DataChangeCommand = IntegerWithBitSize< 3 >
 
using BlocksProtocol::ByteCountFew = IntegerWithBitSize< 4 >
 
using BlocksProtocol::ByteCountMany = IntegerWithBitSize< 8 >
 
using BlocksProtocol::ByteValue = IntegerWithBitSize< 8 >
 
using BlocksProtocol::ByteSequenceContinues = IntegerWithBitSize< 1 >
 
using BlocksProtocol::FirmwareUpdateACKCode = IntegerWithBitSize< 7 >
 
using BlocksProtocol::FirmwareUpdateACKDetail = IntegerWithBitSize< 32 >
 
using BlocksProtocol::FirmwareUpdatePacketSize = IntegerWithBitSize< 7 >
 

Enumerations

enum class  BlocksProtocol::MessageFromDevice {
  BlocksProtocol::deviceTopology = 0x01 , BlocksProtocol::packetACK = 0x02 , BlocksProtocol::firmwareUpdateACK = 0x03 , BlocksProtocol::deviceTopologyExtend = 0x04 ,
  BlocksProtocol::deviceTopologyEnd = 0x05 , BlocksProtocol::deviceVersion = 0x06 , BlocksProtocol::deviceName = 0x07 , BlocksProtocol::touchStart = 0x10 ,
  BlocksProtocol::touchMove = 0x11 , BlocksProtocol::touchEnd = 0x12 , BlocksProtocol::touchStartWithVelocity = 0x13 , BlocksProtocol::touchMoveWithVelocity = 0x14 ,
  BlocksProtocol::touchEndWithVelocity = 0x15 , BlocksProtocol::configMessage = 0x18 , BlocksProtocol::controlButtonDown = 0x20 , BlocksProtocol::controlButtonUp = 0x21 ,
  BlocksProtocol::programEventMessage = 0x28 , BlocksProtocol::logMessage = 0x30
}
 Messages that a device may send to the host. More...
 
enum class  BlocksProtocol::MessageFromHost {
  BlocksProtocol::deviceCommandMessage = 0x01 , BlocksProtocol::sharedDataChange = 0x02 , BlocksProtocol::programEventMessage = 0x03 , BlocksProtocol::firmwareUpdatePacket = 0x04 ,
  BlocksProtocol::configMessage = 0x10 , BlocksProtocol::factoryReset = 0x11 , BlocksProtocol::blockReset = 0x12 , BlocksProtocol::setName = 0x20
}
 Messages that the host may send to a device. More...
 
enum  BlocksProtocol::DeviceCommands {
  BlocksProtocol::beginAPIMode = 0x00 , BlocksProtocol::requestTopologyMessage = 0x01 , BlocksProtocol::endAPIMode = 0x02 , BlocksProtocol::ping = 0x03 ,
  BlocksProtocol::debugMode = 0x04 , BlocksProtocol::saveProgramAsDefault = 0x05
}
 
enum  BlocksProtocol::ConfigCommands {
  BlocksProtocol::setConfig = 0x00 , BlocksProtocol::requestConfig = 0x01 , BlocksProtocol::requestFactorySync = 0x02 , BlocksProtocol::requestUserSync = 0x03 ,
  BlocksProtocol::updateConfig = 0x04 , BlocksProtocol::updateUserConfig = 0x05 , BlocksProtocol::setConfigState = 0x06 , BlocksProtocol::factorySyncEnd = 0x07 ,
  BlocksProtocol::clusterConfigSync = 0x08 , BlocksProtocol::factorySyncReset = 0x09
}
 
enum  BlocksProtocol::DataChangeCommands {
  BlocksProtocol::endOfPacket = 0 , BlocksProtocol::endOfChanges = 1 , BlocksProtocol::skipBytesFew = 2 , BlocksProtocol::skipBytesMany = 3 ,
  BlocksProtocol::setSequenceOfBytes = 4 , BlocksProtocol::setFewBytesWithValue = 5 , BlocksProtocol::setFewBytesWithLastValue = 6 , BlocksProtocol::setManyBytesWithValue = 7
}
 
enum  BlocksProtocol::BitSizes {
  BlocksProtocol::topologyMessageHeader = (int) MessageType::bits + (int) ProtocolVersion::bits + (int) DeviceCount::bits + (int) ConnectionCount::bits , BlocksProtocol::topologyDeviceInfo = (int) BlockSerialNumber::maxLength * 7 + (int) BatteryLevel::bits + (int) BatteryCharging::bits , BlocksProtocol::topologyConnectionInfo = topologyIndexBits + (int) ConnectorPort::bits + topologyIndexBits + (int) ConnectorPort::bits , BlocksProtocol::typeDeviceAndTime = (int) MessageType::bits + (int) PacketTimestampOffset::bits ,
  BlocksProtocol::touchMessage = (int) typeDeviceAndTime + (int) TouchIndex::bits + (int) TouchPosition::bits , BlocksProtocol::touchMessageWithVelocity = (int) touchMessage + (int) TouchVelocity::bits , BlocksProtocol::programEventMessage = (int) MessageType::bits + 32 * numProgramMessageInts , BlocksProtocol::programEventMessage = 0x28 ,
  BlocksProtocol::programEventMessage = 0x03 , BlocksProtocol::packetACK = (int) MessageType::bits + (int) PacketCounter::bits , BlocksProtocol::packetACK = 0x02 , BlocksProtocol::firmwareUpdateACK = (int) MessageType::bits + (int) FirmwareUpdateACKCode::bits + (int) FirmwareUpdateACKDetail::bits ,
  BlocksProtocol::firmwareUpdateACK = 0x03 , BlocksProtocol::controlButtonMessage = (int) typeDeviceAndTime + (int) ControlButtonID::bits , BlocksProtocol::configSetMessage = (int) MessageType::bits + (int) ConfigCommand::bits + (int) ConfigItemIndex::bits + (int) ConfigItemValue::bits , BlocksProtocol::configRespMessage = (int) MessageType::bits + (int) ConfigCommand::bits + (int) ConfigItemIndex::bits + ((int) ConfigItemValue::bits * 3) ,
  BlocksProtocol::configSyncEndMessage = (int) MessageType::bits + (int) ConfigCommand::bits
}
 Contains the number of bits required to encode various items in the packets. More...
 

Variables

constexpr juce::uint8 BlocksProtocol::SpecialMessageFromHost::resetMaster [6] = { 0xf0, 0x00, 0x21, 0x10, 0x49, 0xf7 }