<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _getFirmwareVersion(self, device):
 """ Get the firmware version. :Parameters: device : `int` The device is the integer number of the hardware devices ID and is only used with the Pololu Protocol. :Returns: An integer indicating the version number. """

        cmd = self._COMMAND.get('get-fw-version')
        self._writeData(cmd, device)

        try:
            result = self._serial.read(size=1)
            result = int(result)
        except serial.SerialException as e:
            self._log and self._log.error("Error: %s", e, exc_info=True)
            raise e
        except ValueError as e:
            result = None

        return result