<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_battery_level(self):
 """Reads the battery level descriptor on the device. Returns: int. If successful this will be a positive value representing the current battery level as a percentage. On error, -1 is returned. """


        battery_level = self.get_characteristic_handle_from_uuid(UUID_BATTERY_LEVEL)
        if battery_level is None:
            logger.warn('Failed to find handle for battery level')
            return None

        level = self.dongle._read_attribute(self.conn_handle, battery_level)
        if level is None:
            return -1
        return ord(level)