public void LinkOnDataReceived(object sender, EventArgs e) { byte[] dataBytes = _asyncUdpLink.GetMessage(); string messageFromController = Encoding.ASCII.GetString(dataBytes); // new byte array and feed it the input string _log.Info("Message from Remote {messageFromController}", messageFromController); IncomingMessage = messageFromController; WriteUDPDataToDataBase(string.Empty, false); IncomingMessage = string.Empty; // clear the prop UDPDataReceived?.Invoke(this, e); }
protected virtual void OnUDPDataReceived(UDPDataEventArgs e) { UDPDataReceived?.Invoke(this, e); }