--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CircuitPython/bleio.py Wed Aug 28 19:53:19 2019 +0200 @@ -0,0 +1,223 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2019 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module containing stubs for API generation of the 'bleio' module. +""" + +adapter = object + +class Address(): + PUBLIC = 0 + RANDOM_STATIC = 0 + RANDOM_PRIVATE_RESOLVABLE = 0 + RANDOM_PRIVATE_NON_RESOLVABLE = 0 + + def __init__(self, address, address_type): + pass + + @property + def address_bytes(self): + pass + + @property + def type(self): + pass + +class Adapter(): + @property + def enabled(self): + pass + + @property + def address(self): + pass + + @property + def default_name(self): + pass + +class Attribute(): + NO_ACCESS = 0 + OPEN = 0 + ENCRYPT_NO_MITM = 0 + ENCRYPT_WITH_MITM = 0 + LESC_ENCRYPT_WITH_MITM = 0 + SIGNED_NO_MITM = 0 + SIGNED_WITH_MITM = 0 + +class Central(): + def __init__(self): + pass + + def connect(self, address, timeout, *, service_uuids_whitelist=None): + pass + + def disconnect(self): + pass + + def discover_remote_services(self, service_uuids_whitelist=None): + pass + + @property + def connected(self): + pass + +class Characteristic(): + BROADCAST = 0 + INDICATE = 0 + NOTIFY = 0 + READ = 0 + WRITE = 0 + WRITE_NO_RESPONSE = 0 + + def __init__(self, uuid, *, properties=0, read_perm=Attribute.OPEN, + write_perm=Attribute.OPEN, max_length=20, + fixed_length=False, descriptors=None): + pass + + @property + def properties(self): + pass + + @property + def uuid(self): + pass + + @property + def value(self): + pass + + @property + def descriptors(self): + pass + + def service(self, read_only): + pass + + def set_cccd(self, *, notify=False, indicate=False): + pass + +class CharacteristicBuffer(): + def __init__(self, characteristic, *, timeout=1, buffer_size=64): + pass + + def read(self, nbytes=None): + pass + + def readinto(self, buf): + pass + + def readline(self): + pass + + @property + def in_waiting(self): + pass + + def reset_input_buffer(self): + pass + + def deinit(self): + pass + +class Descriptor(): + def __init__(self, uuid, *, read_perm=Attribute.OPEN, + write_perm=Attribute.OPEN): + pass + + def characteristic(self, read_only): + pass + + @property + def uuid(self): + pass + + @property + def value(self): + pass + +class Peripheral(): + def __init__(self, services=(), *, name=None): + pass + + def connected(self, read_only): + pass + + @property + def services(self): + pass + + @property + def name(self): + pass + + def start_advertising(self, data, *, scan_response=None, connectable=True, + interval=1): + pass + + def stop_advertising(self): + pass + + def disconnect(self): + pass + + def discover_remote_services(self, service_uuids_whitelist=None): + pass + + def pair(self): + pass + +class ScanEntry(): + @property + def address(self): + pass + + @property + def advertisement_bytes(self): + pass + + @property + def rssi(self): + pass + +class Scanner(): + def __init__(self): + pass + + def scan(self, timeout, *, interval=0.1, window=0.1): + pass + +class Service(): + def __init__(self, uuid, characteristics, *, secondary=False): + pass + + @property + def remotes(self): + pass + + @property + def secondarys(self): + pass + + @property + def uuids(self): + pass + +class UUID(): + def __init__(self, value): + pass + + @property + def uuid16(self): + pass + + @property + def uuid128(self): + pass + + @property + def size(self): + pass