Trạng thái
API /osc/commands/status
trả về trạng thái cho các lệnh inProgress
trước đó. API status
rất hữu ích trong việc thăm dò tiến trình của một lệnh đã đưa ra trước đó; chẳng hạn như xác định liệu camera.takePicture
đã hoàn tất hay chưa.
Tên |
Loại |
Mô tả |
id |
Chuỗi |
Mã lệnh được lệnh gọi trước đó trả về cho
/osc/commands/execute . |
Đầu ra
Kết quả cũng là một đối tượng lệnh (xem phần Đầu ra của /osc/commands/execute
)
Lỗi
Mã lỗi |
Mô tả |
missingParameter |
id chưa được chỉ định. Tham số này yêu cầu mã nhận dạng lệnh do lệnh gọi trước đó trả về cho /osc/commands/execute . |
invalidParameterName |
Không nhận dạng được tham số đầu vào. |
invalidParameterValue |
Tham số đầu vào được nhận dạng, nhưng giá trị của nó không hợp lệ; ví dụ: giá trị id không tồn tại hoặc loại của giá trị không chính xác. |
Ví dụ: |
Yêu cầu |
POST /osc/commands/status HTTP/1.1 Host: [camera ip address]:[httpPort] Content-Type: application/json;charset=utf-8 Accept: application/json Content-Length: {CONTENT_LENGTH} X-XSRF-Protected: 1
{ "id": "90ABCD" } |
Đáp |
HTTP/1.1 200 OK Content-Type: application/json;charset=utf-8 Content-Length: {CONTENT_LENGTH} X-Content-Type-Options: nosniff
{ "name": "camera.takePicture", "state": "done", "results": { "fileUri": "ABC.JPG" } } |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-08-21 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2024-08-21 UTC."],[[["The `/osc/commands/status` API is used to check the status of previously executed commands, like `camera.takePicture`, that were in progress."],["It requires the `id` of the command, obtained from the `/osc/commands/execute` API, to retrieve the status."],["The API response provides details like command name, state (e.g., \"done\"), and any results, such as a file URI."],["Potential errors include missing or invalid `id` parameters."]]],["The `/osc/commands/status` API retrieves the status of prior `inProgress` commands, using a command ID from `/osc/commands/execute`. Input requires the `id` parameter; output mirrors the command object format of `/osc/commands/execute`. Errors include `missingParameter` (no ID), `invalidParameterName`, or `invalidParameterValue` (incorrect ID type/value). An example shows a POST request with ID \"90ABCD\" and a successful response indicating \"camera.takePicture\" is \"done\" with the file URI.\n"]]