getFingerprintVersion method

Future<int> getFingerprintVersion()
inherited

Retrieves the fingerprint algorithm version.

Throws ZKErrorResponse if the operation fails.

Implementation

Future<int> getFingerprintVersion() async {
  try {
    final commandString = Uint8List.fromList('~ZKFPVersion\x00'.codeUnits);
    final response = await sendCommand(
      CMD_OPTIONS_RRQ,
      commandString: commandString,
    );
    final dataString = decodeString(response.sublist(8));
    final parts = dataString.split('=');
    if (parts.length > 1) {
      return int.tryParse(parts[1].replaceAll('=', '')) ?? 0;
    }
    return 0;
  } catch (e) {
    throw ZKErrorResponse("Can't read fingerprint version");
  }
}