From f67351cd21c16b52aaa55eebdc37a3ddb460491f Mon Sep 17 00:00:00 2001 From: GenoJAFord Date: Mon, 31 Jan 2022 20:30:57 +0000 Subject: [PATCH 1/2] Generate a protobuf sync message every 64 messages --- src/pipeline.cpp | 19 +++++++++++++++++++ src/pipeline.h | 1 + 2 files changed, 20 insertions(+) diff --git a/src/pipeline.cpp b/src/pipeline.cpp index f2c8ad8d5..f9c84abd9 100644 --- a/src/pipeline.cpp +++ b/src/pipeline.cpp @@ -194,6 +194,14 @@ void openxc::pipeline::publish(openxc_VehicleMessage* message, } else { debug("Trying to serialize unrecognized type: %d", message->type); } + + // Send a SYNC Message Jan 2022!!! + + static int msgCounter = 0; + if ((msgCounter & 0x3f) == 0x3f) { // Send a sync message every 63 messages + sendSyncMessage(pipeline); + } + msgCounter++; } void openxc::pipeline::sendMessage(Pipeline* pipeline, uint8_t* message, @@ -314,3 +322,14 @@ void openxc::pipeline::logStatistics(Pipeline* pipeline) { } } } + + +void openxc::pipeline::sendSyncMessage(Pipeline* pipeline) { + unsigned char syncMessagePayload[] = {0x07, 'S', 'Y', 'N', 'C', 'M', 'S', 'G' }; + + MessageClass messageClass = MessageClass::CAN; + + sendMessage(pipeline, syncMessagePayload, sizeof(syncMessagePayload), messageClass); + debug("Sent Sync Message"); + +} diff --git a/src/pipeline.h b/src/pipeline.h index fc93fa16b..d4cbdc57f 100644 --- a/src/pipeline.h +++ b/src/pipeline.h @@ -97,6 +97,7 @@ void sendMessage(Pipeline* pipeline, uint8_t* message, int messageSize, void process(Pipeline* pipeline); void logStatistics(Pipeline* pipeline); +void sendSyncMessage(Pipeline* pipeline); } // namespace interface } // namespace openxc From f35011e193113838530a235805402ff596476c77 Mon Sep 17 00:00:00 2001 From: pjt0620 Date: Mon, 7 Feb 2022 16:55:36 -0500 Subject: [PATCH 2/2] specify pip version --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 0e45fe1fd..f34c8aba2 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -27,7 +27,7 @@ jobs: sudo apt-get install python3.6 -y sudo rm /usr/bin/python3 sudo ln -s /usr/bin/python3.6 /usr/bin/python3 - wget https://bootstrap.pypa.io/get-pip.py + wget https://bootstrap.pypa.io/pip/3.6/get-pip.py sudo python3 get-pip.py sudo apt-get install -qq -y libsubunit-dev sudo apt-get install python-apt