From 5b9cb1da8bf6089a2d7d761778f5789baa883568 Mon Sep 17 00:00:00 2001 From: Allen Hill Date: Sun, 20 Sep 2026 15:01:28 -0700 Subject: [PATCH] Add single byte send debug function --- src/avclan/bus.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/avclan/bus.cc b/src/avclan/bus.cc index 0d256a5..7232dd4 100644 --- a/src/avclan/bus.cc +++ b/src/avclan/bus.cc @@ -350,6 +350,15 @@ Bus::Handle Bus::get() { return Handle{*this}; }; void Bus::set_dominant() { phy_set_dominant(); } void Bus::set_recessive() { phy_set_recessive(); } +Send Bus::sendbyte(uint8_t byte, bool ack) { + auto handle = get(); + uint8_t data_i = 0; + if (const Send serr = handle.send_data(&byte, 1, ack, &data_i); + serr != Send{0}) + return serr; + return phy_send_done(&data_i); +} + #ifdef MEASURE_BUS // Debug bit-timing measurement on the one physical bus; instance-scoped for // the same reason as is_active().