DEMO: C
Requirements
- Operating System: Windows, macOS, or Linux
Compilation
- Prepare the curl sdk for your Windows/macOS/Linux OS
- Download DEMO: ultra-encode-api-demo-c.zip
- Compile "ultra_encode_curl.c", and link it to "libcurl"
- Build the ultra_encode_curl file
Example
- Navigate into the bin directory and copy the firmware file here, and run 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
}