Compare commits
2
Commits
1.0.0
..
ac41113853
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac41113853 | ||
|
|
5db254e0f1 |
@@ -75,13 +75,20 @@ namespace SoraV2Utils_Agent
|
||||
}
|
||||
|
||||
public void Exit()
|
||||
{
|
||||
// Stop the Service
|
||||
try
|
||||
{
|
||||
var client = new Client("SoraV2UtilsDeviceData");
|
||||
var service = client.GetServiceProxy<IMouseData>();
|
||||
service.Exit();
|
||||
}
|
||||
catch (TimeoutException)
|
||||
{
|
||||
}
|
||||
|
||||
// Exit the application gracefully
|
||||
Environment.Exit(0);
|
||||
// Exit the application
|
||||
System.Environment.Exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,13 @@ namespace SoraV2Tools
|
||||
{
|
||||
private const ushort VID = 0x1915;
|
||||
private const ushort PID_WIRELESS = 0xAE1C;
|
||||
private const ushort PID_WIRED = 0xAE11;
|
||||
private const ushort PID_WIRED = 0xAE12;
|
||||
|
||||
public static List<HidDevice> GetDevice()
|
||||
{
|
||||
var devices = HidDevices.Enumerate(VID, PID_WIRELESS).ToList();
|
||||
List<HidDevice> devices = HidDevices.Enumerate(VID, PID_WIRELESS)
|
||||
.Concat(HidDevices.Enumerate(VID, PID_WIRED))
|
||||
.ToList();
|
||||
|
||||
return devices;
|
||||
}
|
||||
@@ -72,8 +74,12 @@ namespace SoraV2Tools
|
||||
byte fullCharge = responseData[11];
|
||||
byte online = responseData[12];
|
||||
|
||||
if ((device.Attributes.ProductId == PID_WIRELESS && online == 1) ||
|
||||
(device.Attributes.ProductId == PID_WIRED && charging == 1))
|
||||
{
|
||||
return new DeviceStatus(battery, charging, fullCharge, online);
|
||||
}
|
||||
}
|
||||
return new DeviceStatus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user