BlocksProtocol::HostPacketBuilder< maxPacketBytes > Struct Template Reference
juce_blocks_basics » protocol

Helper class for constructing a packet for sending to a BLOCKS device. More...

## Public Member Functions

| HostPacketBuilder () noexcept
| HostPacketBuilder (const HostPacketBuilder &)=delete
| HostPacketBuilder (HostPacketBuilder &&)=default
const void * | getData () const noexcept
int | size () const noexcept
void | writePacketSysexHeaderBytes (TopologyIndex deviceIndex) noexcept
void | writePacketSysexFooter () noexcept
bool | deviceControlMessage (DeviceCommand command) noexcept
bool | beginDataChanges (PacketIndex packetIndex) noexcept
bool | endDataChanges (bool isLastChange) noexcept
bool | skipBytes (int numToSkip) noexcept
bool | setMultipleBytes (const uint8 *values, int num) noexcept
bool | setMultipleBytes (uint8 value, uint8 lastValue, int num) noexcept
bool | addProgramEventMessage (const int32 *messageData)
bool | addFirmwareUpdatePacket (const uint8 *packetData, uint8 size)
bool | addConfigSetMessage (int32 item, int32 value)
bool | addRequestMessage (int32 item)
bool | addRequestFactorySyncMessage ()
bool | addRequestUserSyncMessage ()
bool | addFactoryReset ()
bool | addBlockReset ()
bool | addSetBlockName (const String &name)

## Detailed Description

### template<int maxPacketBytes>
struct BlocksProtocol::HostPacketBuilder< maxPacketBytes >

Helper class for constructing a packet for sending to a BLOCKS device.

## Constructor & Destructor Documentation

## HostPacketBuilder() [1/3]

template<int maxPacketBytes>

BlocksProtocol::HostPacketBuilder< maxPacketBytes >::HostPacketBuilder | ( |  | ) |

noexcept

## HostPacketBuilder() [2/3]

template<int maxPacketBytes>

BlocksProtocol::HostPacketBuilder< maxPacketBytes >::HostPacketBuilder | ( | const HostPacketBuilder< maxPacketBytes > & |  | ) |

delete

## HostPacketBuilder() [3/3]

template<int maxPacketBytes>

BlocksProtocol::HostPacketBuilder< maxPacketBytes >::HostPacketBuilder | ( | HostPacketBuilder< maxPacketBytes > && |  | ) |

default

## Member Function Documentation

## getData()

template<int maxPacketBytes>

const void* BlocksProtocol::HostPacketBuilder< maxPacketBytes >::getData | ( |  | ) | const

noexcept

References BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::getData().

## size()

template<int maxPacketBytes>

int BlocksProtocol::HostPacketBuilder< maxPacketBytes >::size | ( |  | ) | const

noexcept

References BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::size().

Referenced by BlocksProtocol::HostPacketBuilder< maxPacketBytes >::addFirmwareUpdatePacket().

## writePacketSysexHeaderBytes()

template<int maxPacketBytes>

void BlocksProtocol::HostPacketBuilder< maxPacketBytes >::writePacketSysexHeaderBytes | ( | TopologyIndex | deviceIndex | ) |

noexcept

References jassert, and BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::writeHeaderSysexBytes().

## writePacketSysexFooter()

template<int maxPacketBytes>

void BlocksProtocol::HostPacketBuilder< maxPacketBytes >::writePacketSysexFooter | ( |  | ) |

noexcept

References BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::writePacketSysexFooter().

## deviceControlMessage()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::deviceControlMessage | ( | DeviceCommand | command | ) |

noexcept

References BlocksProtocol::IntegerWithBitSize< numBits >::bits, command, BlocksProtocol::deviceCommandMessage, and BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity().

## beginDataChanges()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::beginDataChanges | ( | PacketIndex | packetIndex | ) |

noexcept

References BlocksProtocol::IntegerWithBitSize< numBits >::bits, BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity(), and BlocksProtocol::sharedDataChange.

## endDataChanges()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::endDataChanges | ( | bool | isLastChange | ) |

noexcept

References BlocksProtocol::IntegerWithBitSize< numBits >::bits, BlocksProtocol::endOfChanges, BlocksProtocol::endOfPacket, and BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity().

## skipBytes()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::skipBytes | ( | int | numToSkip | ) |

noexcept

References BlocksProtocol::IntegerWithBitSize< numBits >::bits, BlocksProtocol::IntegerWithBitSize< 8 >::bits, BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::getState(), BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity(), BlocksProtocol::IntegerWithBitSize< numBits >::maxValue, BlocksProtocol::IntegerWithBitSize< 8 >::maxValue, BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::restore(), BlocksProtocol::skipBytesFew, and BlocksProtocol::skipBytesMany.

## setMultipleBytes() [1/2]

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::setMultipleBytes | ( | const uint8 * | values,
|  | int | num
| ) |  |

noexcept

Referenced by BlocksProtocol::HostPacketBuilder< maxPacketBytes >::setMultipleBytes().

## setMultipleBytes() [2/2]

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::setMultipleBytes | ( | uint8 | value,
|  | uint8 | lastValue,
|  | int | num
| ) |  |

noexcept

References BlocksProtocol::IntegerWithBitSize< numBits >::bits, BlocksProtocol::IntegerWithBitSize< 8 >::bits, BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::getState(), BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity(), BlocksProtocol::IntegerWithBitSize< numBits >::maxValue, BlocksProtocol::IntegerWithBitSize< 8 >::maxValue, BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::restore(), BlocksProtocol::setFewBytesWithLastValue, BlocksProtocol::setFewBytesWithValue, BlocksProtocol::setManyBytesWithValue, and BlocksProtocol::HostPacketBuilder< maxPacketBytes >::setMultipleBytes().

## addProgramEventMessage()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::addProgramEventMessage | ( | const int32 * | messageData | ) |

References BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity(), and BlocksProtocol::programEventMessage.

## addFirmwareUpdatePacket()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::addFirmwareUpdatePacket | ( | const uint8 * | packetData,
|  | uint8 | size
| ) |  |

References BlocksProtocol::IntegerWithBitSize< numBits >::bits, BlocksProtocol::firmwareUpdatePacket, BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity(), and BlocksProtocol::HostPacketBuilder< maxPacketBytes >::size().

## addConfigSetMessage()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::addConfigSetMessage | ( | int32 | item,
|  | int32 | value
| ) |  |

References BlocksProtocol::configMessage, BlocksProtocol::configSetMessage, BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity(), and BlocksProtocol::setConfig.

Referenced by BlockConfigManager::setBlockConfig().

## addRequestMessage()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::addRequestMessage | ( | int32 | item | ) |

References BlocksProtocol::configMessage, BlocksProtocol::configSetMessage, BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity(), and BlocksProtocol::requestConfig.

Referenced by BlockConfigManager::requestBlockConfig().

## addRequestFactorySyncMessage()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::addRequestFactorySyncMessage | ( |  | ) |

References BlocksProtocol::IntegerWithBitSize< numBits >::bits, BlocksProtocol::configMessage, BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity(), and BlocksProtocol::requestFactorySync.

Referenced by BlockConfigManager::requestFactoryConfigSync().

## addRequestUserSyncMessage()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::addRequestUserSyncMessage | ( |  | ) |

References BlocksProtocol::IntegerWithBitSize< numBits >::bits, BlocksProtocol::configMessage, BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity(), and BlocksProtocol::requestUserSync.

Referenced by BlockConfigManager::requestUserConfigSync().

## addFactoryReset()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::addFactoryReset | ( |  | ) |

References BlocksProtocol::IntegerWithBitSize< numBits >::bits, BlocksProtocol::factoryReset, and BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity().

## addBlockReset()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::addBlockReset | ( |  | ) |

References BlocksProtocol::IntegerWithBitSize< numBits >::bits, BlocksProtocol::blockReset, and BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity().

## addSetBlockName()

template<int maxPacketBytes>

bool BlocksProtocol::HostPacketBuilder< maxPacketBytes >::addSetBlockName | ( | const String & | name | ) |

References BlocksProtocol::IntegerWithBitSize< numBits >::bits, BlocksProtocol::Packed7BitArrayBuilder< allocatedBytes >::hasCapacity(), String::length(), BlocksProtocol::setName, and String::toRawUTF8().

The documentation for this struct was generated from the following file:

- juce_HostPacketBuilder.h