feat: async C API and Swift radio state display
Split the dongle session into a fast probe (xone_open) and a background start (xone_start) that loads the firmware and initializes the radio on a worker thread, so the app UI never blocks. Add xone_state/xone_error for progress display, and select the firmware image per product ID when no path is given. The Swift app polls the state each second and shows idle/starting/ready/error plus the firmware build or error string. The session destructor joins the worker so quitting the app does not terminate on a joinable thread. Note in the CLI and transport that the recover/re-enumerate path should not be used yet: a crashed SIE drops off the bus, while the MCU watchdog recovers it after ~90s of quiet. Co-Authored-By: qwen3.8-27b@q2_k_xl: async C API, Swift state display, and exit-time worker join
This commit is contained in:
@@ -170,6 +170,9 @@ void transport::stop_pump()
|
||||
|
||||
auto transport::re_enumerate() -> int
|
||||
{
|
||||
// Do not use yet: a crashed SIE cannot finish the host-side port reset
|
||||
// handshake and drops off the bus. A crashed chip recovers on its own via
|
||||
// the MCU watchdog after ~90s of a quiet bus, so prefer waiting.
|
||||
// Stop the pump first so no completion callback touches the interface
|
||||
// references while the kernel tears them down.
|
||||
stop_pump();
|
||||
|
||||
Reference in New Issue
Block a user