Created
June 25, 2020 10:20
-
-
Save OberdanBrito/4633f22a23560982c4729568481e065e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void SerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e) | |
{ | |
Console.WriteLine($"Serial recebido"); | |
string RxString = _serialPort.ReadExisting(); | |
string SerialID; | |
if (RxString.IndexOf("\r\n") > -1 || RxString.IndexOf("|") > -1) | |
{ | |
SerialID = RxString.Replace("\r\n", "").Replace("|", ""); | |
Console.WriteLine($"Serial: {SerialID}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment