Skip to content

Commit 34979aa

Browse files
authored
Merge pull request #50 from openxc/next
Next
2 parents c04cb13 + 9c08a7b commit 34979aa

File tree

9 files changed

+174
-120
lines changed

9 files changed

+174
-120
lines changed

CHANGELOG.md

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

3+
## v0.8.0
4+
5+
* Feature: Support for GET_VIN command
6+
* Improvements: Diagnostic Request structure enhanced to handle stitch frames
7+
* Removed: MessagePack encoding removed
8+
39
## v0.7.0-dev
410

511
* Improvement: Increase diagnostic response payload size to accommodate

README.md

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

3-
Version: v0.7.0-dev
3+
Version: v0.8.0
44

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

@@ -30,21 +30,6 @@ 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-
4833
## Trace File Format
4934

5035
An OpenXC vehicle trace file is a plaintext file that contains JSON objects,
@@ -176,7 +161,7 @@ found in the [OBD-II standard](http://en.wikipedia.org/wiki/OBD-II_PIDs#Mode_01)
176161
License
177162
=======
178163

179-
Copyright (c) 2012-2014 Ford Motor Company
164+
Copyright (c) 2012-2021 Ford Motor Company
180165

181166
Licensed under the BSD license.
182167

gen/cpp/openxc.pb

-389 Bytes
Binary file not shown.

gen/cpp/openxc.pb.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ PB_BIND(openxc_DiagnosticRequest, openxc_DiagnosticRequest, AUTO)
5959
PB_BIND(openxc_DiagnosticResponse, openxc_DiagnosticResponse, 2)
6060

6161

62-
PB_BIND(openxc_DiagnosticStitchResponse, openxc_DiagnosticStitchResponse, AUTO)
63-
64-
6562
PB_BIND(openxc_DynamicField, openxc_DynamicField, AUTO)
6663

6764

gen/cpp/openxc.pb.h

Lines changed: 25 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ typedef enum _openxc_VehicleMessage_Type {
2121
openxc_VehicleMessage_Type_SIMPLE = 2,
2222
openxc_VehicleMessage_Type_DIAGNOSTIC = 3,
2323
openxc_VehicleMessage_Type_CONTROL_COMMAND = 4,
24-
openxc_VehicleMessage_Type_COMMAND_RESPONSE = 5,
25-
openxc_VehicleMessage_Type_DIAGNOSTIC_STITCH = 6
24+
openxc_VehicleMessage_Type_COMMAND_RESPONSE = 5
2625
} openxc_VehicleMessage_Type;
2726
#define _openxc_VehicleMessage_Type_MIN openxc_VehicleMessage_Type_UNUSED
28-
#define _openxc_VehicleMessage_Type_MAX openxc_VehicleMessage_Type_DIAGNOSTIC_STITCH
29-
#define _openxc_VehicleMessage_Type_ARRAYSIZE ((openxc_VehicleMessage_Type)(openxc_VehicleMessage_Type_DIAGNOSTIC_STITCH+1))
27+
#define _openxc_VehicleMessage_Type_MAX openxc_VehicleMessage_Type_COMMAND_RESPONSE
28+
#define _openxc_VehicleMessage_Type_ARRAYSIZE ((openxc_VehicleMessage_Type)(openxc_VehicleMessage_Type_COMMAND_RESPONSE+1))
3029

3130
typedef enum _openxc_CanMessage_FrameFormat {
3231
openxc_CanMessage_FrameFormat_UNUSED = 0,
@@ -49,11 +48,12 @@ typedef enum _openxc_ControlCommand_Type {
4948
openxc_ControlCommand_Type_MODEM_CONFIGURATION = 8,
5049
openxc_ControlCommand_Type_RTC_CONFIGURATION = 9,
5150
openxc_ControlCommand_Type_SD_MOUNT_STATUS = 10,
52-
openxc_ControlCommand_Type_PLATFORM = 11
51+
openxc_ControlCommand_Type_PLATFORM = 11,
52+
openxc_ControlCommand_Type_GET_VIN = 12
5353
} openxc_ControlCommand_Type;
5454
#define _openxc_ControlCommand_Type_MIN openxc_ControlCommand_Type_UNUSED
55-
#define _openxc_ControlCommand_Type_MAX openxc_ControlCommand_Type_PLATFORM
56-
#define _openxc_ControlCommand_Type_ARRAYSIZE ((openxc_ControlCommand_Type)(openxc_ControlCommand_Type_PLATFORM+1))
55+
#define _openxc_ControlCommand_Type_MAX openxc_ControlCommand_Type_GET_VIN
56+
#define _openxc_ControlCommand_Type_ARRAYSIZE ((openxc_ControlCommand_Type)(openxc_ControlCommand_Type_GET_VIN+1))
5757

5858
typedef enum _openxc_DiagnosticControlCommand_Action {
5959
openxc_DiagnosticControlCommand_Action_UNUSED = 0,
@@ -67,12 +67,11 @@ typedef enum _openxc_DiagnosticControlCommand_Action {
6767
typedef enum _openxc_PayloadFormatCommand_PayloadFormat {
6868
openxc_PayloadFormatCommand_PayloadFormat_UNUSED = 0,
6969
openxc_PayloadFormatCommand_PayloadFormat_JSON = 1,
70-
openxc_PayloadFormatCommand_PayloadFormat_PROTOBUF = 2,
71-
openxc_PayloadFormatCommand_PayloadFormat_MESSAGEPACK = 3
70+
openxc_PayloadFormatCommand_PayloadFormat_PROTOBUF = 2
7271
} openxc_PayloadFormatCommand_PayloadFormat;
7372
#define _openxc_PayloadFormatCommand_PayloadFormat_MIN openxc_PayloadFormatCommand_PayloadFormat_UNUSED
74-
#define _openxc_PayloadFormatCommand_PayloadFormat_MAX openxc_PayloadFormatCommand_PayloadFormat_MESSAGEPACK
75-
#define _openxc_PayloadFormatCommand_PayloadFormat_ARRAYSIZE ((openxc_PayloadFormatCommand_PayloadFormat)(openxc_PayloadFormatCommand_PayloadFormat_MESSAGEPACK+1))
73+
#define _openxc_PayloadFormatCommand_PayloadFormat_MAX openxc_PayloadFormatCommand_PayloadFormat_PROTOBUF
74+
#define _openxc_PayloadFormatCommand_PayloadFormat_ARRAYSIZE ((openxc_PayloadFormatCommand_PayloadFormat)(openxc_PayloadFormatCommand_PayloadFormat_PROTOBUF+1))
7675

7776
typedef enum _openxc_NetworkOperatorSettings_OperatorSelectMode {
7877
openxc_NetworkOperatorSettings_OperatorSelectMode_AUTOMATIC = 0,
@@ -224,24 +223,10 @@ typedef struct _openxc_DiagnosticResponse {
224223
uint32_t negative_response_code;
225224
openxc_DiagnosticResponse_payload_t payload;
226225
openxc_DynamicField value;
227-
/* @@protoc_insertion_point(struct:openxc_DiagnosticResponse) */
228-
} openxc_DiagnosticResponse;
229-
230-
231-
typedef PB_BYTES_ARRAY_T(14) openxc_DiagnosticStitchResponse_payload_t;
232-
typedef struct _openxc_DiagnosticStitchResponse {
233-
int32_t bus;
234-
uint32_t message_id;
235-
uint32_t mode;
236-
uint32_t pid;
237-
bool success;
238-
uint32_t negative_response_code;
239-
openxc_DiagnosticStitchResponse_payload_t payload;
240-
openxc_DynamicField value;
241226
int32_t frame;
242227
uint32_t total_size;
243-
/* @@protoc_insertion_point(struct:openxc_DiagnosticStitchResponse) */
244-
} openxc_DiagnosticStitchResponse;
228+
/* @@protoc_insertion_point(struct:openxc_DiagnosticResponse) */
229+
} openxc_DiagnosticResponse;
245230

246231

247232
typedef struct _openxc_NetworkOperatorSettings {
@@ -288,14 +273,13 @@ typedef struct _openxc_VehicleMessage {
288273
openxc_DiagnosticResponse diagnostic_response;
289274
openxc_ControlCommand control_command;
290275
openxc_CommandResponse command_response;
291-
openxc_DiagnosticStitchResponse diagnostic_stitch_response;
292276
uint64_t timestamp;
293277
/* @@protoc_insertion_point(struct:openxc_VehicleMessage) */
294278
} openxc_VehicleMessage;
295279

296280

297281
/* Initializer values for message structs */
298-
#define openxc_VehicleMessage_init_default {_openxc_VehicleMessage_Type_MIN, openxc_CanMessage_init_default, openxc_SimpleMessage_init_default, openxc_DiagnosticResponse_init_default, openxc_ControlCommand_init_default, openxc_CommandResponse_init_default, openxc_DiagnosticStitchResponse_init_default, 0}
282+
#define openxc_VehicleMessage_init_default {_openxc_VehicleMessage_Type_MIN, openxc_CanMessage_init_default, openxc_SimpleMessage_init_default, openxc_DiagnosticResponse_init_default, openxc_ControlCommand_init_default, openxc_CommandResponse_init_default, 0}
299283
#define openxc_CanMessage_init_default {0, 0, {0, {0}}, _openxc_CanMessage_FrameFormat_MIN}
300284
#define openxc_ControlCommand_init_default {_openxc_ControlCommand_Type_MIN, openxc_DiagnosticControlCommand_init_default, openxc_PassthroughModeControlCommand_init_default, openxc_AcceptanceFilterBypassCommand_init_default, openxc_PayloadFormatCommand_init_default, openxc_PredefinedObd2RequestsCommand_init_default, openxc_ModemConfigurationCommand_init_default, openxc_RTCConfigurationCommand_init_default}
301285
#define openxc_DiagnosticControlCommand_init_default {openxc_DiagnosticRequest_init_default, _openxc_DiagnosticControlCommand_Action_MIN}
@@ -311,11 +295,10 @@ typedef struct _openxc_VehicleMessage {
311295
#define openxc_RTCConfigurationCommand_init_default {0}
312296
#define openxc_CommandResponse_init_default {_openxc_ControlCommand_Type_MIN, "", 0}
313297
#define openxc_DiagnosticRequest_init_default {0, 0, 0, 0, {0, {0}}, 0, 0, "", _openxc_DiagnosticRequest_DecodedType_MIN}
314-
#define openxc_DiagnosticResponse_init_default {0, 0, 0, 0, 0, 0, {0, {0}}, openxc_DynamicField_init_default}
315-
#define openxc_DiagnosticStitchResponse_init_default {0, 0, 0, 0, 0, 0, {0, {0}}, openxc_DynamicField_init_default, 0, 0}
298+
#define openxc_DiagnosticResponse_init_default {0, 0, 0, 0, 0, 0, {0, {0}}, openxc_DynamicField_init_default, 0, 0}
316299
#define openxc_DynamicField_init_default {_openxc_DynamicField_Type_MIN, "", 0, 0}
317300
#define openxc_SimpleMessage_init_default {"", openxc_DynamicField_init_default, openxc_DynamicField_init_default}
318-
#define openxc_VehicleMessage_init_zero {_openxc_VehicleMessage_Type_MIN, openxc_CanMessage_init_zero, openxc_SimpleMessage_init_zero, openxc_DiagnosticResponse_init_zero, openxc_ControlCommand_init_zero, openxc_CommandResponse_init_zero, openxc_DiagnosticStitchResponse_init_zero, 0}
301+
#define openxc_VehicleMessage_init_zero {_openxc_VehicleMessage_Type_MIN, openxc_CanMessage_init_zero, openxc_SimpleMessage_init_zero, openxc_DiagnosticResponse_init_zero, openxc_ControlCommand_init_zero, openxc_CommandResponse_init_zero, 0}
319302
#define openxc_CanMessage_init_zero {0, 0, {0, {0}}, _openxc_CanMessage_FrameFormat_MIN}
320303
#define openxc_ControlCommand_init_zero {_openxc_ControlCommand_Type_MIN, openxc_DiagnosticControlCommand_init_zero, openxc_PassthroughModeControlCommand_init_zero, openxc_AcceptanceFilterBypassCommand_init_zero, openxc_PayloadFormatCommand_init_zero, openxc_PredefinedObd2RequestsCommand_init_zero, openxc_ModemConfigurationCommand_init_zero, openxc_RTCConfigurationCommand_init_zero}
321304
#define openxc_DiagnosticControlCommand_init_zero {openxc_DiagnosticRequest_init_zero, _openxc_DiagnosticControlCommand_Action_MIN}
@@ -331,8 +314,7 @@ typedef struct _openxc_VehicleMessage {
331314
#define openxc_RTCConfigurationCommand_init_zero {0}
332315
#define openxc_CommandResponse_init_zero {_openxc_ControlCommand_Type_MIN, "", 0}
333316
#define openxc_DiagnosticRequest_init_zero {0, 0, 0, 0, {0, {0}}, 0, 0, "", _openxc_DiagnosticRequest_DecodedType_MIN}
334-
#define openxc_DiagnosticResponse_init_zero {0, 0, 0, 0, 0, 0, {0, {0}}, openxc_DynamicField_init_zero}
335-
#define openxc_DiagnosticStitchResponse_init_zero {0, 0, 0, 0, 0, 0, {0, {0}}, openxc_DynamicField_init_zero, 0, 0}
317+
#define openxc_DiagnosticResponse_init_zero {0, 0, 0, 0, 0, 0, {0, {0}}, openxc_DynamicField_init_zero, 0, 0}
336318
#define openxc_DynamicField_init_zero {_openxc_DynamicField_Type_MIN, "", 0, 0}
337319
#define openxc_SimpleMessage_init_zero {"", openxc_DynamicField_init_zero, openxc_DynamicField_init_zero}
338320

@@ -379,16 +361,8 @@ typedef struct _openxc_VehicleMessage {
379361
#define openxc_DiagnosticResponse_negative_response_code_tag 6
380362
#define openxc_DiagnosticResponse_payload_tag 7
381363
#define openxc_DiagnosticResponse_value_tag 8
382-
#define openxc_DiagnosticStitchResponse_bus_tag 1
383-
#define openxc_DiagnosticStitchResponse_message_id_tag 2
384-
#define openxc_DiagnosticStitchResponse_mode_tag 3
385-
#define openxc_DiagnosticStitchResponse_pid_tag 4
386-
#define openxc_DiagnosticStitchResponse_success_tag 5
387-
#define openxc_DiagnosticStitchResponse_negative_response_code_tag 6
388-
#define openxc_DiagnosticStitchResponse_payload_tag 7
389-
#define openxc_DiagnosticStitchResponse_value_tag 8
390-
#define openxc_DiagnosticStitchResponse_frame_tag 9
391-
#define openxc_DiagnosticStitchResponse_total_size_tag 10
364+
#define openxc_DiagnosticResponse_frame_tag 9
365+
#define openxc_DiagnosticResponse_total_size_tag 10
392366
#define openxc_NetworkOperatorSettings_allowDataRoaming_tag 1
393367
#define openxc_NetworkOperatorSettings_operatorSelectMode_tag 2
394368
#define openxc_NetworkOperatorSettings_networkDescriptor_tag 3
@@ -412,8 +386,7 @@ typedef struct _openxc_VehicleMessage {
412386
#define openxc_VehicleMessage_diagnostic_response_tag 4
413387
#define openxc_VehicleMessage_control_command_tag 5
414388
#define openxc_VehicleMessage_command_response_tag 6
415-
#define openxc_VehicleMessage_diagnostic_stitch_response_tag 7
416-
#define openxc_VehicleMessage_timestamp_tag 8
389+
#define openxc_VehicleMessage_timestamp_tag 7
417390

418391
/* Struct field encoding specification for nanopb */
419392
#define openxc_VehicleMessage_FIELDLIST(X, a) \
@@ -423,16 +396,14 @@ X(a, STATIC, SINGULAR, MESSAGE, simple_message, 3) \
423396
X(a, STATIC, SINGULAR, MESSAGE, diagnostic_response, 4) \
424397
X(a, STATIC, SINGULAR, MESSAGE, control_command, 5) \
425398
X(a, STATIC, SINGULAR, MESSAGE, command_response, 6) \
426-
X(a, STATIC, SINGULAR, MESSAGE, diagnostic_stitch_response, 7) \
427-
X(a, STATIC, SINGULAR, UINT64, timestamp, 8)
399+
X(a, STATIC, SINGULAR, UINT64, timestamp, 7)
428400
#define openxc_VehicleMessage_CALLBACK NULL
429401
#define openxc_VehicleMessage_DEFAULT NULL
430402
#define openxc_VehicleMessage_can_message_MSGTYPE openxc_CanMessage
431403
#define openxc_VehicleMessage_simple_message_MSGTYPE openxc_SimpleMessage
432404
#define openxc_VehicleMessage_diagnostic_response_MSGTYPE openxc_DiagnosticResponse
433405
#define openxc_VehicleMessage_control_command_MSGTYPE openxc_ControlCommand
434406
#define openxc_VehicleMessage_command_response_MSGTYPE openxc_CommandResponse
435-
#define openxc_VehicleMessage_diagnostic_stitch_response_MSGTYPE openxc_DiagnosticStitchResponse
436407

437408
#define openxc_CanMessage_FIELDLIST(X, a) \
438409
X(a, STATIC, SINGULAR, INT32, bus, 1) \
@@ -558,25 +529,12 @@ X(a, STATIC, SINGULAR, UINT32, pid, 4) \
558529
X(a, STATIC, SINGULAR, BOOL, success, 5) \
559530
X(a, STATIC, SINGULAR, UINT32, negative_response_code, 6) \
560531
X(a, STATIC, SINGULAR, BYTES, payload, 7) \
561-
X(a, STATIC, SINGULAR, MESSAGE, value, 8)
562-
#define openxc_DiagnosticResponse_CALLBACK NULL
563-
#define openxc_DiagnosticResponse_DEFAULT NULL
564-
#define openxc_DiagnosticResponse_value_MSGTYPE openxc_DynamicField
565-
566-
#define openxc_DiagnosticStitchResponse_FIELDLIST(X, a) \
567-
X(a, STATIC, SINGULAR, INT32, bus, 1) \
568-
X(a, STATIC, SINGULAR, UINT32, message_id, 2) \
569-
X(a, STATIC, SINGULAR, UINT32, mode, 3) \
570-
X(a, STATIC, SINGULAR, UINT32, pid, 4) \
571-
X(a, STATIC, SINGULAR, BOOL, success, 5) \
572-
X(a, STATIC, SINGULAR, UINT32, negative_response_code, 6) \
573-
X(a, STATIC, SINGULAR, BYTES, payload, 7) \
574532
X(a, STATIC, SINGULAR, MESSAGE, value, 8) \
575533
X(a, STATIC, SINGULAR, INT32, frame, 9) \
576534
X(a, STATIC, SINGULAR, UINT32, total_size, 10)
577-
#define openxc_DiagnosticStitchResponse_CALLBACK NULL
578-
#define openxc_DiagnosticStitchResponse_DEFAULT NULL
579-
#define openxc_DiagnosticStitchResponse_value_MSGTYPE openxc_DynamicField
535+
#define openxc_DiagnosticResponse_CALLBACK NULL
536+
#define openxc_DiagnosticResponse_DEFAULT NULL
537+
#define openxc_DiagnosticResponse_value_MSGTYPE openxc_DynamicField
580538

581539
#define openxc_DynamicField_FIELDLIST(X, a) \
582540
X(a, STATIC, SINGULAR, UENUM, type, 1) \
@@ -612,7 +570,6 @@ extern const pb_msgdesc_t openxc_RTCConfigurationCommand_msg;
612570
extern const pb_msgdesc_t openxc_CommandResponse_msg;
613571
extern const pb_msgdesc_t openxc_DiagnosticRequest_msg;
614572
extern const pb_msgdesc_t openxc_DiagnosticResponse_msg;
615-
extern const pb_msgdesc_t openxc_DiagnosticStitchResponse_msg;
616573
extern const pb_msgdesc_t openxc_DynamicField_msg;
617574
extern const pb_msgdesc_t openxc_SimpleMessage_msg;
618575

@@ -634,12 +591,11 @@ extern const pb_msgdesc_t openxc_SimpleMessage_msg;
634591
#define openxc_CommandResponse_fields &openxc_CommandResponse_msg
635592
#define openxc_DiagnosticRequest_fields &openxc_DiagnosticRequest_msg
636593
#define openxc_DiagnosticResponse_fields &openxc_DiagnosticResponse_msg
637-
#define openxc_DiagnosticStitchResponse_fields &openxc_DiagnosticStitchResponse_msg
638594
#define openxc_DynamicField_fields &openxc_DynamicField_msg
639595
#define openxc_SimpleMessage_fields &openxc_SimpleMessage_msg
640596

641597
/* Maximum encoded size of messages (where known) */
642-
#define openxc_VehicleMessage_size 1585
598+
#define openxc_VehicleMessage_size 1383
643599
#define openxc_CanMessage_size 29
644600
#define openxc_ControlCommand_size 342
645601
#define openxc_DiagnosticControlCommand_size 67
@@ -655,8 +611,7 @@ extern const pb_msgdesc_t openxc_SimpleMessage_msg;
655611
#define openxc_RTCConfigurationCommand_size 6
656612
#define openxc_CommandResponse_size 134
657613
#define openxc_DiagnosticRequest_size 63
658-
#define openxc_DiagnosticResponse_size 441
659-
#define openxc_DiagnosticStitchResponse_size 216
614+
#define openxc_DiagnosticResponse_size 458
660615
#define openxc_DynamicField_size 143
661616
#define openxc_SimpleMessage_size 393
662617

gen/go/openxc.pb.go

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)