Progress with structure to send data

This commit is contained in:
fabjuuuh
2020-10-16 16:23:50 +02:00
parent e8a4901f09
commit 5751bbed81
6 changed files with 134 additions and 25 deletions

View File

@@ -123,13 +123,14 @@ namespace DoctorApp.Utils
break;
}
}
else if (DataParser.isRawData(messageBytes))
else if (DataParser.isRawDataBikeDoctor(messageBytes))
{
Console.WriteLine($"Received data: {BitConverter.ToString(payloadbytes)}");
MainViewModel.TransferDataToClientBike(payloadbytes);
}
else if (DataParser.isRawDataBPMDoctor(messageBytes))
{
MainViewModel.TransferDataToClientBPM(payloadbytes);
}
totalBufferReceived -= expectedMessageLength;
expectedMessageLength = BitConverter.ToInt32(totalBuffer, 0);
}
this.stream.BeginRead(this.buffer, 0, this.buffer.Length, new AsyncCallback(OnRead), null);