dbus: add preliminary support for JSON encoded messages#423
Draft
dbus: add preliminary support for JSON encoded messages#423
Conversation
Use the new D-Bus and JSON modules in `sys/tmp` to allow clients with
JSON-based encoding.
This extends the D-Bus socket layer to support zero-byte separated,
variable-width message objects. This is then used to get a stream of
JSON objects.
JSON objects are always converted to the internally used format (for now
DVariant). This keeps modifications to the code-base much simpler and
guarantees that all paths work with the same data. Outgoing messages are
then converted again directly in the socket layer.
If we decide to fully commit to the new D-Bus module and convert all
users in `bus/driver/`, then we can avoid the conversion in most cases.
However, for broadcast/multicast messages, we always want to convert
messages to ensure each clients gets the properly encoded message.
NB: This is preliminary. The conversion from DVariant to JSON is not
standardized, nor do we want to commit to it right now. However, we
want to get feedback and give developers the chance to make use of
it.
We definitely intend to stabilize this in the near future.
Signed-off-by: David Rheinsberg <david@readahead.eu>
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.
Use the new D-Bus and JSON modules in
sys/tmpto allow clients with JSON-based encoding.This extends the D-Bus socket layer to support zero-byte separated, variable-width message objects. This is then used to get a stream of JSON objects.
JSON objects are always converted to the internally used format (for now DVariant). This keeps modifications to the code-base much simpler and guarantees that all paths work with the same data. Outgoing messages are then converted again directly in the socket layer.
If we decide to fully commit to the new D-Bus module and convert all users in
bus/driver/, then we can avoid the conversion in most cases. However, for broadcast/multicast messages, we always want to convert messages to ensure each clients gets the properly encoded message.NB: This is preliminary. The conversion from DVariant to JSON is not
standardized, nor do we want to commit to it right now. However, we
want to get feedback and give developers the chance to make use of
it.
We definitely intend to stabilize this in the near future.