Пример #1
0
        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());
        }
Пример #2
0
 public void SendMsg(ProtocolBase msg)
 {
     msg.Pack(this._packer);
     this._ws.SendAsync(this._packer.GetBuffer(), null);
 }