This class manages the synchronisation of a remote block of heap memory used by a littlefoot program running on a block. More...
#include <juce_LittleFootRemoteHeap.h>
Classes | |
struct | ChangeMessage |
struct | Diff |
Public Member Functions | |
LittleFootRemoteHeap (uint32 blockSizeToUse) noexcept | |
void | clear () noexcept |
uint8 | getByte (size_t offset) noexcept |
void | handleACKFromDevice (ImplementationClass &bi, uint32 packetIndex) noexcept |
void | invalidateData () noexcept |
bool | isFullySynced () const noexcept |
bool | isProgramLoaded () noexcept |
void | resetDataRangeToUnknown (size_t offset, size_t size) noexcept |
void | resetDeviceStateToUnknown () |
void | sendChanges (ImplementationClass &bi, bool forceSend) |
void | setBits (uint32 startBit, uint32 numBits, uint32 value) noexcept |
void | setByte (size_t offset, uint8 value) noexcept |
void | setBytes (size_t offset, const uint8 *data, size_t num) noexcept |
Static Public Member Functions | |
static bool | isAllZero (const uint8 *data, size_t size) noexcept |
Public Attributes | |
const size_t | blockSize |
Static Public Attributes | |
static constexpr uint16 | unknownByte = 0x100 |
Private Member Functions | |
void | dumpStatus () |
uint16 * | getLatestExpectedDataState () noexcept |
int | getTotalSizeOfMessagesSent () const noexcept |
Private Attributes | |
uint16 | deviceState [ImplementationClass::maxBlockSize] = { 0 } |
uint32 | lastPacketIndexReceived = 0 |
OwnedArray< ChangeMessage > | messagesSent |
bool | needsSyncing = true |
bool | programLoaded = false |
uint32 | programSize = 0 |
bool | programStateKnown = true |
uint8 | targetData [ImplementationClass::maxBlockSize] = { 0 } |
This class manages the synchronisation of a remote block of heap memory used by a littlefoot program running on a block.
Data in the block can be changed by calling setByte, setBytes, setBits etc, and these changes will be flushed to the device when sendChanges is called.
{Blocks}
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineprivate |
References DBG, juce::ignoreUnused(), int(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::isProgramLoaded(), and juce::roundToInt().
Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::handleACKFromDevice(), and littlefoot::LittleFootRemoteHeap< ImplementationClass >::sendChanges().
|
inlinenoexcept |
|
inlineprivatenoexcept |
References littlefoot::LittleFootRemoteHeap< ImplementationClass >::deviceState, and littlefoot::LittleFootRemoteHeap< ImplementationClass >::messagesSent.
Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDataRangeToUnknown(), and littlefoot::LittleFootRemoteHeap< ImplementationClass >::sendChanges().
|
inlineprivatenoexcept |
|
inlinenoexcept |
References littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize, littlefoot::LittleFootRemoteHeap< ImplementationClass >::deviceState, littlefoot::LittleFootRemoteHeap< ImplementationClass >::dumpStatus(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::lastPacketIndexReceived, littlefoot::LittleFootRemoteHeap< ImplementationClass >::messagesSent, littlefoot::LittleFootRemoteHeap< ImplementationClass >::needsSyncing, littlefoot::LittleFootRemoteHeap< ImplementationClass >::programStateKnown, littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDeviceStateToUnknown(), and littlefoot::LittleFootRemoteHeap< ImplementationClass >::sendChanges().
|
inlinenoexcept |
References littlefoot::LittleFootRemoteHeap< ImplementationClass >::needsSyncing, and littlefoot::LittleFootRemoteHeap< ImplementationClass >::programStateKnown.
Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::clear(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDeviceStateToUnknown(), and littlefoot::LittleFootRemoteHeap< ImplementationClass >::setBits().
|
inlinestaticnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
References littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize, littlefoot::Program::checksumMatches(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::deviceState, littlefoot::Program::getProgramSize(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::programLoaded, littlefoot::LittleFootRemoteHeap< ImplementationClass >::programSize, and littlefoot::LittleFootRemoteHeap< ImplementationClass >::programStateKnown.
Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::dumpStatus().
|
inlinenoexcept |
|
inline |
References littlefoot::LittleFootRemoteHeap< ImplementationClass >::invalidateData(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::messagesSent, and littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDataRangeToUnknown().
Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::handleACKFromDevice(), and littlefoot::LittleFootRemoteHeap< ImplementationClass >::LittleFootRemoteHeap().
|
inline |
References littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize, littlefoot::LittleFootRemoteHeap< ImplementationClass >::Diff::createChangeMessage(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::dumpStatus(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::getLatestExpectedDataState(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::getTotalSizeOfMessagesSent(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::isAllZero(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::lastPacketIndexReceived, littlefoot::LittleFootRemoteHeap< ImplementationClass >::messagesSent, littlefoot::LittleFootRemoteHeap< ImplementationClass >::needsSyncing, and littlefoot::LittleFootRemoteHeap< ImplementationClass >::targetData.
Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::handleACKFromDevice().
|
inlinenoexcept |
References littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize, littlefoot::LittleFootRemoteHeap< ImplementationClass >::invalidateData(), jassertfalse, juce::readLittleEndianBitsInBuffer(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::targetData, and juce::writeLittleEndianBitsInBuffer().
|
inlinenoexcept |
References littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize, jassertfalse, littlefoot::LittleFootRemoteHeap< ImplementationClass >::needsSyncing, littlefoot::LittleFootRemoteHeap< ImplementationClass >::programSize, littlefoot::LittleFootRemoteHeap< ImplementationClass >::programStateKnown, and littlefoot::LittleFootRemoteHeap< ImplementationClass >::targetData.
Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::setBytes().
|
inlinenoexcept |
const size_t littlefoot::LittleFootRemoteHeap< ImplementationClass >::blockSize |
Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::Diff::createChangeMessage(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::getByte(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::handleACKFromDevice(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::isProgramLoaded(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::sendChanges(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::setBits(), and littlefoot::LittleFootRemoteHeap< ImplementationClass >::setByte().
|
private |
|
private |
|
private |
Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::getLatestExpectedDataState(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::handleACKFromDevice(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::resetDeviceStateToUnknown(), and littlefoot::LittleFootRemoteHeap< ImplementationClass >::sendChanges().
|
private |
Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::handleACKFromDevice(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::invalidateData(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::isFullySynced(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::sendChanges(), and littlefoot::LittleFootRemoteHeap< ImplementationClass >::setByte().
|
private |
|
private |
|
private |
Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::handleACKFromDevice(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::invalidateData(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::isProgramLoaded(), and littlefoot::LittleFootRemoteHeap< ImplementationClass >::setByte().
|
private |
Referenced by littlefoot::LittleFootRemoteHeap< ImplementationClass >::clear(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::getByte(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::sendChanges(), littlefoot::LittleFootRemoteHeap< ImplementationClass >::setBits(), and littlefoot::LittleFootRemoteHeap< ImplementationClass >::setByte().
|
static |