get-status 接口
实时获取设备的工作状态,主要有录制状态、直播状态、固件升级状态、U 盘格式化状态等。
请求方式
GET http://ip/usapi?method=get-status
参数 | 说明 |
---|---|
method | 方法名称:get-status |
返回数据
JSON 结构如下:
{
"result": 0, // 返回状态
"cur-status": 65552, // 设备运行状态掩码
"last-rec-status": 0, // U 盘上次录制失败错误码
"last-rec-status2": 0, // SD 卡上次录制失败错误码
"cur-time": "2019-09-26 ...", // 设备当前时间
"box-name": "", // 设备名称
"lock-user": [], // 手机客户端连接状态
"sysstat": {}, // 系统状态
"rec-status": {}, // 录制状态
"live-status": {}, // 直播状态
"upgrade-status": {}, // 固件升级过程状态
"format-status": {}, // 格式化状态
"disk-test": {}, // U 盘性能测试过程状态
"living-test": {}, // 直播推流测试过程状态
"check-upgrade": {}, // 在线固件检测过程状态
"send-file": {}, // 文件上传状态
"send-file-test": {}, // 文件上传测试过程状态
"input-signal": {}, // 输入信号信息
"usb": {}, // U 盘信息
"sd": {}, // SD 卡信息
"wifi": {}, // 无线网信息,开启 AP 模式后,为 AP 连接信息
"eth": {}, // 以太网信息
"mobile": {}, // 移动网络信息
"upgrade": {}, // 新版本固件信息
"downgrade": {}
}
返回状态
"result": 0
设备运行状态掩码
"cur-status": 65552
设备当前运行的各种状态,通过不同掩码值表示,各个状态对应的掩码值请参考 设备状态掩码。采用以下计算方式来判断:
1、通设备状态掩码表可知,正在进行固件升级的值为:statusUpgrade = 0x4000
2、如果 cur-status & statusUpgrade = statusUpgrade
,则说明设备正处于固件升级的状态中
系统状态
"sysstat": {
"cpu": 1500
"cpu-usage": 19
"eth-rx": 106248
"eth-tx": 4339448
"mem-free": 195612
"mem-total": 524288
"mobile-rx": 0
"mobile-tx": 0
"sd-rd": 0
"sd-wr": 0
"uptime": 331255
"usb-rd": 0
"usb-wr": 0
"wlan-rx": 0
"wlan-tx": 0
}
输入信号状态
"input-signal": {
"status": 0,
"cx": 0,
"cy": 0,
"interlaced": 0,
"frame-rate": 0.00,
"channel-valid": 0,
"is-lpcm": 0,
"bits-per-sample": 0,
"sample-rate": 0
}
录制状态
"rec-status": {
"result": 0,
"run-ms": 0,
"cur-bps": 0,
"avg-bps": 0,
"client-id": ""
}
直播状态
"live-status": {
"result": 0,
"run-ms": 0,
"cur-bps": 0,
"avg-bps": 0,
"net": 0,
"result2": 0,
"cur-bps2": 0,
"net2": 0,
"client-id": ""
}
直播推流测试过程状态
"living-test": {
"upload-bps": 0,
"percent": 0,
"result": 27,
"net": 0,
"client-id": ""
}
在线固件检测过程状态
"check-upgrade": {
"result": 0,
"client-id": ""
}
新版本固件信息
"upgrade": {
"ver": "",
"date": "",
"size-byte": 0,
"info": []
}
固件升级过程状态
"upgrade-status": {
"step": 0,
"percent": 0,
"result": 27,
"client-id": "",
"mode": "none"
}
文件上传状态
"send-file": {
"total-count-ongoing": 0,
"total-count-done": 4,
"disk-type": 0,
"name": "",
"result": 31,
"message": "",
"left-time": 0,
"percent": 0
}
文件上传测试过程状态
"send-file-test": {
"result": 27,
"client-id": "",
"id": 0
}
U 盘信息
"usb": {
"disk-status": 1,
"total-size": 61638148096,
"used-size": 3559489536,
"free-size": 57944440832,
"block-size": 32768,
"usage": 6,
"sys-path": "/dev/sda1",
"fs-type": "vfat",
"mount-path": "/usr/share/web-data/media/disk0",
"fs-label": "C472-731D",
"write-bps": 14255282,
"read-bps": 0,
"free-sec": 208038,
"file-count": 47,
"beign-time": "2019-09-24 08:04:39",
"end-time": "2019-09-28 07:12:44",
"total-cache-time": 0
}
SD 卡信息
"sd": {
"disk-status": 1,
"total-size": 31895175168,
"used-size": 3708043264,
"free-size": 24997614388,
"block-size": 16384,
"usage": 12,
"sys-path": "/dev/mmcblk1p1",
"fs-type": "vfat",
"mount-path": "/usr/share/web-data/media/disk1",
"fs-label": "9C30-9CB8",
"write-bps": 0,
"read-bps": 0,
"free-sec": 89749,
"file-count": 50,
"beign-time": "2019-09-24 07:49:57",
"end-time": "2019-09-28 07:12:44",
"total-cache-time": 103062
}
U 盘性能测试过程状态
"disk-test": {
"read-bps": 0,
"write-bps": 0,
"percent": 0,
"result": 27,
"client-id": ""
}
磁盘格式化过程状态
"format-status": {
"percent": 0,
"result": 27,
"client-id": ""
}
无线网信息
当 cur-status
& 0x40
= 0x40
时,无线网卡处于 AP 模式,以下信息为 AP 连接信息
"wifi": {
"name": "MWL1",
"level": 0,
"ip": "192.168.8.249",
"mask": "255.255.255.0",
"router": "192.168.8.1",
"dns": "192.168.8.1"
}
以太网信息
"eth": {
"ip": "10.10.107.212",
"mask": "255.255.0.0",
"router": "10.10.0.1",
"dns": "10.0.0.3"
}
移动网络信息
"mobile": {
"ip": "",
"mask": "",
"router": "",
"dns": ""
}