Update comments for byte validation checks

This commit is contained in:
ElVit 2025-11-25 22:53:36 +01:00 committed by GitHub
parent c7212af657
commit 9c37e20a4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -148,7 +148,7 @@ namespace esphome
{
this->payload_length_ = byte_;
}
// Discard message if format is wrong
// 3. byte shall be 0x01 or 0x10
if (this->response_message_.size() == 3 && byte_ != 0x01 && byte_ != 0x10)
{
this->response_receiving_ = false;
@ -157,6 +157,7 @@ namespace esphome
delay(10); // NOLINT
continue;
}
// 4. byte shall be 0x10 or 0x21
if (this->response_message_.size() == 4 && byte_ != 0x10 && byte_ != 0x21)
{
this->response_receiving_ = false;
@ -232,7 +233,7 @@ namespace esphome
{
this->payload_length_ = byte_;
}
// Discard message if format is wrong
// 3. byte shall be 0x01 or 0x10
if (this->request_message_.size() == 3 && byte_ != 0x01 && byte_ != 0x10)
{
this->request_receiving_ = false;
@ -241,6 +242,7 @@ namespace esphome
delay(10); // NOLINT
continue;
}
// 4. byte shall be 0x10 or 0x21
if (this->request_message_.size() == 4 && byte_ != 0x10 && byte_ != 0x21)
{
this->request_receiving_ = false;