Skip to content

Movments - #1

Merged
jason-shen merged 2 commits into
mainfrom
movments
Aug 24, 2026
Merged

jason-shen merged 2 commits into
mainfrom
movments

Conversation

@jason-shen

Copy link
Copy Markdown
Member

This pull request adds support for handling generic data packets sent from the server to the client via the data channel. It introduces a new on_data event callback, updates the relevant types and documentation, and ensures that payloads are base64-decoded before being delivered to the handler.

Event and Data Handling Enhancements:

  • Added a new optional on_data callback to the EventHandler class, which receives topic-addressed data packets from the server with payloads already base64-decoded. This allows clients to handle fire-and-forget server data, such as locomotion commands, in a structured way. (src/streamcore/types.py [1] README.md [2] README.zh-CN.md [3]
  • Updated the DataChannelMessage type to support messages of type "data", including new topic and payload fields for carrying the data packet information. (src/streamcore/types.py src/streamcore/types.pyL60-R68)

Implementation Details:

  • Modified the message handling logic in StreamCoreClient to decode base64 payloads from "data" messages and invoke the on_data callback if set, with error handling for malformed payloads. (src/streamcore/client.py src/streamcore/client.pyR503-R511)
  • Added necessary imports for base64 and binascii to support payload decoding. (src/streamcore/client.py src/streamcore/client.pyR4-R5)

Project Versioning:

  • Bumped the package version to 0.1.5 to reflect the new feature. (pyproject.toml pyproject.tomlL7-R7)

@jason-shen jason-shen self-assigned this Aug 24, 2026
@jason-shen jason-shen added the enhancement New feature or request label Aug 24, 2026
@jason-shen
jason-shen merged commit 9dfb64e into main Aug 24, 2026
@jason-shen
jason-shen deleted the movments branch August 24, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant