X13.Periphery.TWIDriver.BMP180.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==-2) {
            buf=new byte[] { ADDR, 0x03, 0x01, 0x16, 0xAA };
            _pt=DateTime.Now.AddMilliseconds(500);
            _st=-1;
            busy=true;
          } else if(_st==0) {
            buf=new byte[] { ADDR, 0x01, 0x02, 0x00, 0xF4, 0x2E };
            _pt=DateTime.Now.AddMilliseconds(15);
            _st=1;
            busy=true;
          } else if(_st==1) {
            buf=new byte[] { ADDR, 0x03, 0x01, 0x02, 0xF6 };
            _pt=DateTime.Now.AddMilliseconds(1);
            _st=2;
            busy=true;
          } else if(_st==2 || _st==3) {
            buf=new byte[] { ADDR, 0x01, 0x02, 0x00, 0xF4, (byte)(0x34 | (BMP180_OSS<<6)) };
            _pt=DateTime.Now.AddMilliseconds(500);  // Wait ack 
            _st++;
            busy=true;
          } else if(_st==4) {
            buf=new byte[] { ADDR, 0x03, 0x01, 0x03, 0xF6 };
            _pt=DateTime.Now.AddMilliseconds(500);
            _st=5;
            busy=true;
          } else {
            busy=true;
          }
        } else {
          busy=_st!=0;
        }
        return busy;
      }
      public override void Reset() {