Skip to content

aioble: Fix descriptor flag handling. #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion micropython/bluetooth/aioble-client/manifest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
metadata(version="0.2.0")
metadata(version="0.3.0")

require("aioble-core")

Expand Down
2 changes: 1 addition & 1 deletion micropython/bluetooth/aioble-server/manifest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
metadata(version="0.2.0")
metadata(version="0.3.0")

require("aioble-core")

Expand Down
2 changes: 1 addition & 1 deletion micropython/bluetooth/aioble/aioble/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ class ClientDescriptor(BaseClientCharacteristic):
def __init__(self, characteristic, dsc_handle, uuid):
self.characteristic = characteristic

super().__init__(dsc_handle, _FLAG_READ | _FLAG_WRITE_NO_RESPONSE, uuid)
super().__init__(dsc_handle, _FLAG_READ | _FLAG_WRITE, uuid)

def __str__(self):
return "Descriptor: {} {} {}".format(self._value_handle, self.properties, self.uuid)
Expand Down
8 changes: 2 additions & 6 deletions micropython/bluetooth/aioble/aioble/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@

_FLAG_WRITE_CAPTURE = const(0x10000)

_FLAG_DESC_READ = const(1)
_FLAG_DESC_WRITE = const(2)


_WRITE_CAPTURE_QUEUE_LIMIT = const(10)

Expand Down Expand Up @@ -307,14 +304,13 @@ class Descriptor(BaseCharacteristic):
def __init__(self, characteristic, uuid, read=False, write=False, initial=None):
characteristic.descriptors.append(self)

# Workaround for https://github.com/micropython/micropython/issues/6864
flags = 0
if read:
flags |= _FLAG_DESC_READ
flags |= _FLAG_READ
if write:
flags |= _FLAG_WRITE
self._write_event = asyncio.ThreadSafeFlag()
self._write_data = None
flags |= _FLAG_DESC_WRITE

self.uuid = uuid
self.flags = flags
Expand Down
2 changes: 1 addition & 1 deletion micropython/bluetooth/aioble/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# code. This allows (for development purposes) all the files to live in the
# one directory.

metadata(version="0.2.1")
metadata(version="0.3.1")

# Default installation gives you everything. Install the individual
# components (or a combination of them) if you want a more minimal install.
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy