diff --git a/OBD.NET/OBD.NET.Common/Devices/ELM327.cs b/OBD.NET/OBD.NET.Common/Devices/ELM327.cs
index 85594ad..372d5ca 100644
--- a/OBD.NET/OBD.NET.Common/Devices/ELM327.cs
+++ b/OBD.NET/OBD.NET.Common/Devices/ELM327.cs
@@ -1,5 +1,7 @@
using System;
using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
using System.Threading.Tasks;
using OBD.NET.Common.Commands;
using OBD.NET.Common.Communication;
@@ -80,6 +82,7 @@ namespace OBD.NET.Common.Devices
Logger?.WriteLine("Setting the Protocol to 'Auto' ...", OBDLogLevel.Debug);
SendCommand(ATCommand.SetProtocolAuto);
+ WaitQueue();
}
// DarthAffe 21.02.2017: This seems to happen sometimes, i don't know why - just retry.
catch
@@ -108,7 +111,11 @@ namespace OBD.NET.Common.Devices
RequestData(pid);
}
- protected virtual void RequestData(byte pid)
+ ///
+ /// Request data based on a pid
+ ///
+ /// The pid of the requested data
+ public virtual void RequestData(byte pid)
{
Logger?.WriteLine("Requesting PID " + pid.ToString("X2") + " ...", OBDLogLevel.Debug);
SendCommand(((byte)Mode).ToString("X2") + pid.ToString("X2"));
@@ -124,11 +131,20 @@ namespace OBD.NET.Common.Devices
{
Logger?.WriteLine("Requesting Type " + typeof(T).Name + " ...", OBDLogLevel.Debug);
byte pid = ResolvePid();
+ return await RequestDataAsync(pid) as T;
+ }
+
+ ///
+ /// Request data based on a pid
+ ///
+ /// The pid of the requested data
+ public virtual async Task