Skip to content

Commit 618c50c

Browse files
committed
Handle incomplete serial data
1 parent b5149a3 commit 618c50c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ESP-SPO2/PluginHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ static void serialPort_DataReceived(object sender, SerialDataReceivedEventArgs e
102102
var valuePair = column.Split('=');
103103
if (valuePair.Length > 1)
104104
{
105-
var value = Convert.ToDouble(valuePair[1]);
105+
var value = 0.0;
106+
Double.TryParse(valuePair[1], out value);
106107
if (valuePair[0] == "IR")
107108
{
108109
if (clearIr)

0 commit comments

Comments
 (0)