示例#1
0
文件: MbState.cs 项目: Tiwalun/mabohe
        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;
        }
示例#2
0
文件: Mabohe.cs 项目: Tiwalun/mabohe
 public void updateState()
 {
     State = getState();
 }