Stato
L'API /osc/commands/status
restituisce lo stato dei comandi inProgress
precedenti. L'API status
è utile per eseguire il polling dell'avanzamento di un comando emesso in precedenza. ad esempio per determinare se camera.takePicture
è stato completato.
Nome |
Tipo |
Descrizione |
id |
Stringa |
ID comando restituito da una chiamata precedente a
/osc/commands/execute . |
Output
L'output è anche un oggetto comando (vedi Output di /osc/commands/execute
)
Errore
Codice di errore |
Descrizione |
missingParameter |
id non specificato. Questo parametro richiede un ID comando restituito da una precedente chiamata a /osc/commands/execute . |
invalidParameterName |
Parametro di input non riconosciuto. |
invalidParameterValue |
Il parametro di input è stato riconosciuto, ma il suo valore non è valido. ad esempio, il valore id non esiste o il suo tipo non è corretto. |
Esempio |
Richiedi |
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" } |
Risposta |
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" } } |
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2024-08-21 UTC.
[null,null,["Ultimo aggiornamento 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"]]