controlTransfer method

Future<int?> controlTransfer(
  1. int requestType,
  2. int request,
  3. int value,
  4. int index,
  5. Uint8List? buffer,
  6. int length,
  7. int timeout,
)

Optionally set transfer control. Since this plugin supports only sending data to device, only Device-To-Host [requestType] makes sense.

Implementation

Future<int?> controlTransfer(int requestType, int request, int value,
    int index, Uint8List? buffer, int length, int timeout) async {
  Map<String, dynamic> args = {
    "requestType": requestType,
    "request": request,
    "value": value,
    "index": index,
    "buffer": buffer,
    "length": length,
    "timeout": timeout = 0,
  };
  try {
    return await _methodChannel!.invokeMethod("controlTransfer", args);
  } on PlatformException catch (e) {
    throw _getTypedException(e);
  }
}