openxc / openxc-message-format

Specification for the OpenXC JSON message format
http://openxcplatform.com/
BSD 3-Clause "New" or "Revised" License
99 stars 35 forks source link

OpenXC Message Format Specification

Version: v0.8.0

This specification is a part of the OpenXC platform.

An OpenXC vehicle interface sends generic vehicle data over one or more output interfaces (e.g. USB or Bluetooth) as JSON or Protocol Buffers (protobuf).

JSON

The JSON format is the most flexible and easiest to use. The format is fully specified in the JSON.mkd file in this repository. a more flexible option than binary, but is less compact and therefore takes more bandwidth and processing power.

The JSON format is best for most developers, as it is fairly efficient and very flexible.

Binary (Protocol Buffers)

The binary format is encoded using Google Protocol Buffers. The format is specified in the file openxc.proto. The descriptions of the messages can be foud in the JSON specs - the binary format mirrors this.

The binary messages are published by the VI using the standard length-delimited method (any protobuf library should support this).

The binary format is best if you need to maximize the amount of data that can be sent from the VI, trading off flexibility for efficiency.

Trace File Format

An OpenXC vehicle trace file is a plaintext file that contains JSON objects, separated by newlines (which may be either \r\n or \n, depending on the platform the trace file was recorded).

The first line may be a metadata object, although this is optional:

{"metadata": {
    "version": "v3.0",
    "vehicle_interface_id": "7ABF",
    "vehicle": {
        "make": "Ford",
        "model": "Mustang",
        "trim": "V6 Premium",
        "year": 2013
    },
    "description": "highway drive to work",
    "driver_name": "TJ Giuli",
    "vehicle_id": "17N1039247929"
}

The following lines are OpenXC messages with a timestamp field added, e.g.:

{"timestamp": 1385133351.285525, "name": "steering_wheel_angle", "value": 45}

The timestamp is in UNIX time (i.e. seconds since the UNIX epoch, 00:00:00 UTC, 1/1/1970).

Official Signals

These signal names are a part of the OpenXC specification, although some manufacturers may support custom message names.

Note: When compiling for platforms using Bluetooth LE, all signals below will have frequencies of 0.5 Hz due to bandwidth limitations.

Signals from Diagnostic Messages

This set of signals is often retreived from OBD-II requests. The units can be found in the OBD-II standard.

License

Copyright (c) 2012-2021 Ford Motor Company

Licensed under the BSD license.