Rename static property

This commit is contained in:
Travis Nickles 2017-03-22 02:41:04 -07:00
parent 5dbc193351
commit 7f1a7485a7

View File

@ -113,6 +113,8 @@ namespace DS4Windows
{ {
private const int BT_OUTPUT_REPORT_LENGTH = 78; private const int BT_OUTPUT_REPORT_LENGTH = 78;
private const int BT_INPUT_REPORT_LENGTH = 547; private const int BT_INPUT_REPORT_LENGTH = 547;
// Use large value for worst case scenario
private static int READ_STREAM_TIMEOUT = 100;
private HidDevice hDevice; private HidDevice hDevice;
private string Mac; private string Mac;
private DS4State cState = new DS4State(); private DS4State cState = new DS4State();
@ -135,8 +137,6 @@ namespace DS4Windows
public DateTime lastActive = DateTime.UtcNow; public DateTime lastActive = DateTime.UtcNow;
public DateTime firstActive = DateTime.UtcNow; public DateTime firstActive = DateTime.UtcNow;
private bool charging; private bool charging;
// Use large value for worst case scenario
private static int readStreamTimeout = 100;
public event EventHandler<EventArgs> Report = null; public event EventHandler<EventArgs> Report = null;
public event EventHandler<EventArgs> Removal = null; public event EventHandler<EventArgs> Removal = null;
@ -388,7 +388,7 @@ namespace DS4Windows
if (conType != ConnectionType.USB) if (conType != ConnectionType.USB)
{ {
//HidDevice.ReadStatus res = hDevice.ReadFile(btInputReport); //HidDevice.ReadStatus res = hDevice.ReadFile(btInputReport);
HidDevice.ReadStatus res = hDevice.ReadAsyncWithFileStream(btInputReport, readStreamTimeout); HidDevice.ReadStatus res = hDevice.ReadAsyncWithFileStream(btInputReport, READ_STREAM_TIMEOUT);
readTimeout.Enabled = false; readTimeout.Enabled = false;
if (res == HidDevice.ReadStatus.Success) if (res == HidDevice.ReadStatus.Success)
{ {
@ -409,7 +409,7 @@ namespace DS4Windows
else else
{ {
//HidDevice.ReadStatus res = hDevice.ReadFile(inputReport); //HidDevice.ReadStatus res = hDevice.ReadFile(inputReport);
HidDevice.ReadStatus res = hDevice.ReadAsyncWithFileStream(inputReport2, readStreamTimeout); HidDevice.ReadStatus res = hDevice.ReadAsyncWithFileStream(inputReport2, READ_STREAM_TIMEOUT);
readTimeout.Enabled = false; readTimeout.Enabled = false;
if (res != HidDevice.ReadStatus.Success) if (res != HidDevice.ReadStatus.Success)
{ {