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

9 ビュー (過去 30 日間)
Yue
Yue 2024 年 9 月 22 日
編集済み: Walter Roberson 2024 年 11 月 6 日
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?还是可以选择其他合适的方式?

回答 (1 件)

Supraja
Supraja 2024 年 11 月 6 日
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
  1 件のコメント
Walter Roberson
Walter Roberson 2024 年 11 月 6 日
編集済み: Walter Roberson 2024 年 11 月 6 日
jsondecode does not appear to be supported by MATLAB Coder.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeJSON Format についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by