From d48a2b3ec93b85dd06eb51b685f90cc2930ced4d Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Fri, 25 Oct 2019 18:17:10 -0500 Subject: [PATCH] Added blank serial string as const --- DS4Windows/HidLibrary/HidDevice.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/DS4Windows/HidLibrary/HidDevice.cs b/DS4Windows/HidLibrary/HidDevice.cs index 9352937..e65703c 100644 --- a/DS4Windows/HidLibrary/HidDevice.cs +++ b/DS4Windows/HidLibrary/HidDevice.cs @@ -25,6 +25,8 @@ namespace DS4Windows private readonly HidDeviceCapabilities _deviceCapabilities; private bool _monitorDeviceEvents; private string serial = null; + private const string BLANK_SERIAL = "00:00:00:00:00:00"; + internal HidDevice(string devicePath, string description = null) { _devicePath = devicePath; @@ -484,9 +486,10 @@ namespace DS4Windows byte[] buffer = new byte[16]; buffer[0] = 18; if (readFeatureData(buffer)) - serial = String.Format("{0:X02}:{1:X02}:{2:X02}:{3:X02}:{4:X02}:{5:X02}", buffer[6], buffer[5], buffer[4], buffer[3], buffer[2], buffer[1]); + serial = String.Format("{0:X02}:{1:X02}:{2:X02}:{3:X02}:{4:X02}:{5:X02}", + buffer[6], buffer[5], buffer[4], buffer[3], buffer[2], buffer[1]); else - serial = "00:00:00:00:00:00"; + serial = BLANK_SERIAL; return serial; } @@ -505,7 +508,7 @@ namespace DS4Windows serial = MACAddr; } else - serial = "00:00:00:00:00:00"; + serial = BLANK_SERIAL; return serial; }