예제 #1
0
        public Status(byte[] data, int offset = 0)
        {
            if ((data.Length - offset) < Size)
            {
                throw new ArgumentException("Invalid Status buffer size", "data");
            }

            this.Error           = (Dfu.Error)data[offset];
            pollTimeout24_state8 = (uint)((data[offset + 4] << 24) | (data[offset + 3] << 16) | (data[offset + 2] << 8) | (data[offset + 1]));
            iString = data[offset + 5];
        }
예제 #2
0
 public Status(State state, int pollTimeout, Error error = Dfu.Error.Ok, byte iString = 0)
 {
     pollTimeout24_state8 = ((uint)pollTimeout & 0xFFFFFF) | ((uint)state << 24);
     this.Error           = error;
     this.iString         = iString;
 }