Ejemplo n.º 1
0
 def __init__(self, bus, index, service):
     Characteristic.__init__(self, bus, index, self.UUID,
                             ['read', 'notify'], service)
     self.notifying = False
     self.battery_lvl = 100
     self.led = LED(15)
     GObject.timeout_add(5000, self.drain_battery)
Ejemplo n.º 2
0
 def __init__(self, bus, index, service):
     Characteristic.__init__(self, bus, index, self.TEST_CHRC_UUID,
                             ['secure-read', 'secure-write'], service)
     self.value = []
     self.add_descriptor(TestSecureDescriptor(bus, 2, self))
     self.add_descriptor(
         CharacteristicUserDescriptionDescriptor(bus, 3, self))
Ejemplo n.º 3
0
    def __init__(self, bus, index, service):
        Characteristic.__init__(self, bus, index, self.CHARACTERISTIC_UUID,
                                ['write'], service)

        # Instance variables:
        self.led = LED(18)
        self.button = Button(2)
        self.value = None
        self.timeout = 0
        self.button.when_pressed = self.simulate
Ejemplo n.º 4
0
    def __init__(self, bus, index, service):
        Characteristic.__init__(self, bus, index, self.CHARACTERISTIC_UUID,
                                ['read', 'notify'], service)

        # Instance variables:
        self.notifying = False
        self.value = True
        self.led = LED(15)

        # Force initial update
        self.update_status()
Ejemplo n.º 5
0
 def __init__(self, bus, index, service):
     Characteristic.__init__(
         self, bus, index, self.TEST_CHRC_UUID,
         ['read', 'write', 'writable-auxiliaries', 'notify'], service)
     self.notifying = False
     self.button = Button(4)
     self.led = LED(14)
     self.value = self.button.is_pressed
     self.add_descriptor(TestDescriptor(bus, 0, self))
     self.add_descriptor(
         CharacteristicUserDescriptionDescriptor(bus, 1, self))
     GObject.timeout_add(1000, self.update_status)
Ejemplo n.º 6
0
    def __init__(self, bus, index, service):
        Characteristic.__init__(self, bus, index, self.CHARACTERISTIC_UUID,
                                ['read', 'notify'], service)

        # Instance variables:
        self.notifying = False
        self.button = Button(4)
        self.led = LED(14)
        self.value = self.button.is_pressed

        # Add descriptors:
        self.button.when_pressed = self.update_status
        self.button.when_released = self.update_status

        # Force initial update
        self.update_status()
Ejemplo n.º 7
0
 def __init__(self, service):
     Characteristic.__init__(self, TIME_CHRC_UUID, ["read"], service)
     self.add_descriptor(TimeDescriptor(self))
Ejemplo n.º 8
0
 def __init__(self, bus, index, service):
     Characteristic.__init__(self, bus, index, self.HR_CTRL_PT_UUID,
                             ['write'], service)
Ejemplo n.º 9
0
 def __init__(self, bus, index, service):
     Characteristic.__init__(self, bus, index, self.BODY_SNSR_LOC_UUID,
                             ['read'], service)
Ejemplo n.º 10
0
 def __init__(self, bus, index, service):
     Characteristic.__init__(self, bus, index, self.HR_MSRMT_UUID,
                             ['notify'], service)
     self.notifying = False
     self.hr_ee_count = 0
Ejemplo n.º 11
0
 def __init__(self, bus, index, service):
     Characteristic.__init__(
         self, bus, index,
         self.UUID,['read'],
         service)