예제 #1
0
    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()
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
 def name(self):
     return uuid16_to_name(uuid128_to_uuid16(self.__uuid))
예제 #5
0
파일: Info.py 프로젝트: COLTONKERNS/blueman
 def format_uuids(uuids):
     return "\n".join([uuid + ' ' + uuid16_to_name(uuid128_to_uuid16(uuid)) for uuid in uuids])
예제 #6
0
 def name(self):
     return uuid16_to_name(uuid128_to_uuid16(self.__uuid))
예제 #7
0
파일: Info.py 프로젝트: srpatcha/blueman
 def format_uuids(uuids):
     return "\n".join([
         uuid + ' ' + uuid16_to_name(uuid128_to_uuid16(uuid))
         for uuid in uuids
     ])