protected void Transmit(SerialPortManager sp, ProtocolBase protocol, SynchronizationContext syncContext) { var buffer = protocol.Pack(); syncContext.Post(delegate { logger.Log(string.Format("Tx: {0}", buffer.ToString()), Category.Debug, Priority.None); }, null); sp.Write(protocol.Pack()); }
public void SendMsg(ProtocolBase msg) { msg.Pack(this._packer); this._ws.SendAsync(this._packer.GetBuffer(), null); }