getFirmwareVersion method

Future<String> getFirmwareVersion()

Retrieves the firmware version of the RFID reader.

This method sends a raw command to the RFID reader to request its firmware version, parsing the response into a human-readable string format.

Returns

A String representing the firmware version of the RFID reader.

Throws

  • Exceptions if the command fails to transmit or if the response format is unexpected.

Example

var firmwareVersion = await getFirmwareVersion();
print('RFID reader firmware version: $firmwareVersion');

Note: This method can be used to verify the reader's software version or for diagnostic purposes.

Implementation

Future<String> getFirmwareVersion() async {
  final result = await transmitRaw(
    Uint8List.fromList([
      ...ApduHeader(
        classNumber: 0xFF,
        instruction: 0x00,
        p1: 0x48,
        p2: 0x00,
      ).toList(),
      0x00,
    ]),
  );

  return String.fromCharCodes(result);
}