当前位置: 首页>>代码示例>>Python>>正文


Python GATTRequester.__init__方法代码示例

本文整理汇总了Python中gattlib.GATTRequester.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python GATTRequester.__init__方法的具体用法?Python GATTRequester.__init__怎么用?Python GATTRequester.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gattlib.GATTRequester的用法示例。


在下文中一共展示了GATTRequester.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from gattlib import GATTRequester [as 别名]
# 或者: from gattlib.GATTRequester import __init__ [as 别名]
    def __init__(self, addr=None, device='hci0', debug=False, **connect_kwargs):
        '''
        @param addr (optional): MAC address of Pavlok device
                                If not passed, will be discovered with DiscoveryService (requires root privileges)
        @param device (optional): host Bluetooth interface ('hci0' by default)
        @param debug (optional): debug logging (disabled by default)
        @param connect_kwargs: keyword arguments (security_level, channel_type, mtu, psm) to pass to GATTRequester.connect
                               security_level: 'low' (default), 'medium', 'high'
                               channel_type: 'public' (default), 'random'
                               mtu: integer
                               psm: integer
        '''
        self._init_logging(debug)

        if not addr:
            addr = self._get_pavlok_mac_addr(device)
            assert addr, 'Could not find Pavlok device'

        GATTRequester.__init__(self, addr, False, device) #GATTRequester is an old-style class
        if connect_kwargs:
            self.logger.debug('Got keyword arguments for self.connect: %s', connect_kwargs)
        self.connect(wait=False, **connect_kwargs) #Blocking connect() is better, but it would require root privileges
        self._wait_until_connected()

        characteristics = self.discover_characteristics()
        self.logger.debug('GATT characteristics: %s', characteristics)
        #Find matching value handles for service UUIDs
        self.handles = {name:filter(lambda e: e['uuid'] == uuid, characteristics)[0]['value_handle']\
                        for name, uuid in self.service_uuids.items()}
        self.logger.debug('GATT value handles: %s', self.handles)
        self.logger.debug('Hardware revision: %s, firmware revision: %s', self.hardware_revision, self.firmware_revision)
开发者ID:flagist0,项目名称:pypavlok,代码行数:33,代码来源:pypavlok.py

示例2: __init__

# 需要导入模块: from gattlib import GATTRequester [as 别名]
# 或者: from gattlib.GATTRequester import __init__ [as 别名]
 def __init__(self, wakeup, pstream, tstream, *args):
     GATTRequester.__init__(self, *args)
     self.wakeup = wakeup
     self.s = pstream
     self.t = tstream
     self.count = 0
     self.prev_ay = 1
     self.local_maxima = 1
开发者ID:smihir,项目名称:smartshoes,代码行数:10,代码来源:kiba_kumba_controller.py

示例3: __init__

# 需要导入模块: from gattlib import GATTRequester [as 别名]
# 或者: from gattlib.GATTRequester import __init__ [as 别名]
 def __init__(self, wakeup, pstream, *args):
     GATTRequester.__init__(self, *args)
     self.wakeup = wakeup
     self.s = pstream
开发者ID:smihir,项目名称:smartshoes,代码行数:6,代码来源:notify-plot.py

示例4: __init__

# 需要导入模块: from gattlib import GATTRequester [as 别名]
# 或者: from gattlib.GATTRequester import __init__ [as 别名]
 def __init__(self, wakeup, *args):
     GATTRequester.__init__(self, *args)
     self.wakeup = wakeup
开发者ID:AwxiVYTHUIiMOol,项目名称:https-bitbucket.org-OscarAcena-pygattlib,代码行数:5,代码来源:receive_notification.py

示例5: __init__

# 需要导入模块: from gattlib import GATTRequester [as 别名]
# 或者: from gattlib.GATTRequester import __init__ [as 别名]
 def __init__(self, *args):
     GATTRequester.__init__(self, *args)
开发者ID:LucaBongiorni,项目名称:BLESuite-CLI,代码行数:4,代码来源:cmdLineToolWrappers.py

示例6: __init__

# 需要导入模块: from gattlib import GATTRequester [as 别名]
# 或者: from gattlib.GATTRequester import __init__ [as 别名]
 def __init__(self, wakeup, update, *args):
     GATTRequester.__init__(self, *args)
     self.wakeup = wakeup
     self.update = update
开发者ID:HcDevel,项目名称:SmartWatch,代码行数:6,代码来源:upload.py

示例7: __init__

# 需要导入模块: from gattlib import GATTRequester [as 别名]
# 或者: from gattlib.GATTRequester import __init__ [as 别名]
 def __init__(self, thread, verbose, *args):
     GATTRequester.__init__(self, *args)
     self.event_thread = thread
     self.verbose = verbose
开发者ID:cryptax,项目名称:fittools,代码行数:6,代码来源:read-battery.py

示例8: __init__

# 需要导入模块: from gattlib import GATTRequester [as 别名]
# 或者: from gattlib.GATTRequester import __init__ [as 别名]
 def __init__(self, address, do_connect, device ):
     GATTRequester.__init__(self, address, do_connect, device)
     self.notification21data = ""
     self.notification24data = ""
开发者ID:szabolcszijarto,项目名称:dandolib,代码行数:6,代码来源:dandolib.py


注:本文中的gattlib.GATTRequester.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。