|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Classes | |
| class | Layout |
| class | PsyTime |
| class | _Levels |
| class | PsyType |
| class | PsyContext |
| class | Time |
| class | Raw |
| class | DataMessage |
| class | _Packed |
Variables | |
| tuple | M64 = (1 << 64) - 1 |
| tuple | M32 = (1 << 32) - 1 |
| list | _ATTRS |
CMSDK DataMessage in pure Python: byte-exact with the C++ library (and the Kotlin codec).
Both wire forms are supported: the regular block (C++ ``DataMessage::data``, 200-byte header +
entries) and the packed form (C++ ``DataMessage::toPacked()``), which Psyclone services accept and
answer in. The layout must stay in step with CMSDK ``include/DataMessage.h``; the tests check it
against the golden messages the C++ library writes (``CMSDK/kotlin/fixtures``).
from psyclone_client import DataMessage
m = DataMessage().set_string("PsyPost", "AudioFrame").set_data("pcm", pcm)
m["Gain"] = 0.7 # str -> text, int -> int64, float -> double, bytes -> data
wire = m.to_bytes() # or m.to_packed_bytes()
back = DataMessage.from_bytes(wire) # either form
|
protected |
Definition at line 56 of file datamessage.py.
| tuple psyclone_client.datamessage.M32 = (1 << 32) - 1 |
Definition at line 20 of file datamessage.py.
| tuple psyclone_client.datamessage.M64 = (1 << 64) - 1 |
Definition at line 19 of file datamessage.py.