Stan
Interfejs /osc/commands/status
API zwraca stan poprzednich poleceń inProgress
. Interfejs API status
przydaje się do ankietowania postępu wykonanego wcześniej polecenia. np. ustalenie, czy zadanie camera.takePicture
zostało ukończone.
Nazwa |
Typ |
Opis |
id |
Ciąg znaków |
Identyfikator polecenia zwrócony przez poprzednie wywołanie
/osc/commands/execute . |
Wyniki
Dane wyjściowe są też obiektem poleceń (patrz Dane wyjściowe w tabeli /osc/commands/execute
).
Błąd
Kod błędu |
Opis |
missingParameter |
Element id nie został określony. Ten parametr wymaga identyfikatora polecenia zwróconego przez poprzednie wywołanie funkcji /osc/commands/execute . |
invalidParameterName |
Nie rozpoznano parametru wejściowego. |
invalidParameterValue |
Parametr wejściowy jest rozpoznawany, ale jego wartość jest nieprawidłowa. np. wartość id nie istnieje lub jej typ jest nieprawidłowy. |
Przykład |
Wyślij prośbę |
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" } |
Odpowiedź |
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" } } |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-08-21 UTC.
[null,null,["Ostatnia aktualizacja: 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"]]