How to use UDP/TCP to transfer json files in real time? OR:怎么使用UDP​/TCP实时传输js​on文件?

17 visualizzazioni (ultimi 30 giorni)
We need to transfer the data containing json between Speedgoat and a device, receiving and sending it in simulink:
The data format is: fixed 18-byte header + variable length JSON + 1-byte checksum
We want to implement real-time transmission of JSON file/variable length JSON data based on Speedgoat. The current difficulty is how to unpack json using unpack module? Or can you choose another appropriate way?
OR:
我们需要将Speedgoat与某设备传输含json的数据,在simulink里接收和发送:
数据格式为:固定 18 字节头 + 变长 JSON + 1 字节校验和
我们想实现基于Speedgoat的JSON文件/变长 JSON数据实时传输,目前困难是怎么使用unpack模块解包json?还是可以选择其他合适的方式?

Risposte (1)

Supraja
Supraja il 6 Nov 2024 alle 3:27
Hello Yue,
MATLAB doesn’t have a built-in unpack module specifically for JSON, but you can use MATLAB’s 'jsondecode' function to parse JSON data.
Please refer to the documentation of 'jsondecode' function given below:
I hope this helps!
Thanks

Prodotti


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by