X13.Periphery.TWIDriver.Blinky.Poll C# (CSharp) Method

Poll() public method

public Poll ( byte &buf ) : bool
buf byte
return bool
      public override bool Poll(out byte[] buf) {
        buf=null;
        bool busy=false;
        var now=DateTime.Now;
        if(_waitError && _rt<now) {
          _present.value=true;
          _waitError=false;
        }
        if(_present.value || _rt<now) {
          if((_st & 2)!=0) {
            _st&=1;
            buf=new byte[] { _addr, 0x01, 0x02, 0x00, 0x66, (byte)(_fade.value) };
            busy=true;
            if(!_waitError) {
              _rt=now.AddMilliseconds(500);
              _waitError=true;
            }
          } else if((_st & 1)!=0) {
            _st&=2;
            buf=new byte[] { _addr, 0x01, 0x04, 0x00, 0x63, (byte)(_R.value), (byte)(_G.value), (byte)(_B.value) };
            busy=true;
            if(!_waitError) {
              _rt=now.AddMilliseconds(500);
              _waitError=true;
            }
          }
        }
        return busy;
      }
      public override void Reset() {