readAgentVersion method

Future<String> readAgentVersion()

Implementation

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

  final agentVersionBytes = await agentVersionCharacteristic.read();
  return utf8.decode(agentVersionBytes);
}