DEMO: C 语言
环境准备
- 操作系统:支持 Windows、macOS、Linux
源码编译
- 开发者自己准备相应平台(Windows/macOS/Linux/...) 的"curl sdk"
- DEMO 下载链接:ultra-encode-api-demo-c.zip
- 编译 "ultra_encode_curl.c",链接到"libcurl"
- 生成可执行性文件 "ultra_encode_curl"
运行方式
- 在终端控制台进入 bin 目录, 将固件文件拷贝到相应平台,执行相应平台的 ultra_encode_curl
cd ultra-encode-api/demo/c/bin
cp ultra_encode_hdmi_rev_a_1_3_328.mwf linux
cd linux
./ultra_encode_curl <hostip:port>
***** 1. login *****
login response data:
{
"result": 0
}
***** 2. get info *****
get info response data:
{
"result": 0,
"mac-addr": {
"eth": "70:b3:d5:75:d0:4c",
"wifi": "70:b3:d5:75:d0:4d",
"blue": "70:b3:d5:75:d0:4e"
},
"snapshot": "/tmp/sbox-snapshot/sbox-quarter.jpg",
"product": {
"sn": "A304201201001",
"product-id": 772,
"hardware-ver": "A",
"firmware-id": 1,
"firmware-ver-s": "1.3.328",
"factory-firmware-ver-s": "1.3.328",
"product-name": "Ultra Encode",
"module-name": "Ultra Encode HDMI",
"manu-name": "MAGEWELL",
"features": 1,
"max-lock-count": 2
},
"audio-range": {
"hdmi": {
"max": 6.00,
"min": -100.00,
"def": 0.00
},
"mic": {
"max": 55.25,
"min": -12.00,
"def": 0.00
},
"phone": {
"max": 6.00,
"min": -57.00,
"def": 0.00
}
},
"codec-cap": {}
}
***** 3. upload firmware *****
upload firmware response data:
{
"result": 0,
"up-to-date": true,
"version": "1.2.123",
"size": 12494463
}