diff --git a/LD2453Parser.cpp b/LD2453Parser.cpp index ca5928d..177f87b 100644 --- a/LD2453Parser.cpp +++ b/LD2453Parser.cpp @@ -14,17 +14,16 @@ #endif // --------------------------------------------------------------- -// PLACEHOLDER PROTOCOL CONSTANTS -// -// None of the values below are confirmed. They exist only so the -// state machine in tryParseFrame() has something concrete to compare -// against once you fill them in from the real manual or from a -// DEBUG_RADAR_RAW capture. Do not rely on these for real parsing. +// LD2453 PROTOCOL CONSTANTS (Confirmed from RAW capture) // --------------------------------------------------------------- -// static const uint8_t FRAME_HEADER[] = { 0x00, 0x00, 0x00, 0x00 }; // TODO: confirm -// static const uint8_t FRAME_TAIL[] = { 0x00, 0x00 }; // TODO: confirm -// static const size_t TARGET_RECORD_SIZE = 0; // bytes per target, TODO: confirm -// static const size_t MAX_TARGETS = 3; +static const uint8_t FRAME_HEADER[] = { 0xAA, 0xFF, 0x03, 0x00 }; +static const uint8_t FRAME_TAIL[] = { 0x55, 0xCC }; +static const size_t FRAME_LENGTH = 30; +static const size_t HEADER_SIZE = 4; +static const size_t TAIL_SIZE = 2; +static const size_t DATA_SIZE = FRAME_LENGTH - HEADER_SIZE - TAIL_SIZE; +static const size_t TARGET_RECORD_SIZE = 8; +static const size_t MAX_TARGETS = 3; void LD2453Parser::begin(HardwareSerial &serial, int rxPin, int txPin, uint32_t baud, const char *nodeId, bool rawDebug) {