Example #1
0
 def on_disconnect(self, item, device, service_id, *args):
     svc = device.Services[service_id]
     if service_id == "serial":
         try:
             appl = AppletService()
         except:
             dprint("** Failed to connect to applet")
         else:
             appl.RfcommDisconnect(device.GetObjectPath(), args[0])
             self.Generate()
     else:
         try:
             appl = AppletService()
         except:
             dprint("** Failed to connect to applet")
             return
         appl.ServiceProxy(svc.GetInterfaceName(), svc.GetObjectPath(),
                           "Disconnect", [])
Example #2
0
 def on_disconnect(self, item, device, service_id=None, *args):
     if service_id == "serial":
         try:
             appl = AppletService()
         except:
             dprint("** Failed to connect to applet")
         else:
             appl.RfcommDisconnect(device.get_object_path(), args[0])
             self.Generate()
     else:
         try:
             appl = AppletService()
         except:
             dprint("** Failed to connect to applet")
             return
         if service_id:
             connection_object = device.Services[service_id]
         else:
             connection_object = device
         appl.ServiceProxy(connection_object.get_interface_name(),
                           connection_object.get_object_path(),
                           "Disconnect", [])