Skip to content

Commit de165fc

Browse files
feat: replace noisy failure for missing bosch sensor on lab multi bus
1 parent 4695a30 commit de165fc

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

examples/core_usage/linux/mixed_bus_lab_validation/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Single pass, then exits:
1616
2. Sends a default `SET_REPLY` query to each expected CRUMBS device and prints reply data.
1717
3. Sends `R` command to EZO pH and DO sensors, waits, reads response frame, prints status + text payload.
1818
4. Optionally probes Bosch candidates (`0x76`, `0x77`) for chip ID register (`0xD0`) and prints one raw sample read (`0xF7`, 6 bytes) when present.
19+
Missing optional Bosch addresses are reported as `not present`.
1920

2021
Exit code is non-zero on validation failure.
2122

examples/core_usage/linux/mixed_bus_lab_validation/main.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,24 @@ static bool test_bosch_candidate(crumbs_context_t *ctx,
206206
dev.delay_fn = crumbs_linux_delay_us;
207207
dev.io = (void *)bus;
208208

209+
#if defined(__linux__)
210+
/* Optional probe: suppress expected low-level I/O errors for missing addrs. */
211+
lw_set_error_logging(&bus->bus, 0);
212+
#endif
209213
rc_chip = crumbs_i2c_dev_read_reg_u8(&dev,
210214
0xD0u,
211215
&chip_id,
212216
1u,
213217
BUS_TIMEOUT_US,
214218
1,
215219
crumbs_linux_write_then_read);
220+
#if defined(__linux__)
221+
lw_set_error_logging(&bus->bus, 1);
222+
#endif
216223

217224
if (rc_chip != CRUMBS_I2C_DEV_OK)
218225
{
219-
printf("Bosch addr=0x%02X chip_id read failed rc=%d\n", addr, rc_chip);
226+
printf("Bosch addr=0x%02X not present (chip_id rc=%d)\n", addr, rc_chip);
220227
return false;
221228
}
222229

0 commit comments

Comments
 (0)