本文整理汇总了Python中device.Device.get_services方法的典型用法代码示例。如果您正苦于以下问题:Python Device.get_services方法的具体用法?Python Device.get_services怎么用?Python Device.get_services使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类device.Device
的用法示例。
在下文中一共展示了Device.get_services方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_property
# 需要导入模块: from device import Device [as 别名]
# 或者: from device.Device import get_services [as 别名]
def set_property(self, key, value):
return self.dbus_method("SetProperty", key, value)
def get_uuid(self):
if "UUID" in self.get_properties().keys():
return self.get_properties()["UUID"]
def get_name(self):
if "Name" in self.get_properties().keys():
return self.get_properties()["Name"]
def get_description(self):
if "Description" in self.get_properties().keys():
return self.get_properties()["Description"]
def get_characteristics(self):
if "Characteristics" in self.get_properties().keys():
return self.get_properties()["Characteristics"]
if __name__ == "__main__":
from manager import Manager
from adapter import Adapter
from device import Device
# from utils import bluetooth_uuid_to_string
adapter = Adapter(Manager().get_default_adapter())
device = Device(adapter.get_devices()[0])
for serv in device.get_services():
service = DeviceService(serv)
print "uuid:\n %s" % service.get_uuid()