Line data Source code
1 : #pragma once 2 : 3 : #include <Settings/SettingsWrapper.hpp> 4 : 5 : BEGIN_CS_NAMESPACE 6 : 7 694 : class SysExBuffer { 8 : private: 9 : uint8_t SysExBuffer[SYSEX_BUFFER_SIZE]; 10 694 : size_t SysExLength = 0; 11 694 : bool receiving = false; 12 : 13 : public: 14 : /// Start a new SysEx message. 15 : void start(); 16 : /// Finish the current SysEx message. 17 : void end(); 18 : /// Add a byte to the current SysEx message. 19 : bool add(uint8_t data); 20 : /// Check if the buffer has at least 1 byte of free space available. 21 : bool hasSpaceLeft() const; 22 : /// Check if the buffer is receiving a SysEx message. 23 : bool isReceiving() const; 24 : /// Get a pointer to the buffer. 25 : const uint8_t *getBuffer() const; 26 : /// Get the length of the SysEx message in the buffer. 27 : size_t getLength() const; 28 : }; 29 : 30 : END_CS_NAMESPACE