public static Task <TransferResult> GetStatusAsync(this IUsbDevice usbDevice) => usbDevice.PerformControlTransferAsync(new SetupPacket ( requestType: new UsbDeviceRequestType( RequestDirection.In, RequestType.Class, RequestRecipient.Interface), request: DFU_GETSTATUS, length: GetStatusPacketLength ));
public static Task ClearStatusAsync(this IUsbDevice usbDevice) => usbDevice.PerformControlTransferAsync(new SetupPacket ( requestType: new UsbDeviceRequestType( RequestDirection.In, RequestType.Class, RequestRecipient.Interface), request: DFU_CLEARSTATUS, length: 0 ));
public static Task <TransferResult> SendDownloadRequestAsync(this IUsbDevice usbDevice) // buffer: set address pointer command (0x21), address pointer (0x08000000) => usbDevice.PerformControlTransferAsync(new SetupPacket ( requestType: new UsbDeviceRequestType( RequestDirection.Out, RequestType.Class, RequestRecipient.Interface), request: DFU_DNLOAD, length: (ushort)DownloadRequestBuffer.Length ), DownloadRequestBuffer);