feat: expose dongle debug info through the C API
Add an opaque xone_dongle session handle to the C ABI bridge: xone_open() probes, resets, and loads the firmware (path optional), and xone_pid/xone_chip_id/xone_mac_address/xone_firmware_build return debug info for the open session. chip captures the firmware build string from the image header during load. The Swift app opens a session when the dongle appears and shows PID, chip ID, MAC address, and firmware build string in a debug section. Co-Authored-By: qwen3.8-27b@q2_k_xl: added C API session handle and debug UI
This commit is contained in:
+7
-3
@@ -212,9 +212,8 @@ auto chip::send_firmware(void const *fw_data, std::size_t fw_size) -> int
|
||||
if (fw_size != sizeof(fw_header) + ilm_len + dlm_len)
|
||||
return -EINVAL;
|
||||
|
||||
char build_time[17] = {};
|
||||
std::memcpy(build_time, header->build_time, sizeof(header->build_time));
|
||||
xone::log_msg(log_level::info, "mt76: firmware build %s", build_time);
|
||||
std::memcpy(build_time_, header->build_time, sizeof(header->build_time));
|
||||
xone::log_msg(log_level::info, "mt76: firmware build %s", build_time_);
|
||||
|
||||
// Configure the DMA, enable FCE and packet DMA.
|
||||
write_register(mt_usb_u3dma_cfg | mt_vend_type_cfg,
|
||||
@@ -249,6 +248,11 @@ auto chip::reset_firmware() -> int
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto chip::firmware_build() const -> char const *
|
||||
{
|
||||
return build_time_;
|
||||
}
|
||||
|
||||
auto chip::load_firmware(char const *path) -> int
|
||||
{
|
||||
// If firmware is already loaded, reset the MCU.
|
||||
|
||||
Reference in New Issue
Block a user