public static MbState parse(byte[] response) { if (response == null) throw new ArgumentNullException("response"); if (response.Length != 1) throw new ArgumentOutOfRangeException("Response length is not 1"); BitArray tmpResponse = new BitArray(response); MbState mb = new MbState(); mb.powerOn = tmpResponse[7]; mb.powerOk = tmpResponse[6]; mb.heatingOn = tmpResponse[5]; mb.fail = tmpResponse[4]; mb.errorCode = response[0] & 0x0f; return mb; }
public void updateState() { State = getState(); }