camera.updateSession
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
刷新会话超时时间。当出现以下情况时,会话会自动更新:
与相机互动;例如,以
当出现以下情况时,10 分钟超时时间应重置为 10 分钟完整
系统即会执行 takePicture
命令。此命令已弃用
在 API 级别 2 中声明。
参数
- sessionId::字符串类型的唯一会话标识符。
- timeout:(可选)请求的会话超时(以秒为单位)。
如果省略(HTTP 请求没有正文),相机应确定合理的
超时。
结果
- sessionId::传递的已确认的会话标识符字符串
。
- 超时:已确认的会话超时(以秒为单位)。
错误
- missing 参数:
sessionId
缺失;例如
未指定 sessionId
。
- invalidParameterName:一个或多个输入参数名称
无法识别。
- invalidParameterValue::识别输入参数名称,
但传递的一个或多个值无效;例如
sessionId
不存在、不再有效、其数据类型不正确,或
timeout
的数据类型不正确。
命令 I/O |
命令输入 |
{
"parameters": {
"sessionId": "12ABC3",
"timeout": 50
}
} |
命令输出 |
{
"results": {
"sessionId": "12ABC3",
"timeout": 50
}
} |
命令输出(错误) |
{
"error": {
"code": "missingParameter",
"message": "Parameter sessionId is missing."
}
} |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-21。
[null,null,["最后更新时间 (UTC):2024-08-21。"],[[["\u003cp\u003eRefreshes the camera session timeout upon interaction and resets it to the initially specified duration.\u003c/p\u003e\n"],["\u003cp\u003eRequires a unique session identifier (\u003ccode\u003esessionId\u003c/code\u003e) and optionally allows specifying a desired timeout duration in seconds.\u003c/p\u003e\n"],["\u003cp\u003eReturns the confirmed session identifier and timeout or reports errors like missing or invalid parameters.\u003c/p\u003e\n"],["\u003cp\u003eThis command is deprecated and was replaced with newer methods in API level 2.\u003c/p\u003e\n"]]],["The core function is to refresh a camera session's timeout. It utilizes a `sessionId` string for identification. An optional `timeout` parameter (in seconds) can be set; otherwise, the camera determines a reasonable duration. Successful execution returns the confirmed `sessionId` and `timeout`. Errors occur with missing or invalid `sessionId`, or invalid parameter names/values. This command has been deprecated from API level 2.\n"],null,["# camera.updateSession\n\nRefreshes the session timeout. A session automatically updates on any\ninteraction with the camera; for example, a session that starts with a\n10-minute timeout should reset to the full 10 minutes when a\n`takePicture` command executes. **This command was deprecated\nin API level 2.**\n\nParameters\n----------\n\n- **sessionId:** Unique session identifier of type string.\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:** Confirmed session identifier string that was passed to the command.\n- **timeout:** Confirmed session timeout in seconds.\n\nErrors\n------\n\n- **missingParameter:** `sessionId` is missing; for example, `sessionId` is not specified.\n- **invalidParameterName:** One or more input parameter names are unrecognized.\n- **invalidParameterValue:** Input parameter names are recognized, but one or more passed value are invalid; for example, the `sessionId` doesn't exist, it is no longer active, its data type is incorrect, or `timeout` is the wrong data type.\n\n| Command I/O ----------- ||\n|----------------------------|-------------------------------------------------------------------------------------------------------|\n| **Command Input** | ```text { \"parameters\": { \"sessionId\": \"12ABC3\", \"timeout\": 50 } } ``` |\n| **Command Output** | ```text { \"results\": { \"sessionId\": \"12ABC3\", \"timeout\": 50 } } ``` |\n| **Command Output (Error)** | ```text { \"error\": { \"code\": \"missingParameter\", \"message\": \"Parameter sessionId is missing.\" } } ``` |"]]