Exemple #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()
Exemple #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)
Exemple #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)
Exemple #4
0
 def name(self):
     return uuid16_to_name(uuid128_to_uuid16(self.__uuid))
Exemple #5
0
 def format_uuids(uuids):
     return "\n".join([uuid + ' ' + uuid16_to_name(uuid128_to_uuid16(uuid)) for uuid in uuids])
Exemple #6
0
 def name(self):
     return uuid16_to_name(uuid128_to_uuid16(self.__uuid))
Exemple #7
0
 def format_uuids(uuids):
     return "\n".join([
         uuid + ' ' + uuid16_to_name(uuid128_to_uuid16(uuid))
         for uuid in uuids
     ])