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]; }
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; }