ts: isBigPacket convert from define to method

This commit is contained in:
Andrey Gusakov 2024-05-22 12:17:35 +03:00 committed by rusefillc
parent 1ea4401ac9
commit 3d20eefeac
2 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,9 @@ size_t TsChannelBase::read(uint8_t* buffer, size_t size) {
}
#endif
#define isBigPacket(size) ((TS_PACKET_HEADER_SIZE + size + TS_PACKET_TAIL_SIZE) > sizeof(scratchBuffer))
bool TsChannelBase::isBigPacket(size_t size) {
return ((TS_PACKET_HEADER_SIZE + size + TS_PACKET_TAIL_SIZE) > sizeof(scratchBuffer));
}
void TsChannelBase::copyAndWriteSmallCrcPacket(uint8_t responseCode, const uint8_t* buf, size_t size) {
// don't transmit too large a buffer

View File

@ -75,6 +75,7 @@ public:
bool in_sync = false;
private:
bool isBigPacket(size_t size);
void writeCrcPacketLarge(uint8_t responseCode, const uint8_t* buf, size_t size);
};