#pragma once // ============================================================================== // C ABI bridge between the C++ protocol stack and the Swift app layer // ============================================================================== // This header is imported into Swift via -import-objc-header, so it must stay // pure C (no C++ types). The C++ modules implement these entry points. // ============================================================================== #include #include #ifdef __cplusplus extern "C" { #endif // Human-readable version string of the protocol stack. const char *xone_version(void); // TRUE if an Xbox Wireless Dongle is connected, FALSE otherwise. bool xone_dongle_present(void); // Opaque handle to an open dongle session (probe + firmware load). // Create with xone_open(); call the getters from the thread that opened // it, and before xone_close(). Only one session may be open at a time. typedef struct xone_dongle xone_dongle; // Open a dongle session: probe, USB reset, and (if firmware_path is not // NULL) load the firmware image from that file. Returns NULL if no dongle // is present or opening fails. xone_dongle *xone_open(const char *firmware_path); // Close the session and release the dongle. void xone_close(xone_dongle *d); // Product ID of the connected dongle (e.g. 0x02E6). uint16_t xone_pid(const xone_dongle *d); // Chip ID from EFUSE (e.g. 0x7612 for MT7612). 0 if unknown. uint16_t xone_chip_id(const xone_dongle *d); // MAC address from EFUSE as "xx:xx:xx:xx:xx:xx". Valid until xone_close(). const char *xone_mac_address(const xone_dongle *d); // Build string of the loaded firmware image (e.g. "201703281033____"). // Empty string if the firmware was not loaded. Valid until xone_close(). const char *xone_firmware_build(const xone_dongle *d); #ifdef __cplusplus } #endif