]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Merge pull request #2 from makermelissa/module_refactor
authorJuan Biondi <juanernestobiondi@gmail.com>
Wed, 22 Jan 2020 17:26:00 +0000 (18:26 +0100)
committerGitHub <noreply@github.com>
Wed, 22 Jan 2020 17:26:00 +0000 (18:26 +0100)
Rebase changes and point to latest Platform Detect

setup.py
src/_bleio.py [new file with mode: 0755]

index 0bd15601b151d6170dda6aeeed743be33a76e614..9f1e8ef15decde313b6983a92cbf3805cb02306d 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -44,7 +44,7 @@ setup(
     packages=find_packages("src"),
     # py_modules lists top-level single file packages to include.
     # find_packages only finds packages in directories with __init__.py files.
-    py_modules=['analogio', 'bitbangio', 'board', 'busio', 'digitalio', 'micropython', 'pulseio', 'neopixel_write'],
+    py_modules=['_bleio', 'analogio', 'bitbangio', 'board', 'busio', 'digitalio', 'micropython', 'pulseio', 'neopixel_write'],
     package_data={'adafruit_blinka.microcontroller.bcm283x.pulseio': ['libgpiod_pulsein']},
     install_requires=[
         "Adafruit-PlatformDetect",
diff --git a/src/_bleio.py b/src/_bleio.py
new file mode 100755 (executable)
index 0000000..d6c1426
--- /dev/null
@@ -0,0 +1,46 @@
+"""This is a stub of _bleio for use in GitHub Actions CI. It is NOT meant to provide _bleio
+   functionality in CPython."""
+
+adapter = None
+
+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 UUID:
+    def __init__(self, uuid):
+        pass
+
+class Descriptor:
+    @staticmethod
+    def add_to_characteristic(characteristic, uuid, *, read_perm=Attribute.OPEN,
+                              write_perm=Attribute.OPEN, max_length=20, fixed_length=False,
+                              initial_value=b''):
+        pass
+
+class CharacteristicBuffer:
+    pass
+
+class PacketBuffer:
+    pass
+
+class Characteristic:
+    BROADCAST = 0
+    READ = 0
+    WRITE = 0
+    NOTIFY = 0
+    INDICATE = 0
+    WRITE_NO_RESPONSE = 0
+
+    @staticmethod
+    def add_to_service(service, uuid, *, properties=0, read_perm=Attribute.OPEN,
+                       write_perm=Attribute.OPEN, max_length=20, fixed_length=False,
+                       initial_value=None):
+        raise NotImplementedError()
+
+