reconstruct: restore brave-tape3 packet types stage

This commit is contained in:
2026-08-28 14:30:44 +03:00
parent 96ffb91b97
commit e25feb6824
2 changed files with 103 additions and 21 deletions

View File

@ -4,25 +4,34 @@
class IR_Decoder;
namespace PacketTypes
{
/**
* Minimum complete frame size (header, addresses/data required by the type,
* and CRC). Unknown/reserved message types return 0.
*/
uint8_t minimumPacketSize(uint8_t msgType);
/** True only for a known typed packet whose complete frame is long enough. */
bool isTypedPacketSizeValid(uint8_t msgType, uint8_t packSize);
class BasePack
{
friend IR_Decoder;
protected:
bool isAvailable;
bool isRawAvailable;
bool isNeedAccept;
bool isAvailable = false;
bool isRawAvailable = false;
bool isNeedAccept = false;
uint8_t msgOffset;
uint8_t addressFromOffset;
uint8_t addressToOffset;
uint8_t DataOffset;
uint8_t msgOffset = 0;
uint8_t addressFromOffset = 0;
uint8_t addressToOffset = 0;
uint8_t DataOffset = 0;
IR_FOX::PackInfo *packInfo;
uint16_t id;
IR_FOX::PackInfo *packInfo = nullptr;
uint16_t id = 0;
virtual bool checkAddress();
void set(IR_FOX::PackInfo *packInfo, uint16_t id);
bool set(IR_FOX::PackInfo *packInfo, uint16_t id, bool requireTypedSize = true);
static uint16_t _getAddrFrom(BasePack *obj);
static uint16_t _getAddrTo(BasePack *obj);