X13.Periphery.TWIDriver._dev_Pool C# (CSharp) Method

_dev_Pool() private method

private _dev_Pool ( ) : void
return void
    private void _dev_Pool() {
      try {
        if(_dev==null || _owner==null) {
          return;
        }
        if(_dev.state!=MsDevice.State.Connected && _dev.state!=MsDevice.State.AWake && _dev.state!=MsDevice.State.ASleep) {
          return;
        }
        byte[] buf;
        if(_pollIdx>=_drivers.Count) {
          _pollIdx=0;
        } else {
          if(!_drivers[_pollIdx].Poll(out buf)) {
            _pollIdx++;
          }
          if(buf!=null) {
            _dev.PublishWithPayload(_owner, buf);
          }
        }
      }
      catch(Exception ex) {
        Log.Warning("{0}.Poll -{1}", _owner!=null?_owner.path:"UNK", ex.Message);
      }
    }