simulateDescriptorOperationResponse method

Future<void> simulateDescriptorOperationResponse(
  1. String descriptorId,
  2. DescriptorOperationType type,
  3. int code, {
  4. String? data,
})

Simulates the response from the descriptor with |descriptorId| for a descriptor operation of |type|. The |code| value follows the Error Codes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response. The |data| is expected to exist when simulating a successful read operation response.

Implementation

Future<void> simulateDescriptorOperationResponse(
  String descriptorId,
  DescriptorOperationType type,
  int code, {
  String? data,
}) async {
  await _client.send(
    'BluetoothEmulation.simulateDescriptorOperationResponse',
    {'descriptorId': descriptorId, 'type': type, 'code': code, 'data': ?data},
  );
}