private void btnReadAccTab_Click(object sender, EventArgs e) { if (_serialPort == null) { Log("Serial port is not connected.", Color.Red); return; } try { ReadAccTab command = new ReadAccTab(); if (!InitCommand(command)) { return; } command.Send(_serialPort); if (!command.Receive(_serialPort)) { return; } Log(command.ToString(), Color.Black); } catch (Exception ex) { Log(ex.Message, Color.Red); Log(ex.StackTrace, Color.Red); } }
private void btnReadAccTab_Click(object sender, EventArgs e) { if (_serialPort == null) { Log("Serial port is not connected.", Color.Red); return; } try { ReadAccTab command = new ReadAccTab(); if (!InitCommand(command)) return; command.Send(_serialPort); if (!command.Receive(_serialPort)) return; Log(command.ToString(), Color.Black); } catch (Exception ex) { Log(ex.Message, Color.Red); Log(ex.StackTrace, Color.Red); } }