X13.Periphery.TWIDriver.CC2D.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;
        if(_pt<DateTime.Now) {
          if(_st==0) {
            buf=new byte[] { ADDR, 0x01, 0x00, 0x00 }; // Write 0 bytes
            _pt=DateTime.Now.AddMilliseconds(15);
            _st=1;
            busy=true;
          } else if(_st==1) {
            buf=new byte[] { ADDR, 0x02, 0x00, 0x04 }; // Read 4 bytes
            _pt=DateTime.Now.AddMilliseconds(500);
            _st=3;
            busy=true;
          } else {
            busy=true;
          }
        } else {
          busy=_st>0;
        }
        return busy;
      }
      public override void Reset() {