[store_yaml] Address review: drop esp32-ard test, force on data field

- Remove `test.esp32-ard.yaml`; the esp32 platform is IDF-only for new
  component tests.
- `(force) = true` on `GetYamlResponse.data` so the field is always
  emitted on the wire (matches the camera streaming pattern). `done`
  stays unforced — it's `false` on every chunk except the last, and
  default-value elision saves ~2 bytes per chunk for the firmware to
  TX.
- `total_size` and `encoding` stay first-chunk-only; the client caches
  them. Firmware bandwidth is expensive, client RAM is not.
This commit is contained in:
J. Nick Koston
2026-05-15 10:33:14 -07:00
parent 41081b7278
commit cd2c1014f3
3 changed files with 7 additions and 10 deletions

View File

@@ -2757,10 +2757,10 @@ message GetYamlResponse {
option (source) = SOURCE_SERVER;
option (ifdef) = "USE_STORE_YAML";
bytes data = 1;
bytes data = 1 [(force) = true];
bool done = 2;
// total compressed size, populated on the first chunk
// Sent on the first chunk only — the client is expected to cache it.
// (firmware bandwidth/flash is expensive; the client has gigabytes.)
uint32 total_size = 3;
// compression encoding, populated on the first chunk ("zstd")
string encoding = 4 [(max_data_length) = 8];
}

View File

@@ -4164,7 +4164,9 @@ uint32_t BluetoothSetConnectionParamsResponse::calculate_size() const {
#ifdef USE_STORE_YAML
uint8_t *GetYamlResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PARAM) const {
uint8_t *__restrict__ pos = buffer.get_pos();
ProtoEncode::encode_bytes(pos PROTO_ENCODE_DEBUG_ARG, 1, this->data_ptr_, this->data_len_);
ProtoEncode::write_raw_byte(pos PROTO_ENCODE_DEBUG_ARG, 10);
ProtoEncode::encode_varint_raw(pos PROTO_ENCODE_DEBUG_ARG, this->data_len_);
ProtoEncode::encode_raw(pos PROTO_ENCODE_DEBUG_ARG, this->data_ptr_, this->data_len_);
ProtoEncode::encode_bool(pos PROTO_ENCODE_DEBUG_ARG, 2, this->done);
ProtoEncode::encode_uint32(pos PROTO_ENCODE_DEBUG_ARG, 3, this->total_size);
ProtoEncode::encode_string(pos PROTO_ENCODE_DEBUG_ARG, 4, this->encoding);
@@ -4172,7 +4174,7 @@ uint8_t *GetYamlResponse::encode(ProtoWriteBuffer &buffer PROTO_ENCODE_DEBUG_PAR
}
uint32_t GetYamlResponse::calculate_size() const {
uint32_t size = 0;
size += ProtoSize::calc_length(1, this->data_len_);
size += ProtoSize::calc_length_force(1, this->data_len_);
size += ProtoSize::calc_bool(1, this->done);
size += ProtoSize::calc_uint32(1, this->total_size);
size += !this->encoding.empty() ? 2 + this->encoding.size() : 0;

View File

@@ -1,5 +0,0 @@
wifi:
ssid: MySSID
password: password1
<<: !include common.yaml