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_aio_rev_b_2_0_318.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": "d0:c8:57:81:02:2d",
                "wifi": "d0:c8:57:81:02:2e",
                "softap": "d0:c8:57:81:02:2f"
        },
        "snapshot": "/tmp/sbox-snapshot/sbox-quarter.jpg",
        "main-snapshot": "/tmp/sbox-snapshot/mainstream.jpg",
        "sub-snapshot": "/tmp/sbox-snapshot/substream.jpg",
        "product": {
                "sn": "B313220727002",
                "product-id": 787,
                "hardware-ver": "B",
                "firmware-id": 1,
                "firmware-ver-s": "2.0.312",
                "factory-firmware-ver-s": "2.0.283",
                "product-name": "Ultra Encode",
                "module-name": "Ultra Encode AIO",
                "manu-name": "MAGEWELL",
                "features": 1,
                "max-lock-count": 2,
                "live-support": 4095,
                "cloud-support": 1,
                "record-support": 1,
                "scheduler-support": 1,
                "nas-support": 1,
                "multi-audio-support": 1
        },
        "nosignal": {},
        "input-source": {},
        "audio-range": {},
        "codec-cap": {},
        "rec": {},
        "nas": {},
        "color-range": {},
        "video-format": {},
        "living": {},
        "surface": {}
}

***** 3. upload firmware *****
upload firmware response data:
{
        "result": 0,
        "up-to-date": true,
        "version": "2.0.123",
        "size": 12494463
}

与“”相关结果约

    找不到与“”相关的结果

    与“”相关结果约

      找不到与“”相关的结果