Esempio n. 1
0
 def RemoveDevice(self, device):
     '''
     This removes the remote device dbus object according to
     given Device instance. It will remove also the pairing information.
     '''
     raise_type_error(device, Device.Device)
     self.GetInterface().RemoveDevice(device.GetObjectPath())
Esempio n. 2
0
 def UnregisterAgent(self, agent):
     '''
     This unregisters the agent that has been previously
     registered.
     '''
     raise_type_error(agent, Agent.Agent)
     self.GetInterface().UnregisterAgent(agent.GetObjectPath())
Esempio n. 3
0
 def UnregisterAgent(self, agent):
     '''
     This unregisters the agent that has been previously
     registered.
     '''
     raise_type_error(agent, Agent.Agent)
     self.GetInterface().UnregisterAgent(agent.GetObjectPath())
Esempio n. 4
0
 def RemoveDevice(self, device):
     '''
     This removes the remote device dbus object according to
     given Device instance. It will remove also the pairing information.
     '''
     raise_type_error(device, Device.Device)
     self.GetInterface().RemoveDevice(device.GetObjectPath())
Esempio n. 5
0
 def HandleSignal(self, handler, signal, **kwargs):
     """
     The handler function will be called when specific signal is emmited.
     For available signals of each interface, check BlueZ4 documents.
     """
     # raise_type_error(handler, types.FunctionType)
     raise_type_error(signal, types.StringType)
     self.__bus.add_signal_receiver(handler, signal, self.__interface_name, "org.bluez", self.__obj_path, **kwargs)
Esempio n. 6
0
 def UnHandleSignal(self, handler, signal, **kwargs):
     '''
     The handler function will be called when specific signal is emmited.
     For available signals of each interface, check BlueZ4 documents.
     '''
    # raise_type_error(handler, types.FunctionType)
     raise_type_error(signal, types.StringType)
     self.__bus.remove_signal_receiver(handler,
                                    signal,
                                    self.__interface_name,
                                    'org.bluez',
                                    self.__obj_path, **kwargs)
Esempio n. 7
0
 def RegisterAgent(self, agent, capability=''):
     '''
     This registers the adapter wide agent.
     The agent should be an instance of Agent, the methods of Agent
     will be called when user input is needed.
     If an application disconnects from the dbus bus all
     of its registered agents will be removed.
     The capability parameter can have the values
     "DisplayOnly", "DisplayYesNo", "KeyboardOnly" and
     "NoInputNoOutput" which reflects the input and output
     capabilities of the agent. If an empty string is
     used it will fallback to "DisplayYesNo".
     '''
     raise_type_error(agent, Agent.Agent)
     self.GetInterface().RegisterAgent(agent.GetObjectPath(), capability)
Esempio n. 8
0
 def RegisterAgent(self, agent, capability=''):
     '''
     This registers the adapter wide agent.
     The agent should be an instance of Agent, the methods of Agent
     will be called when user input is needed.
     If an application disconnects from the dbus bus all
     of its registered agents will be removed.
     The capability parameter can have the values
     "DisplayOnly", "DisplayYesNo", "KeyboardOnly" and
     "NoInputNoOutput" which reflects the input and output
     capabilities of the agent. If an empty string is
     used it will fallback to "DisplayYesNo".
     '''
     raise_type_error(agent, Agent.Agent)
     self.GetInterface().RegisterAgent(agent.GetObjectPath(), capability)