Skip to content

Commit 15cd698

Browse files
committed
Merge pull request #28 from openxc/next
Ready to release updates for C5 devices
2 parents 77718cf + 94c09b2 commit 15cd698

File tree

10 files changed

+856
-204
lines changed

10 files changed

+856
-204
lines changed

.gitmodules

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[submodule "libs/nanopb"]
22
path = libs/nanopb
3-
url = https://code.google.com/p/nanopb/
4-
ignore = dirty
3+
url = https://github.com/nanopb/nanopb

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# OpenXC Message Format Changelog
22

3+
## v0.6.0
4+
5+
* Feature: Added MessagePack support for BTLE connections.
6+
* Feature: Support for vehicle message timestamps (changed previous uptime).
7+
* Feature: Support for C5 SD Card.
8+
* Feature: Support for C5 RTC.
9+
* Fix: Update submodule from code.google to github.
10+
311
## v0.5.0
412

513
* Feature: Support for C5 Cellular device. New uptime message.

JSON.mkd

Lines changed: 55 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,16 @@
22

33
Each JSON message published by a VI is delimited with a `\0 ` character.
44

5-
## Extra Values
5+
## Table of Contents
6+
1. [Vehicle Messages](#vehicle-messages)
7+
2. [CAN Message](#can-message)
8+
3. [Diagnostic Message](#diagnostic-message)
9+
4. [Commands](#commands)
10+
5. [Extra Values](#extra-values)
611

7-
Any of the following JSON objects may optionally include an `extras`
8-
field. The value may be any valid JSON object or array. The client libraries
9-
will do their best to parse this information into a generic format and pass it
10-
to your application. For example:
12+
## Vehicle Messages
1113

12-
{"name": "steering_wheel_angle",
13-
"value": 45,
14-
"extras": {
15-
"calibrated": false
16-
}
17-
}
18-
19-
## Simple Vehicle Message
14+
### Simple Vehicle Message
2015

2116
There may not be a 1:1 relationship between input and output signals - i.e.
2217
engine timing CAN signals may be summarized in an "engine performance" metric on
@@ -26,7 +21,7 @@ The expected format of a single valued message is:
2621

2722
{"name": "steering_wheel_angle", "value": 45}
2823

29-
## Evented Simple Vehicle Message
24+
### Evented Simple Vehicle Message
3025

3126
The expected format of an event message is:
3227

@@ -57,7 +52,7 @@ The format for a plain CAN message:
5752
of `standard` or `extended`. If the `id` is greater than `0x7ff`, the extended
5853
frame format will be selected automatically.
5954

60-
## Diagnostic Messages
55+
## Diagnostic Message
6156

6257
### Requests
6358

@@ -377,7 +372,7 @@ the response will be `true`.
377372

378373
The ModemConfigurationCommand message allows users to change certain aspects of modem operation on-the-fly (at runtime). The modem configuration settings are stored in flash memory and are untouched by the bootloader during a software update (assuming the correct cellular_c5 linker file is used during compilation of vi-firmware). Thus, new modem settings persistent across power cycles.
379374

380-
The ModemConfigurationCommand message provides three sub-messages for particular groups of modem settings. These are NetworkOperatorSettings, NetworkDataSettings, and ServerConnectSettings. These configuration messages are described in great detail within the [c5_cellular_config](https://github.com/openxc/vi-firmware/docs/advanced/c5_cell_config.mkd) documentation.
375+
The ModemConfigurationCommand message provides three sub-messages for particular groups of modem settings. These are NetworkOperatorSettings, NetworkDataSettings, and ServerConnectSettings. These configuration messages are described in great detail within the [c5_cellular_config](https://github.com/openxc/vi-firmware/docs/advanced/c5_cell_config.html) documentation.
381376

382377
Currently, only the ServerConnectSettings sub-message is supported in the vi-firmware's command interpreter. All other settings are currently compile-time only.
383378

@@ -394,4 +389,47 @@ The ServerConnectSettings part of ModemConfigurationCommand allows the user to s
394389

395390
**Response**
396391

397-
{ "command_response": "modem_configuration", "status": true}
392+
{ "command_response": "modem_configuration", "status": true}
393+
394+
## C5 SD Card Status
395+
396+
In order to check the status of the SD card, the following command is available:
397+
398+
{ "command": "sd_mount_status"}
399+
400+
Command response if the SD card is mounted correctly:
401+
402+
{ "command_response": "sd_mount_status", "status": true}
403+
404+
If the SD card is full, not enabled, or connected as a MSD, the device will respond with:
405+
406+
{ "command_response": "sd_mount_status", "status": false}
407+
408+
For more info see [c5_msd](https://github.com/openxc/vi-firmware/docs/advanced/msd.html).
409+
410+
## C5 RTC Configuration
411+
412+
To set the current time of the RTC, the following
413+
414+
{ "command": "rtc_configuration", "unix_time": "1448551563"}
415+
416+
The response is
417+
418+
{ "command_response": "rtc_configuration", "status": true}
419+
420+
For more info see [c5_rtc](https://github.com/openxc/vi-firmware/docs/advanced/rtc.html).
421+
422+
## Extra Values
423+
424+
Any of the following JSON objects may optionally include an `extras`
425+
field. The value may be any valid JSON object or array. The client libraries
426+
will do their best to parse this information into a generic format and pass it
427+
to your application. For example:
428+
429+
{"name": "steering_wheel_angle",
430+
"value": 45,
431+
"extras": {
432+
"calibrated": false
433+
}
434+
}
435+

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OpenXC Message Format Specification
22

3-
Version: v0.5.0
3+
Version: v0.6.0
44

55
This specification is a part of the [OpenXC platform][OpenXC].
66

@@ -30,6 +30,21 @@ method (any protobuf library should support this).
3030
The binary format is best if you need to maximize the amount of data that can be
3131
sent from the VI, trading off flexibility for efficiency.
3232

33+
## Message Pack
34+
MessagePack is an efficient binary serialization format. It lets you exchange data
35+
among multiple languages like JSON, but it's faster and smaller. Small integers are
36+
encoded into a single byte, and typical short strings require only one extra byte
37+
in addition to the strings themselves
38+
39+
For protocol specification visit:
40+
https://github.com/msgpack/msgpack/blob/master/spec.md
41+
42+
We are using the following lib:
43+
https://github.com/camgunz/cmp
44+
45+
MessagePack provides a binary alternative to ProtoBuf. There are pros & cons to each
46+
so you can decide what works best for your project.
47+
3348
## Trace File Format
3449

3550
An OpenXC vehicle trace file is a plaintext file that contains JSON objects,

gen/cpp/openxc.pb

179 Bytes
Binary file not shown.

gen/cpp/openxc.pb.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Automatically generated nanopb constant definitions */
2-
/* Generated by nanopb-0.3.1 at Tue Dec 2 03:06:57 2014. */
2+
/* Generated by nanopb-0.3.1 at Mon Feb 29 19:42:01 2016. */
33

44
#include "openxc.pb.h"
55

@@ -16,7 +16,7 @@ const pb_field_t openxc_VehicleMessage_fields[8] = {
1616
PB_FIELD( 4, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_VehicleMessage, diagnostic_response, simple_message, &openxc_DiagnosticResponse_fields),
1717
PB_FIELD( 5, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_VehicleMessage, control_command, diagnostic_response, &openxc_ControlCommand_fields),
1818
PB_FIELD( 6, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_VehicleMessage, command_response, control_command, &openxc_CommandResponse_fields),
19-
PB_FIELD( 7, UINT32 , OPTIONAL, STATIC , OTHER, openxc_VehicleMessage, uptime, command_response, 0),
19+
PB_FIELD( 7, UINT64 , OPTIONAL, STATIC , OTHER, openxc_VehicleMessage, timestamp, command_response, 0),
2020
PB_LAST_FIELD
2121
};
2222

@@ -28,14 +28,15 @@ const pb_field_t openxc_CanMessage_fields[5] = {
2828
PB_LAST_FIELD
2929
};
3030

31-
const pb_field_t openxc_ControlCommand_fields[8] = {
31+
const pb_field_t openxc_ControlCommand_fields[9] = {
3232
PB_FIELD( 1, ENUM , OPTIONAL, STATIC , FIRST, openxc_ControlCommand, type, type, 0),
3333
PB_FIELD( 2, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_ControlCommand, diagnostic_request, type, &openxc_DiagnosticControlCommand_fields),
3434
PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_ControlCommand, passthrough_mode_request, diagnostic_request, &openxc_PassthroughModeControlCommand_fields),
3535
PB_FIELD( 4, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_ControlCommand, acceptance_filter_bypass_command, passthrough_mode_request, &openxc_AcceptanceFilterBypassCommand_fields),
3636
PB_FIELD( 5, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_ControlCommand, payload_format_command, acceptance_filter_bypass_command, &openxc_PayloadFormatCommand_fields),
3737
PB_FIELD( 6, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_ControlCommand, predefined_obd2_requests_command, payload_format_command, &openxc_PredefinedObd2RequestsCommand_fields),
3838
PB_FIELD( 7, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_ControlCommand, modem_configuration_command, predefined_obd2_requests_command, &openxc_ModemConfigurationCommand_fields),
39+
PB_FIELD( 8, MESSAGE , OPTIONAL, STATIC , OTHER, openxc_ControlCommand, rtc_configuration_command, modem_configuration_command, &openxc_RTCConfigurationCommand_fields),
3940
PB_LAST_FIELD
4041
};
4142

@@ -98,6 +99,11 @@ const pb_field_t openxc_ModemConfigurationCommand_fields[4] = {
9899
PB_LAST_FIELD
99100
};
100101

102+
const pb_field_t openxc_RTCConfigurationCommand_fields[2] = {
103+
PB_FIELD( 1, UINT32 , OPTIONAL, STATIC , FIRST, openxc_RTCConfigurationCommand, unix_time, unix_time, 0),
104+
PB_LAST_FIELD
105+
};
106+
101107
const pb_field_t openxc_CommandResponse_fields[4] = {
102108
PB_FIELD( 1, ENUM , OPTIONAL, STATIC , FIRST, openxc_CommandResponse, type, type, 0),
103109
PB_FIELD( 2, STRING , OPTIONAL, STATIC , OTHER, openxc_CommandResponse, message, type, 0),
@@ -155,7 +161,7 @@ const pb_field_t openxc_SimpleMessage_fields[4] = {
155161
* numbers or field sizes that are larger than what can fit in 8 or 16 bit
156162
* field descriptors.
157163
*/
158-
PB_STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, can_message) < 65536 && pb_membersize(openxc_VehicleMessage, simple_message) < 65536 && pb_membersize(openxc_VehicleMessage, diagnostic_response) < 65536 && pb_membersize(openxc_VehicleMessage, control_command) < 65536 && pb_membersize(openxc_VehicleMessage, command_response) < 65536 && pb_membersize(openxc_ControlCommand, diagnostic_request) < 65536 && pb_membersize(openxc_ControlCommand, passthrough_mode_request) < 65536 && pb_membersize(openxc_ControlCommand, acceptance_filter_bypass_command) < 65536 && pb_membersize(openxc_ControlCommand, payload_format_command) < 65536 && pb_membersize(openxc_ControlCommand, predefined_obd2_requests_command) < 65536 && pb_membersize(openxc_ControlCommand, modem_configuration_command) < 65536 && pb_membersize(openxc_DiagnosticControlCommand, request) < 65536 && pb_membersize(openxc_NetworkOperatorSettings, networkDescriptor) < 65536 && pb_membersize(openxc_ModemConfigurationCommand, networkOperatorSettings) < 65536 && pb_membersize(openxc_ModemConfigurationCommand, networkDataSettings) < 65536 && pb_membersize(openxc_ModemConfigurationCommand, serverConnectSettings) < 65536 && pb_membersize(openxc_SimpleMessage, value) < 65536 && pb_membersize(openxc_SimpleMessage, event) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_openxc_VehicleMessage_openxc_CanMessage_openxc_ControlCommand_openxc_DiagnosticControlCommand_openxc_PassthroughModeControlCommand_openxc_AcceptanceFilterBypassCommand_openxc_PayloadFormatCommand_openxc_PredefinedObd2RequestsCommand_openxc_NetworkOperatorSettings_openxc_NetworkOperatorSettings_NetworkDescriptor_openxc_NetworkDataSettings_openxc_ServerConnectSettings_openxc_ModemConfigurationCommand_openxc_CommandResponse_openxc_DiagnosticRequest_openxc_DiagnosticResponse_openxc_DynamicField_openxc_SimpleMessage)
164+
PB_STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, can_message) < 65536 && pb_membersize(openxc_VehicleMessage, simple_message) < 65536 && pb_membersize(openxc_VehicleMessage, diagnostic_response) < 65536 && pb_membersize(openxc_VehicleMessage, control_command) < 65536 && pb_membersize(openxc_VehicleMessage, command_response) < 65536 && pb_membersize(openxc_ControlCommand, diagnostic_request) < 65536 && pb_membersize(openxc_ControlCommand, passthrough_mode_request) < 65536 && pb_membersize(openxc_ControlCommand, acceptance_filter_bypass_command) < 65536 && pb_membersize(openxc_ControlCommand, payload_format_command) < 65536 && pb_membersize(openxc_ControlCommand, predefined_obd2_requests_command) < 65536 && pb_membersize(openxc_ControlCommand, modem_configuration_command) < 65536 && pb_membersize(openxc_ControlCommand, rtc_configuration_command) < 65536 && pb_membersize(openxc_DiagnosticControlCommand, request) < 65536 && pb_membersize(openxc_NetworkOperatorSettings, networkDescriptor) < 65536 && pb_membersize(openxc_ModemConfigurationCommand, networkOperatorSettings) < 65536 && pb_membersize(openxc_ModemConfigurationCommand, networkDataSettings) < 65536 && pb_membersize(openxc_ModemConfigurationCommand, serverConnectSettings) < 65536 && pb_membersize(openxc_SimpleMessage, value) < 65536 && pb_membersize(openxc_SimpleMessage, event) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_openxc_VehicleMessage_openxc_CanMessage_openxc_ControlCommand_openxc_DiagnosticControlCommand_openxc_PassthroughModeControlCommand_openxc_AcceptanceFilterBypassCommand_openxc_PayloadFormatCommand_openxc_PredefinedObd2RequestsCommand_openxc_NetworkOperatorSettings_openxc_NetworkOperatorSettings_NetworkDescriptor_openxc_NetworkDataSettings_openxc_ServerConnectSettings_openxc_ModemConfigurationCommand_openxc_RTCConfigurationCommand_openxc_CommandResponse_openxc_DiagnosticRequest_openxc_DiagnosticResponse_openxc_DynamicField_openxc_SimpleMessage)
159165
#endif
160166

161167
#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
@@ -166,7 +172,7 @@ PB_STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, can_message) < 65536 && p
166172
* numbers or field sizes that are larger than what can fit in the default
167173
* 8 bit descriptors.
168174
*/
169-
PB_STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, can_message) < 256 && pb_membersize(openxc_VehicleMessage, simple_message) < 256 && pb_membersize(openxc_VehicleMessage, diagnostic_response) < 256 && pb_membersize(openxc_VehicleMessage, control_command) < 256 && pb_membersize(openxc_VehicleMessage, command_response) < 256 && pb_membersize(openxc_ControlCommand, diagnostic_request) < 256 && pb_membersize(openxc_ControlCommand, passthrough_mode_request) < 256 && pb_membersize(openxc_ControlCommand, acceptance_filter_bypass_command) < 256 && pb_membersize(openxc_ControlCommand, payload_format_command) < 256 && pb_membersize(openxc_ControlCommand, predefined_obd2_requests_command) < 256 && pb_membersize(openxc_ControlCommand, modem_configuration_command) < 256 && pb_membersize(openxc_DiagnosticControlCommand, request) < 256 && pb_membersize(openxc_NetworkOperatorSettings, networkDescriptor) < 256 && pb_membersize(openxc_ModemConfigurationCommand, networkOperatorSettings) < 256 && pb_membersize(openxc_ModemConfigurationCommand, networkDataSettings) < 256 && pb_membersize(openxc_ModemConfigurationCommand, serverConnectSettings) < 256 && pb_membersize(openxc_SimpleMessage, value) < 256 && pb_membersize(openxc_SimpleMessage, event) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_openxc_VehicleMessage_openxc_CanMessage_openxc_ControlCommand_openxc_DiagnosticControlCommand_openxc_PassthroughModeControlCommand_openxc_AcceptanceFilterBypassCommand_openxc_PayloadFormatCommand_openxc_PredefinedObd2RequestsCommand_openxc_NetworkOperatorSettings_openxc_NetworkOperatorSettings_NetworkDescriptor_openxc_NetworkDataSettings_openxc_ServerConnectSettings_openxc_ModemConfigurationCommand_openxc_CommandResponse_openxc_DiagnosticRequest_openxc_DiagnosticResponse_openxc_DynamicField_openxc_SimpleMessage)
175+
PB_STATIC_ASSERT((pb_membersize(openxc_VehicleMessage, can_message) < 256 && pb_membersize(openxc_VehicleMessage, simple_message) < 256 && pb_membersize(openxc_VehicleMessage, diagnostic_response) < 256 && pb_membersize(openxc_VehicleMessage, control_command) < 256 && pb_membersize(openxc_VehicleMessage, command_response) < 256 && pb_membersize(openxc_ControlCommand, diagnostic_request) < 256 && pb_membersize(openxc_ControlCommand, passthrough_mode_request) < 256 && pb_membersize(openxc_ControlCommand, acceptance_filter_bypass_command) < 256 && pb_membersize(openxc_ControlCommand, payload_format_command) < 256 && pb_membersize(openxc_ControlCommand, predefined_obd2_requests_command) < 256 && pb_membersize(openxc_ControlCommand, modem_configuration_command) < 256 && pb_membersize(openxc_ControlCommand, rtc_configuration_command) < 256 && pb_membersize(openxc_DiagnosticControlCommand, request) < 256 && pb_membersize(openxc_NetworkOperatorSettings, networkDescriptor) < 256 && pb_membersize(openxc_ModemConfigurationCommand, networkOperatorSettings) < 256 && pb_membersize(openxc_ModemConfigurationCommand, networkDataSettings) < 256 && pb_membersize(openxc_ModemConfigurationCommand, serverConnectSettings) < 256 && pb_membersize(openxc_SimpleMessage, value) < 256 && pb_membersize(openxc_SimpleMessage, event) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_openxc_VehicleMessage_openxc_CanMessage_openxc_ControlCommand_openxc_DiagnosticControlCommand_openxc_PassthroughModeControlCommand_openxc_AcceptanceFilterBypassCommand_openxc_PayloadFormatCommand_openxc_PredefinedObd2RequestsCommand_openxc_NetworkOperatorSettings_openxc_NetworkOperatorSettings_NetworkDescriptor_openxc_NetworkDataSettings_openxc_ServerConnectSettings_openxc_ModemConfigurationCommand_openxc_RTCConfigurationCommand_openxc_CommandResponse_openxc_DiagnosticRequest_openxc_DiagnosticResponse_openxc_DynamicField_openxc_SimpleMessage)
170176
#endif
171177

172178

0 commit comments

Comments
 (0)