def __init__(self, advert_id, ad_type):
"""Default initialiser.
Creates the interface to the specified advertising data.
The DBus path must be specified.
:param advert_id: Unique ID of advertisement.
:param ad_type: Possible values: "broadcast" or "peripheral"
"""
# Setup D-Bus object paths and register service
self.path = '/ukBaz/bluezero/advertisement{0:04d}'.format(advert_id)
self.bus = dbus.SystemBus()
self.eventloop = async_tools.EventLoop()
self.interface = constants.LE_ADVERTISEMENT_IFACE
dbus.service.Object.__init__(self, self.bus, self.path)
self.props = {
constants.LE_ADVERTISEMENT_IFACE: {
'Type': ad_type,
'ServiceUUIDs': None,
'ManufacturerData': None,
'SolicitUUIDs': None,
'ServiceData': None,
'IncludeTxPower': False
}
}
评论列表
文章目录