camera.startSession
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
启动在固定时间间隔后超时的会话。将相机锁定到
发出请求,并确保摄像头保持唤醒状态。请注意,从
都应该始终允许进行新会话如果已有会话
在开始新会话之前,相机应自动关闭。
此命令已在 API 级别 2 中弃用。
参数
- timeout:(可选)请求的会话超时(以秒为单位)。
如果省略(HTTP 请求没有正文),相机应确定合理的
超时。
结果
- sessionId::字符串类型的唯一会话标识符。
- 超时:已确认的会话超时(以秒为单位)。
错误
- invalidParameterName:输入参数名称无法识别。
- invalidParameterValue::可以识别输入参数名称,但将
传递的值无效;例如,值超出范围或其数据
类型不正确。
命令 I/O |
命令输入 |
{
"parameters": {
"timeout": 50
}
} |
命令输出 |
{
"results": {
"sessionId": "12ABC3",
"timeout": 50
}
} |
命令输出(错误) |
{
"error": {
"code": "cameraInExclusiveUse",
"message": "Camera already in exclusive use, new
session can't be started."
}
} |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-21。
[null,null,["最后更新时间 (UTC):2024-08-21。"],[[["\u003cp\u003eStarts a session that locks the camera to the requesting client and keeps it awake, timing out after a specified or default interval.\u003c/p\u003e\n"],["\u003cp\u003eA new session can always be started, automatically closing any existing session.\u003c/p\u003e\n"],["\u003cp\u003eThis command, deprecated in API level 2, returns a unique session ID and the confirmed timeout duration.\u003c/p\u003e\n"],["\u003cp\u003ePossible errors include invalid parameter names or values, or the camera already being in exclusive use.\u003c/p\u003e\n"]]],["The core action initiates a timed camera session, locking the camera to the client and ensuring it remains active. A new session is always permitted, automatically ending any existing session. The user can optionally specify a session timeout in seconds; otherwise, the camera sets a default. The output includes a unique session ID and the confirmed timeout. Errors can occur if parameter names or values are invalid. This command has been deprecated after API level 2.\n"],null,["# camera.startSession\n\nStarts a session that times out after a fixed interval. Locks the camera to the\nrequesting client and makes sure the camera stays awake. Please note, starting\na new session should always be allowed. If there is an existing session, it\nshould be closed automatically by the camera before starting the new session.\n**This command was deprecated in API level 2.**\n\nParameters\n----------\n\n- **timeout:** (Optional) Requested session timeout in seconds. If omitted (HTTP request has no body), the camera should determine a reasonable timeout.\n\nResults\n-------\n\n- **sessionId:** Unique session identifier of type string.\n- **timeout:** Confirmed session timeout in seconds.\n\nErrors\n------\n\n- **invalidParameterName:** The input parameter name is unrecognized.\n- **invalidParameterValue:** The input parameter name is recognized, but the passed value is invalid; for example, the value is out of range or its data type is incorrect.\n\n| Command I/O ----------- ||\n|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| **Command Input** | ```text { \"parameters\": { \"timeout\": 50 } } ``` |\n| **Command Output** | ```text { \"results\": { \"sessionId\": \"12ABC3\", \"timeout\": 50 } } ``` |\n| **Command Output (Error)** | ```povray { \"error\": { \"code\": \"cameraInExclusiveUse\", \"message\": \"Camera already in exclusive use, new session can't be started.\" } } ``` |"]]