Beispiel #1
0
    def GetManagedObjects(self):
        response = {}
        print('GetManagedObjects')

        for service in self.services:
            print("adding service: {}".format(service.get_path()))
            response[service.get_path()] = service.get_properties()
            chrcs = service.get_characteristics()
            for chrc in chrcs:
                response[chrc.get_path()] = chrc.get_properties()
                descs = chrc.get_descriptors()
                for desc in descs:
                    response[desc.get_path()] = desc.get_properties()

        return response
    def GetManagedObjects(self):
        """
        Returns the Managed Objects contained by this Application instance.
        Returns
        -------
        dictionary
            A dictionary where the key is the object path, and the value is a dictionary of string/values.
        """

        response = {}
        print('GetManagedObjects')

        # The Application object has hierarchy as follows:
        # Application
        # --> Services[]
        # -----> Characteristics[]
        # ---------> Descriptors[]
        # 
        # Each of these are identified by an object path.
        # This method will iterate over each of these objects, starting with the services and traversing down
        # the hierarchy. It creates a Key/Value dictionary where the Key is the object path and the value
        # is a dictionary of Key/Values that represents the properties for that object.
        for service in self.services:
            response[service.get_path()] = service.get_properties()
            chrcs = service.get_characteristics()
            for chrc in chrcs:
                response[chrc.get_path()] = chrc.get_properties()
                descs = chrc.get_descriptors()
                for desc in descs:
                    response[desc.get_path()] = desc.get_properties()

        return response
Beispiel #3
0
 def GetManagedObjects(self):
     response = {}
     #print("was here ---"*10)
     for service in self.services:
         response[service.get_path()] = service.get_properties()
         chrcs = service.get_characteristics()
         for chrc in chrcs:
             response[chrc.get_path()] = chrc.get_properties()
     #print(response)
     return response
    def GetManagedObjects(self):
        response = {}
        for service in self.services:
            response[service.get_path()] = service.get_properties()
            chrcs = service.get_characteristics()
            for chrc in chrcs:
                response[chrc.get_path()] = chrc.get_properties()
                descs = chrc.get_descriptors()
                for desc in descs:
                    response[desc.get_path()] = desc.get_properties()

        return response
Beispiel #5
0
    def GetManagedObjects(self):
        response = {}
        print('GetManagedObjects')

        for service in self.services:
            response[service.get_path()] = service.get_properties()
            chrcs = service.get_characteristics()
            for chrc in chrcs:
                response[chrc.get_path()] = chrc.get_properties()
                descs = chrc.get_descriptors()
                for desc in descs:
                    response[desc.get_path()] = desc.get_properties()

        return response
Beispiel #6
0
    def GetManagedObjects(self):
        response = {}
        print('GetManagedObjects')
        logging.info('Bluez_lib: GetManagedObjects')

        for service in self.services:
            response[service.get_path()] = service.get_properties()
            chrcs = service.get_characteristics()
            for chrc in chrcs:
                response[chrc.get_path()] = chrc.get_properties()
                descs = chrc.get_descriptors()
                for desc in descs:
                    response[desc.get_path()] = desc.get_properties()

        return response
Beispiel #7
0
    def GetManagedObjects(self):
        logger = logging.getLogger("rotating.logger")
        logger.debug('[%s] Get Managed Objects',
                     time.strftime('%d/%m %H:%M:%S'))
        response = {}

        for service in self.services:
            response[service.get_path()] = service.get_properties()
            chrcs = service.get_characteristics()
            for chrc in chrcs:
                response[chrc.get_path()] = chrc.get_properties()
                descs = chrc.get_descriptors()
                for desc in descs:
                    response[desc.get_path()] = desc.get_properties()
        return response
Beispiel #8
0
    def GetManagedObjects(self):
        response = {}
        print('GetManagedObjects')

        for service in self.services:
            print('service')
            print(service)
            response[service.get_path()] = service.get_properties()
            print('got path')
            chrcs = service.get_characteristics()
            print('got chrcs')
            for chrc in chrcs:
                response[chrc.get_path()] = chrc.get_properties()
                #ignore descriptors
        print('response')
        print(response)
        return response
    def GetManagedObjects(self):
        """Get all objects that are managed by the application.

        Return type is a dictionary whose keys are each registered object and
        values the properties of the given object.
        """
        response = {}
        print('GetManagedObjects')

        for service in self.services:
            response[service.get_path()] = service.get_properties()
            chrcs = service.get_characteristics()
            for chrc in chrcs:
                response[chrc.get_path()] = chrc.get_properties()
                descs = chrc.get_descriptors()
                for desc in descs:
                    response[desc.get_path()] = desc.get_properties()

        return response
    def GetManagedObjects(self):
        """Get all objects that are managed by the application.

        Return type is a dictionary whose keys are each registered object and
        values the properties of the given object.
        """
        response = {}
        print('GetManagedObjects')

        for service in self.services:
            response[service.get_path()] = service.get_properties()
            chrcs = service.get_characteristics()
            for chrc in chrcs:
                response[chrc.get_path()] = chrc.get_properties()
                descs = chrc.get_descriptors()
                for desc in descs:
                    response[desc.get_path()] = desc.get_properties()

        return response
Beispiel #11
0
    def GetManagedObjects(self):
        response = {}
        print('GetManagedObjects')

        for service in self.services:
            response[service.get_path()] = service.get_properties()
            chrcs = service.get_characteristics()
            for chrc in chrcs:
                response[chrc.get_path()] = chrc.get_properties()
                #~ descs = chrc.get_descriptors()
                #~ for desc in descs:
                    #~ response[desc.get_path()] = desc.get_properties()

        return response
        
	def __del__(self):
		self.remove_from_connection()
		
	@dbus.service.signal(DBUS_PROP_IFACE, signature='sa{sv}as')
	def PropertiesChanged(self, interface, changed, invalidated):
		print('dajhdhjasdhjkadasdas')