feat: implement NodeApi and DataApi for WearOS support#3517
Open
chaudl113 wants to merge 2 commits into
Open
Conversation
Replace UnsupportedOperationException stubs with working implementations using the GmsConnector pattern (same as MessageApiImpl). NodeApiImpl: - getLocalNode() - get local device node info - getConnectedNodes() - list connected wearable nodes - addListener() - register for node change events - removeListener() - unregister listener DataApiImpl: - getDataItem() - fetch single data item by URI - getDataItems() - fetch all data items or by URI - putDataItem() - create/update data item - deleteDataItems() - remove data items - getFdForAsset() - get file descriptor for asset - addListener/removeListener - data change listeners Both delegate to WearableServiceImpl via GmsConnector.call(), which already has working implementations for all these operations. Partial fix for microg#2843
Phase 2 - Transport Layer: WearableConnection: - TCP socket connection with read/write threads - RootMessage protocol encoding/decoding - Thread-safe message queue for writes - Connection lifecycle management SocketConnectionThread: - TCP server listening on port 5601 (WearOS standard) - Single connection management - Accept loop with graceful shutdown ServerMessageListener: - Base listener for wearable protocol messages - Connect/Disconnect handshake handling - Heartbeat response - Connection lifecycle callbacks These classes implement the transport layer that WearableImpl expects for communicating with WearOS devices. Partial fix for microg#2843
Author
Phase 2 Update - Transport LayerAdded TCP transport layer for WearOS device communication: WearableConnection
SocketConnectionThread
ServerMessageListener
Summary (Phase 1 + 2)
Next (Phase 3)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partial fix for #2843
Summary
Replace stubs in NodeApiImpl and DataApiImpl with working implementations using the existing pattern (same approach as MessageApiImpl).
Changes
NodeApiImpl
getLocalNode()- get local device node info via WearableServiceImplgetConnectedNodes()- list connected wearable nodesaddListener()- register for node change events (NODE_CHANGED)removeListener()- unregister listenerDataApiImpl
getDataItem()- fetch single data item by URIgetDataItems()- fetch all data items or filter by URIputDataItem()- create/update data item with PutDataRequestdeleteDataItems()- remove data items by URIgetFdForAsset()- get file descriptor for asset (by digest)addListener()/removeListener()- data change listenersArchitecture
Both implementations delegate to
WearableServiceImplviaGmsConnector.call(), which already has working implementations for all these operations. This follows the same pattern used byMessageApiImpl.sendMessage().Testing
Next Steps (Phase 2-4)