Lines Matching refs:self
63 def __init__(self, bus, path): argument
64 self.path = path
65 self.services = []
67 self.add_service(srv_obj)
68 dbus.service.Object.__init__(self, bus, self.path)
70 def __del__(self): argument
73 def get_path(self): argument
74 return dbus.ObjectPath(self.path)
76 def add_service(self, service): argument
77 self.services.append(service)
80 def GetManagedObjects(self): argument
84 for service in self.services:
96 def Release(self): argument
106 def __init__(self, bus, index, uuid, primary=False): argument
107 self.path = self.PATH_BASE + str(index)
108 self.bus = bus
109 self.uuid = uuid
110 self.primary = primary
111 self.characteristics = []
112 dbus.service.Object.__init__(self, bus, self.path)
114 def get_properties(self): argument
117 'UUID': self.uuid,
118 'Primary': self.primary,
120 self.get_characteristic_paths(),
125 def get_path(self): argument
126 return dbus.ObjectPath(self.path)
128 def add_characteristic(self, characteristic): argument
129 self.characteristics.append(characteristic)
131 def get_characteristic_paths(self): argument
133 for chrc in self.characteristics:
137 def get_characteristics(self): argument
138 return self.characteristics
143 def GetAll(self, interface): argument
146 return self.get_properties()[GATT_SERVICE_IFACE]
153 def __init__(self, bus, index, uuid, flags, service): argument
154 self.path = service.path + '/char' + str(index)
155 self.bus = bus
156 self.uuid = uuid
157 self.service = service
158 self.flags = flags
159 self.value = [0]
160 self.descriptors = []
161 dbus.service.Object.__init__(self, bus, self.path)
163 def get_properties(self): argument
166 'Service': self.service.get_path(),
167 'UUID': self.uuid,
168 'Flags': self.flags,
169 'Value': self.value,
170 'Descriptors': dbus.Array(self.get_descriptor_paths(), signature='o')
175 def get_path(self): argument
176 return dbus.ObjectPath(self.path)
178 def add_descriptor(self, descriptor): argument
179 self.descriptors.append(descriptor)
181 def get_descriptor_paths(self): argument
183 for desc in self.descriptors:
187 def get_descriptors(self): argument
188 return self.descriptors
191 def GetAll(self, interface): argument
195 return self.get_properties()[GATT_CHRC_IFACE]
198 def ReadValue(self, options): argument
203 def WriteValue(self, value, options): argument
208 def StartNotify(self): argument
213 def StopNotify(self): argument
219 def PropertiesChanged(self, interface, changed, invalidated): argument
227 def __init__(self, bus, index, uuid, flags, characteristic): argument
228 self.path = characteristic.path + '/desc' + str(index)
229 self.bus = bus
230 self.uuid = uuid
231 self.flags = flags
232 self.chrc = characteristic
233 dbus.service.Object.__init__(self, bus, self.path)
235 def get_properties(self): argument
238 'Characteristic': self.chrc.get_path(),
239 'UUID': self.uuid,
240 'Flags': self.flags,
244 def get_path(self): argument
245 return dbus.ObjectPath(self.path)
250 def GetAll(self, interface): argument
254 return self.get_properties()[GATT_DESC_IFACE]
257 def ReadValue(self, options): argument
262 def WriteValue(self, value, options): argument
270 def __init__(self, bus, index): argument
272 Service.__init__(self, bus, index, self.TEST_SVC_UUID, primary=True)
273 self.add_characteristic(SupportedNewAlertCategoryCharacteristic(bus, '0001', self))
274 self.add_characteristic(AlertNotificationControlPointCharacteristic(bus, '0002', self))
275 alert_status_char_obj = UnreadAlertStatusCharacteristic(bus, '0003', self)
276 self.add_characteristic(alert_status_char_obj)
282 def __init__(self, bus, index, service): argument
284 self, bus, index,
285 self.SUPPORT_NEW_ALERT_UUID,
289 self.value = [dbus.Byte(2)]
291 def ReadValue(self, options): argument
295 for val in self.value:
305 def __init__(self, bus, index, service): argument
307 self, bus, index,
308 self.ALERT_NOTIF_UUID,
312 self.value = [dbus.Byte(0)]
314 def ReadValue(self, options): argument
316 for val in self.value:
322 def WriteValue(self, value, options): argument
326 print('\tCurrent value:', '\t', self.value)
330 self.value = val_list
332 print('\tNew value:', '\t', self.value)
333 if not self.value == value:
334 print('Failed: Write Request\n\tNew value not written\tCurrent value:', self.value)
340 def __init__(self, bus, index, service): argument
342 self, bus, index,
343 self.UNREAD_ALERT_STATUS_UUID,
346 self.value = [dbus.Byte(0)]
347 self.cccd_obj = ClientCharacteristicConfigurationDescriptor(bus, '0001', self)
348 self.add_descriptor(self.cccd_obj)
349 self.notifying = False
351 def StartNotify(self): argument
355 if self.notifying:
358 self.notifying = True
360 self.cccd_obj.WriteValue([dbus.Byte(1), dbus.Byte(0)])
361 self.cccd_obj.ReadValue()
363 def StopNotify(self): argument
364 if not self.notifying:
367 self.notifying = False
370 def ReadValue(self, options): argument
373 for val in self.value:
378 def WriteValue(self, value, options): argument
383 self.value = val_list
385 print('\tNew value:', '\t', self.value)
386 if not self.value == value:
387 print('Failed: Write Request\n\tNew value not written\tCurrent value:', self.value)
393 def __init__(self, bus, index, characteristic): argument
394 self.value = [dbus.Byte(0)]
396 self, bus, index,
397 self.CCCD_UUID,
401 def ReadValue(self): argument
402 print('\tValue on read:', '\t', self.value)
403 return self.value
405 def WriteValue(self, value): argument
409 self.value = val_list
411 print('New value on write:', '\t', self.value)
412 if not self.value == value:
413 print('Failed: Write Request\n\tNew value not written\tCurrent value:', self.value)