public override void OnEnable() { base.OnEnable(); serialHandler.OnReceived += OnReceived; EventSystem.Receive <SendMessageEvent>().Subscribe(evt => { serialHandler.Send(evt.Message); }).AddTo(this.Disposer); }
public override void Receive() { try { if (arduinoHandle.Send(SEND_PACKET)) { List <byte> receivePacket = new List <byte>(); if (arduinoHandle.Receive(receivePacket)) { LogHandler.WriteLog(base.division, string.Format("{0} :: Receive() Success", this.ToString())); } } else { LogHandler.PrintLog(string.Format("{0} :: Receive() Fail :: Send Fail", this.ToString())); } } catch (Exception ex) { LogHandler.WriteLog(base.division, string.Format("{0} :: Receive() Exception :: Message = {1}", this.ToString(), ex.Message)); } }