11 #ifndef TCMENU_BASEBUFFEREDREMOTETRANSPORT_H
12 #define TCMENU_BASEBUFFEREDREMOTETRANSPORT_H
15 #define TICKS_TO_FLUSH_WRITE 140
19 enum BufferingMode : uint8_t {
20 BUFFER_ONE_MESSAGE, BUFFER_MESSAGES_TILL_FULL
37 virtual int encryptData(
const uint8_t *plainText,
int bytesIn,
const uint8_t *buffer,
size_t buffLen) = 0;
46 virtual int decryptData(
const uint8_t *encoded,
int bytesIn,
const uint8_t *buffer,
size_t buffLen) = 0;
58 const uint16_t writeBufferSize;
59 const uint16_t readBufferSize;
62 uint8_t *encryptionBuffer;
63 uint16_t writeBufferPos;
64 uint16_t readBufferPos;
65 uint16_t encryptionBufferPos;
66 uint16_t readBufferAvail;
69 uint8_t ticksSinceWrite;
76 void endMsg()
override;
78 int writeChar(
char data)
override;
80 int writeStr(
const char *data)
override;
82 uint8_t readByte()
override;
84 bool readAvailable()
override;
86 void close()
override;
88 void flushIfRequired();
92 virtual int fillReadBuffer(uint8_t *dataBuffer,
int maxSize) = 0;
Contains the base functionality for communication between the menu library and remote APIs.
Definition: RemoteConnector.h:141
Definition: BaseBufferedRemoteTransport.h:56
Definition: BaseBufferedRemoteTransport.h:27
virtual int encryptData(const uint8_t *plainText, int bytesIn, const uint8_t *buffer, size_t buffLen)=0
virtual int decryptData(const uint8_t *encoded, int bytesIn, const uint8_t *buffer, size_t buffLen)=0