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

Feature Request: Add formal serialization/de-serialization to methods to data objects #112

Open
dzimmanck opened this issue Dec 18, 2019 · 0 comments

Comments

@dzimmanck
Copy link

The XBee data and metadata objects (messages, status, addresses, etc) are not natively JSON serializable, which slightly complicates integration of this library into a multi-agent control frameworks where agents communicate over a message brokers such as ZeroMQ, RabbitMQ, or Mosquitto, which require all messages JSON serializable. I find myself frequently building serializations for the XBee data classes.

Since the serialize/deserialize format must be compatible between sender and reeiver, it would be good if there are formal serialize/deserialize methods build into these objects to guarantee this compatibility. Something like:

msq = device.read(...)
msq_json = msg.to_json()
publish(msq_json) # some publish over a message broker

from digi.xbee.utils import read_json
msg = read_json(msq_json)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants