/// <summary> /// Start the reading of a 32 byte part of the WS4000 memory starting /// at address offset /// </summary> /// <param name="offset"></param> public void getMemory(int offset, int length = 0x20) { if (Buffer != null) { throw new HIDDeviceException("Reading memory is in progress"); } Buffer = new WS4000Buffer(offset, length); RequestBuffer request = new RequestBuffer(this); request.Offset = offset; request.Send(); }
void handleInputReport(object sender, DataReceivedEventArgs args) { if (Buffer != null) { Buffer.add(args.data.Buffer); if (Buffer.Full) { WS4000Buffer buffer = Buffer; Buffer = null; OnBufferReceived(buffer); } else if (Buffer.Cursor % 0x20 == 0) { RequestBuffer request = new RequestBuffer(this); request.Offset = Buffer.Cursor; request.Send(); } } }