Skip to content
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

L2CAP Support for ISO 18013-5 Holders #27

Merged
merged 5 commits into from
Oct 1, 2024

Conversation

todd-spruceid
Copy link
Contributor

@todd-spruceid todd-spruceid commented Sep 16, 2024

This provides L2CAP support for the holder for 18013-5. Note that when connecting to iOS, calling connect() on the L2CAP socket throws a "resources not available" exception due to (apparently) Android not supporting iOS's implementation of link-layer encryption on L2CAP CoC streams. The Android holder now falls back to the old flow in this case; a corresponding change for the iOS reader will appear shortly to support this in a separate PR.

For convenience, this also includes a makefile to orchestrate building and running; make or make install will build the example app and attempt to install it on all connected android devices. make run will launch the example app on one device and attempt to attach logcat. make help lists the available commands.

NOTE: Currently not working!  See below.

This provides L2CAP support for the holder for 18013-5.  This is
disabled at present; the code is in place, but calling connect() on
the L2CAP socket throws a "resources not available" exception for
reasons I have not yet tracked down.

The code should otherwise be ready, however; the request read and
the response write are both in place.  The presence of an L2CAP
characteristic on the peripheral no longer breaks the old flow for
the code, so we now properly do non-L2CAP connections to L2CAP
peripherals.

For convenience, this also includes a makefile to orchestrate
building and running; `make` or `make install` will build the
example app and attempt to install it on all connected android
devices.  `make run` will launch the example app on one device
and attempt to attach `logcat`. `make help` lists the available
commands.
makefile Show resolved Hide resolved
makefile Outdated Show resolved Hide resolved
@todd-spruceid todd-spruceid requested a review from w4ll3 September 19, 2024 18:45
This code adds a fallback so that in the event an exception is thrown by the
L2CAP socket during connection, it will fall back to the old flow.  This is
necessary when interacting with the iPhone reader, as Android devices do not
seem to get along with BLE link-layer encryption as implemented in iOS.
@todd-spruceid todd-spruceid merged commit e5c0f7d into main Oct 1, 2024
2 checks passed
@todd-spruceid todd-spruceid deleted the skit-544-update-kotlin-18013-5-holder branch October 1, 2024 20:58
sprucekit-mobile-monorepo bot pushed a commit that referenced this pull request Nov 1, 2024
This adds similiar Android accordion component to iOS to better display Generic Credentials.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants