Refactor bridge packet handling to use common magic number and size constants
This commit is contained in:
1 parent
af31eed48f
commit
690981b14e
6 files changed
+40
-37
No files matched your search
@@ -65,14 +65,7 @@ private:
|
||||
/**
|
||||
* Size constants for packet parsing
|
||||
*/
|
||||
static const size_t MAGIC_HEADER_SIZE = 2;
|
||||
static const size_t CHECKSUM_SIZE = 2;
|
||||
static const size_t MAX_PAYLOAD_SIZE = MAX_ESPNOW_PACKET_SIZE - (MAGIC_HEADER_SIZE + CHECKSUM_SIZE);
|
||||
|
||||
/**
|
||||
* Magic bytes to identify ESPNowBridge packets
|
||||
*/
|
||||
static const uint16_t ESPNOW_HEADER_MAGIC = 0xC03E;
|
||||
static const size_t MAX_PAYLOAD_SIZE = MAX_ESPNOW_PACKET_SIZE - (BRIDGE_MAGIC_SIZE + BRIDGE_CHECKSUM_SIZE);
|
||||
|
||||
/** Buffer for receiving ESP-NOW packets */
|
||||
uint8_t _rx_buffer[MAX_ESPNOW_PACKET_SIZE];
|
||||
|
||||
Reference in new issue
Block a user