<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _getConfig(self, num, device):
 """ Low level method used for all get config commands. :Parameters: num : `int` Number that indicates the config option to get from the hardware. device : `int` The device is the integer number of the hardware devices ID and is only used with the Pololu Protocol. :Returns: An integer representing the value stored in the hardware device. """

        cmd = self._COMMAND.get('get-config')
        self._writeData(cmd, device, params=(num,))

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

        return result