private void OnSerialPortDataReceived(Event e) { SerialPortEvent serialEvent = (SerialPortEvent)e; TestSerialPortPacket packet = (TestSerialPortPacket)serialEvent.SerialPortPacket; UnityEngine.Debug.Log("Serial port received data: " + packet.Text); serialPort.Send("MonoSerialPort.Send"); }
protected virtual void OnDataRecieved(EventArgs e, string myGPSData, bool myThreadEnd) { SendSerialPortArgs args = new SendSerialPortArgs() { gpsData = myGPSData, ThreadEnd = myThreadEnd }; SerialPortEvent.Invoke(null, args); }
protected virtual void OnPortsRecieved(EventArgs e, string[] myPortList) // [2] Recieves the new date and time { SendSerialPortArgs args = new SendSerialPortArgs() { portList = myPortList }; //[3] Sets the data out as outlined in 4 SerialPortEvent.Invoke(null, args); // [5] Pass the data to the event }
public void OnSerialPortEvent(SerialPortEventArgs args) { SerialPortEvent?.Invoke(args); }
private void OnSerialPortExceptionCaught(Event e) { SerialPortEvent serialEvent = (SerialPortEvent)e; UnityEngine.Debug.LogException(serialEvent.Exception); }