Commit b22b29d
committed
fix(mqtt): address code-review feedback on Mqtt5ConnectionPropertyConfig
- Replace `unwrap_or(0/false)` ladder with conditional assignment from
`Default::default()`. `None` no longer silently becomes `0`/`false` at
the C boundary; unset fields stay at the C struct's zero default,
which the ESP-IDF encoder skips so the broker applies the MQTT 5
protocol default. Avoids surprises on fields whose protocol default
differs from zero (e.g. Request Problem Information defaults to 1)
- Log an explanatory `error!` line before returning `ESP_ERR_INVALID_ARG`
when `mqtt5_connection_property` is set without `protocol_version =
Some(V5)`, so the misconfiguration is discoverable without grepping
ESP-IDF error codes
- Restore minimal per-field doc comments giving units and the MQTT 5
spec section, plus a struct-level note that fields may be added in
minor releases (callers should use `..Default::default()`)
- Enable `CONFIG_MQTT_PROTOCOL_5=y` in CI sdkconfig.defaults so the new
`#[cfg(esp_idf_mqtt_protocol_5)]` paths are compile-checked
- Add a CONNECT-properties usage snippet to the CHANGELOG entry1 parent 5217bd1 commit b22b29d
3 files changed
Lines changed: 56 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| 54 | + | |
52 | 55 | | |
| 56 | + | |
53 | 57 | | |
| 58 | + | |
54 | 59 | | |
| 60 | + | |
55 | 61 | | |
| 62 | + | |
56 | 63 | | |
| 64 | + | |
57 | 65 | | |
| 66 | + | |
58 | 67 | | |
| 68 | + | |
59 | 69 | | |
| 70 | + | |
60 | 71 | | |
61 | 72 | | |
62 | 73 | | |
| |||
540 | 551 | | |
541 | 552 | | |
542 | 553 | | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
543 | 557 | | |
544 | 558 | | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
557 | 587 | | |
558 | 588 | | |
559 | 589 | | |
| |||
0 commit comments