1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-24 06:02:21 +01:00

Merge branch 'integration' into memory_api

This commit is contained in:
J. Nick Koston
2025-09-07 18:23:31 -05:00

View File

@@ -201,19 +201,20 @@ APIError APIPlaintextFrameHelper::read_packet(ReadPacketBuffer *buffer) {
// We must send at least 3 bytes to be read, so we add // We must send at least 3 bytes to be read, so we add
// a message after the indicator byte to ensures its long // a message after the indicator byte to ensures its long
// enough and can aid in debugging. // enough and can aid in debugging.
static constexpr uint8_t INDICATOR_MSG_SIZE = 19;
#ifdef USE_ESP8266 #ifdef USE_ESP8266
static const char msg_progmem[] PROGMEM = "\x00" static const char MSG_PROGMEM[] PROGMEM = "\x00"
"Bad indicator byte"; "Bad indicator byte";
char msg[19]; char msg[INDICATOR_MSG_SIZE];
memcpy_P(msg, msg_progmem, 19); memcpy_P(msg, MSG_PROGMEM, INDICATOR_MSG_SIZE);
iov[0].iov_base = (void *) msg; iov[0].iov_base = (void *) msg;
#else #else
static const char msg[] = "\x00" static const char MSG[] = "\x00"
"Bad indicator byte"; "Bad indicator byte";
iov[0].iov_base = (void *) msg; iov[0].iov_base = (void *) MSG;
#endif #endif
iov[0].iov_len = 19; iov[0].iov_len = INDICATOR_MSG_SIZE;
this->write_raw_(iov, 1, 19); this->write_raw_(iov, 1, INDICATOR_MSG_SIZE);
} }
return aerr; return aerr;
} }