Update comments for byte validation checks
This commit is contained in:
parent
c7212af657
commit
9c37e20a4b
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue