WPF

WPF C# Serial EOF Check

NicSub 2019. 6. 24. 20:38
728x90
반응형

String RF_text;
private void SetText(string text)
{
if (RF_ID.Dispatcher.CheckAccess())
{
RF_text = RF_text + text;
byte[] StrByte = Encoding.UTF8.GetBytes(text);
for (int i = 0; i < StrByte.Length; i++)
{
if (StrByte[i] == 0x03) //0x1A
{
RF_ID.Text = RF_text;
SendSerial(true);
RF_text = String.Empty;
break;
}
}
}
else
{
SetTextCallBack d = new SetTextCallBack(SetText);
RF_ID.Dispatcher.Invoke(d, new object[] { text });
}

    }
반응형