Beispiel #1
0
        public byte ReceiveByte()
        {
            var res = _inner.ReceiveByte();

            Interlocked.Increment(ref _bytesReceived);
            return(res);
        }
Beispiel #2
0
 public byte SpiTransaction(byte a, byte b, byte c, byte d)
 {
     _channel.SendByte(a);
     _channel.SendByte(b);
     _channel.SendByte(c);
     _channel.SendByte(d);
     return(_channel.ReceiveByte());
 }
Beispiel #3
0
        public string GetSignOn()
        {
            WriteCommand(StkV1Command.GetSignOn);
            WriteCrcEop();

            AssertInSync();
            var res = new List <byte>();

            do
            {
                var ch = _port.ReceiveByte();
                if (ch == (int)StkV1Response.Ok)
                {
                    break;
                }
                res.Add(ch);
            } while (true);

            return(Encoding.ASCII.GetString(res.ToArray()));
        }