def notify(self, object_path, uuid): device = Device(object_path) logging.info("%s %s" % (device, uuid)) item = {} try: adapter = Adapter(device['Adapter']) except: logging.warning("adapter not found") return item["adapter"] = adapter["Address"] item["address"] = device['Address'] item["alias"] = device['Alias'] item["icon"] = device['Icon'] item["name"] = uuid16_to_name(uuid128_to_uuid16(uuid)) item["uuid"] = uuid item["time"] = time.time() item["device"] = object_path item["mitem"] = None #menu item object for i in RecentConns.items: if i["adapter"] == item["adapter"] and \ i["address"] == item["address"] and \ i["uuid"] == item["uuid"]: i["time"] = item["time"] i["device"] = item["device"] self.initialize() return RecentConns.items.append(item) self.initialize() self.store_state()
def on_rfcomm_connected(self, service, port): device = service.device uuid16 = uuid128_to_uuid16(service.uuid) if SERIAL_PORT_SVCLASS_ID == uuid16: Notification( _("Serial port connected"), _("Serial port service on device <b>%s</b> now will be available via <b>%s</b>" ) % (device.Alias, port), pixbuf=get_icon("blueman-serial", 48), status_icon=self.Applet.Plugins.StatusIcon) self.call_script(device.Address, device.Alias, uuid16_to_name(uuid16), uuid16, port)
def on_rfcomm_connected(self, service, port): device = service.device uuid16 = uuid128_to_uuid16(service.uuid) if SERIAL_PORT_SVCLASS_ID == uuid16: Notification(_("Serial port connected"), _("Serial port service on device <b>%s</b> now will be available via <b>%s</b>") % ( device.Alias, port), pixbuf=get_icon("blueman-serial", 48), status_icon=self.Applet.Plugins.StatusIcon) self.call_script(device.Address, device.Alias, uuid16_to_name(uuid16), uuid16, port)
def name(self): return uuid16_to_name(uuid128_to_uuid16(self.__uuid))
def format_uuids(uuids): return "\n".join([uuid + ' ' + uuid16_to_name(uuid128_to_uuid16(uuid)) for uuid in uuids])
def format_uuids(uuids): return "\n".join([ uuid + ' ' + uuid16_to_name(uuid128_to_uuid16(uuid)) for uuid in uuids ])