X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=README.md;h=0fe4b8df30bcf4d83d1047b3b7943d025d948aa0;hb=fd65f19af900c2462fc337dcdc1c61ff3a4d3452;hp=dcfee28176c91e066cbf410615eed378d7c987e6;hpb=6642105e16f6b52e51f08c376fbc349634588193;p=apps%2Fagl-service-can-low-level.git diff --git a/README.md b/README.md index dcfee281..0fe4b8df 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,9 @@ is sent as a JSON object, separated by newlines. The format of each object is: **data** - up to 8 bytes of data from the CAN message's payload, represented as a hexidecimal number in a string. Many JSON parser cannot handle 64-bit - integers, which is why we are not using a numerical data type. + integers, which is why we are not using a numerical data type. Each byte in + the string *must* be represented with 2 characters, e.g. `0x1` is `0x01` - the + complete string must have an even number of characters. ## Diagnostic Messages @@ -79,6 +81,8 @@ with this command format: **payload** - (optional) up to 7 bytes of data for the request's payload represented as a hexidecimal number in a string. Many JSON parser cannot handle 64-bit integers, which is why we are not using a numerical data type. + Each byte in the string *must* be represented with 2 characters, e.g. `0x1` + is `0x01` - the complete string must have an even number of characters. **parse_payload** - (optional, false by default) if true, the complete payload in the response message will be parsed as a number and returned in the 'value' field of @@ -114,9 +118,6 @@ key twice, it'll overwrite the existing one (i.e. it will change the frequency, the only other parameter). To cancel a recurring request, send this command with the frequency set to 0. -TODO it'd be nice to have the OBD-II PIDs built in, with the proper conversion -functions - that may need a different output format - If you're just requesting a PID, you can use this minimal field set for the `request` object: @@ -164,9 +165,33 @@ The response to a simple PID request would look like this: {"bus": 1, "id": 1234, "mode": 1, "pid": 5, "payload": "0x2"} -TODO again, it'd be nice to have the OBD-II PIDs built in, with the proper -conversion functions so the response here included the actual transformed value -of the pid and a human readable name +## Commands + +### Version Query + +The `version` command triggers the VI to inject a firmware version identifier +response into the outgoing data stream. + +**Request** + + { "command": "version"} + +**Response** + + { "command_response": "version", "message": "v6.0-dev (default)"} + +### Device ID Query + +The `device_id` command triggers the VI to inject a unique device ID (e.g. the +MAC address of an included Bluetooth module) into into the outgoing data stream. + +**Request** + + { "command": "device_id"} + +**Response** + + { "command_response": "device_id", "message": "0012345678"} ## Trace File Format