using System.Runtime.InteropServices; namespace XFESystem.NativeRuntime.Application; internal static class NativeUsbDiagnostics { [DllImport("xfe_pal", EntryPoint = "xfe_usb_info", CallingConvention = CallingConvention.Cdecl)] private static extern ulong Info(uint field); internal static ulong KeyboardMouse => Info(5); internal static string ReadReport() => "XFESystem native USB diagnostics\nScope: XFESystemGuest\n" + "Backend: independent C# xHCI / USB HID\nState: " + Info(1) + " (1 initializing, 2 polling)\n" + "Controllers: " + Info(2) + "; devices: " + Info(3) + "; interrupt endpoints: " + Info(4) + "\n" + "Keyboard: " + ((Info(5) & 1) != 0) + "; mouse: " + ((Info(5) & 2) != 0) + "\n" + "Hardware reports: " + Info(6) + "; failures: " + Info(7) + "\n" + "USB storage is not mounted or written. RGB lighting uses device firmware defaults.\n"; }