From e47f58b38d86e6aefd1b8f2fba2fc9dba3eae702 Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Mon, 6 Oct 2014 23:14:03 -0400 Subject: Mention 'status' field in all command response JSON examples. Fixed #13. --- JSON.mkd | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/JSON.mkd b/JSON.mkd index 7bf0ce5a..71546bc9 100644 --- a/JSON.mkd +++ b/JSON.mkd @@ -179,7 +179,16 @@ manually override the OBD-II decoding feature for a known PID. ### Responses -The response to a successful request: +Requests to add or cancel a diagnostic request are first acknowledged by the VI, +before any responses to the request are returned. The response uses the standard +command response format: + + { "command_response": "diagnostic_request", "status": true} + +**status** - true if the request was successfully created or cancelled. + +When a node on the network response to the request and the result is published +by the VI, the result looks like: {"bus": 1, "id": 1234, @@ -233,6 +242,17 @@ The response to a simple PID request would look like this: In addition to the `diagnostic_request` command described earlier, there are other possible values for the `command` field. +All commands immediately return a `command_response`, e.g.: + + { "command_response": "version", "message": "v6.0-dev (default)", "status": true} + +**command_response** - an echo of the command this is a ACKing. + +**status** - true if the command was understood and performed succesfully. + +**message** - (optional) a string message from the VI, e.g. to return a version + descriptor or error message. + ### Version Query The `version` command triggers the VI to inject a firmware version identifier @@ -244,7 +264,7 @@ response into the outgoing data stream. **Response** - { "command_response": "version", "message": "v6.0-dev (default)"} + { "command_response": "version", "message": "v6.0-dev (default)", "status": true} ### Device ID Query @@ -257,7 +277,7 @@ MAC address of an included Bluetooth module) into into the outgoing data stream. **Response** - { "command_response": "device_id", "message": "0012345678"} + { "command_response": "device_id", "message": "0012345678", "status": true} ### Passthrough CAN Mode -- cgit 1.2.3-korg