call method

Future<Map<String, Object?>> call(
  1. Map<String, Object?> request, {
  2. Duration timeout = const Duration(seconds: 20),
})

Sends request and returns the helper's reply; calls run one at a time and throw DeviceHidError on failure.

Implementation

Future<Map<String, Object?>> call(Map<String, Object?> request, {Duration timeout = const Duration(seconds: 20)}) {
  final result = _queue.then((_) => _send(request, timeout));
  _queue = result.then((_) {}, onError: (_) {});
  return result;
}