Skip to content

Unify v1/v2 SDK over shared connect() - #50

Open
ilouzl wants to merge 11 commits into
masterfrom
v2
Open

Unify v1/v2 SDK over shared connect()#50
ilouzl wants to merge 11 commits into
masterfrom
v2

Conversation

@ilouzl

@ilouzl ilouzl commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add TapSDK2 (framed v2 protocol) alongside existing TapSDK, plus encoder/parsers/features needed for v2 devices.
  • Share BLE transport (tapsdk._transport), protocol detect (c3ff000e → v2), and DeviceInfo across both SDKs.
  • New await connect() factory returns TapSDK or TapSDK2; register callbacks then await start(). Docs + examples/connect.py updated.

Closes #36

Test plan

  • pytest + flake8 green on CI
  • Run examples/connect.py on a v1 TapXR — expect Protocol: v1, device info, taps in controller mode
  • Run examples/v2.py / connect() on a v2 device — expect Protocol: v2
  • Confirm set_input_mode / set_input_type HID semantics still match docs (Text/ControllerText = HID; Controller + KEYBOARD = SDK taps, no HID)
  • Merge with a merge commit (no squash)

Made with Cursor

ilouzl and others added 8 commits June 8, 2026 15:47
Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	tapsdk/__init__.py
#	tapsdk/parsers.py
Detect protocol from GATT and return TapSDK or TapSDK2
from one entry point, with shared transport and DeviceInfo.

Refs #36

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Docs check

  • Status: OK
  • Affected quadrants: tutorial, how-to, reference, explanation
  • Gaps: none
  • Suggested edits: none

Address docs-verify gaps for PR #50: tutorial/readme happy path,
TapSDK2 reference, enums/events, v1 how-to labels, and connection model.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Workflow run: https://github.com/TapWithUs/tap-python-sdk/actions/runs/30809935445

Docs check

  • Status: NEEDS UPDATES
  • Affected quadrants: tutorial, how-to, reference, explanation
  • Gaps: docs/tutorial/getting-started.md expected tap output/tapcode shape is v1-only (tapped 5 as an int) while await connect() can return TapSDK2, which passes a one-element list ([5]) — already stated in docs/reference/events.md but not in the tutorial happy path; docs/reference/package.md / docs/reference/enumerations.md omit that ImuAcclSensitivity is re-exported from tapsdk (it is in tapsdk/__init__.py); docs/explanation/input-modes.md never mentions that v2 has no input modes / uses DeviceFeatures
  • Suggested edits: In docs/tutorial/getting-started.md (and briefly in docs/how-to/connect-and-listen.md preferred/v2 tap examples), note v1 tapcode is an int and v2 is [tapcode], and adjust the sample line accordingly; add ImuAcclSensitivity to the public-import table / re-export sentence in docs/reference/package.md and docs/reference/enumerations.md; add a short v2 cross-link in docs/explanation/input-modes.md to DeviceFeatures / docs/how-to/use-v2-features.md. Assets docs/assets/TAP-axis-alpha.png and docs/assets/TAPXR-axis.png are present and tracked — not missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Workflow run: https://github.com/TapWithUs/tap-python-sdk/actions/runs/30822789192

Docs check

  • Status: NEEDS UPDATES
  • Affected quadrants: tutorial, how-to, reference, explanation
  • Gaps: docs/how-to/use-spatial-control.md is still written as if every SDK instance supports set_input_type and register_air_gesture_state_events; those APIs exist only on v1 TapSDK (NUS), not on TapSDK2 returned by connect()
  • Suggested edits: In docs/how-to/use-spatial-control.md, add a v1/TapSDK scope note (same pattern as switch-input-modes.md / stream-raw-sensors.md): Spatial Control uses TapSDK.set_input_type and v1 air-gesture state callbacks; for v2 use DeviceFeatures / UnifiedAirGestures paths instead (or state that Spatial Control is v1-only)

Co-authored-by: Cursor <cursoragent@cursor.com>
@ilouzl
ilouzl requested review from io-commits and odedtap August 3, 2026 19:28
@ilouzl

ilouzl commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

This also closes #49 on the sdk side.
A fw fix will be published separately.

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.

sdk V2 backward compatability

2 participants