readFragmentId method

Future<String> readFragmentId()

Implementation

Future<String> readFragmentId() async {
  final bleService = await getBleService();
  final fragmentIdCharacteristic = bleService.characteristics.firstWhere(
    (char) => char.uuid.str == ViamBluetoothUUIDs.fragmentUUID,
    orElse: () => throw Exception('fragmentIdCharacteristic not found'),
  );

  final fragmentIdBytes = await fragmentIdCharacteristic.read();
  return utf8.decode(fragmentIdBytes);
}