openL2capStream method

Stream<Uint8List> openL2capStream(
  1. String deviceId,
  2. int psm
)

Opens a raw binary socket directly to a BLE device over L2CAP. Returns a stream of Uint8List bytes.

Implementation

Stream<Uint8List> openL2capStream(String deviceId, int psm) {
  if (deviceId.trim().isEmpty) {
    throw ArgumentError.value(
      deviceId,
      'deviceId',
      'Device ID cannot be empty.',
    );
  }
  if (psm <= 0) {
    throw ArgumentError.value(psm, 'psm', 'PSM must be greater than zero.');
  }
  return NexoraSdkPlatform.instance.openL2capStream(deviceId, psm);
}