信息
/osc/info
API 返回有关其支持的相机和功能的基本信息。
输入
输出
名称
| 类型
| 说明
|
manufacturer |
字符串 |
相机制造商。 |
model |
字符串 |
相机型号。 |
serialNumber |
字符串 |
序列号。 |
firmwareVersion |
字符串 |
当前固件版本。 |
supportUrl |
字符串 |
相机的支持网页的 URL。 |
gps |
布尔型 |
如果相机具有 GPS,则为 True |
gyro |
布尔型 |
如果相机具有陀螺仪,则为 True。 |
uptime |
整型 |
相机启动后的秒数。 |
api |
字符串数组 |
支持的 API 列表。 |
endpoints |
对象 |
一个 JSON 对象,包含有关相机端点的信息。 参见下一个表。 |
apiLevel |
整数数组 |
如果此字段缺失,系统会使用默认值 [1]。 [1, 2] 表示 API 1 和 2 都受支持,而 [2] 表示只有 API 2 受支持。 开发者应负责检索此信息,并根据此信息的值分别予以实现。 此字段已添加到 API 级别 2 中。 |
_vendorSpecific |
[类型](可选) |
有关相机的供应商特有附加信息。 请使用下划线 ( _ ) 作为供应商特定密钥的前缀,以避免命名空间冲突。 |
endpoints
对象
此 JSON 对象提供有关相机端点使用的端口的信息。
名称
| 类型
| 说明
|
httpPort |
整型 |
HTTP 服务器的端口。 (默认值 80) |
httpUpdatesPort |
整型 |
通过 HTTP 接收更新的端口 |
httpsPort |
整型 |
(可选)HTTPs 服务器的端口。 (默认值 443) |
httpsUpdatesPort |
整型 |
(可选)通过 HTTPs 接收更新的端口。 |
错误
示例 |
请求 |
GET /osc/info HTTP/1.1
Host: [camera ip address]:[httpPort]
Accept: application/json
X-XSRF-Protected: 1 |
响应 (API 2) |
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: {CONTENT_LENGTH}
X-Content-Type-Options: nosniff
{
"manufacturer": "AAA",
"model": "BBB",
"serialNumber": "CCC",
"firmwareVersion": "DDD",
"supportUrl": "EEE",
"endpoints": {
"httpPort": 80,
"httpUpdatesPort": 10080,
...
},
"gps": true,
"gyro": false,
"uptime": 600,
"api": [
"/osc/info",
"/osc/state",
"/osc/checkForUpdates",
"/osc/commands/execute",
"/osc/commands/status"
],
"apiLevel": [1, 2]
} |
响应 (API 1) |
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: {CONTENT_LENGTH}
X-Content-Type-Options: nosniff
{
"manufacturer": "AAA",
"model": "BBB",
"serialNumber": "CCC",
"firmwareVersion": "DDD",
"supportUrl": "EEE",
"endpoints": {
"httpPort": 80,
"httpUpdatesPort": 10080,
...
},
"gps": true,
"gyro": false,
"uptime": 600,
"api": [
"/osc/info",
"/osc/state",
"/osc/checkForUpdates",
"/osc/commands/execute",
"/osc/commands/status"
]
} |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2017-04-06 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]