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