Skip to content

Commit

Permalink
Merge pull request #478 from openxc/next
Browse files Browse the repository at this point in the history
Release 8.2.0
  • Loading branch information
GenoJAFord committed Aug 11, 2021
2 parents fb8392b + 4da5602 commit 7510a54
Show file tree
Hide file tree
Showing 38 changed files with 416 additions and 1,688 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/run-tests.yml
@@ -0,0 +1,46 @@
# This is a basic workflow to help you get started with Actions

name: Run Tests

# Controls when the action will run.
on: [pull_request]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-18.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Set Up Python 3.6
run: |
TERM=xterm
sudo apt-get update -qq
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt-get update -qq
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
sudo python3 get-pip.py
sudo apt-get install -qq -y libsubunit-dev
sudo apt-get install python-apt
sudo apt-get install python3-apt
# Runs a single command using the runners shell
- name: Bootstrap
run: |
script/bootstrap.sh
- name: Build Tests
run: |
cd src
PLATFORM=TESTING make test
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

7 changes: 7 additions & 0 deletions CHANGELOG.mkd
@@ -1,4 +1,11 @@
# OpenXC Vehicle Interface Firmware Changelog
## v8.2.0
* Removed: Removed messagepack format support
* Feature: get_vin command added and is accessible from openxc-control python and from Android and iOS clients
* Update: Improvements to diagnostic response communication
* Update: sonarqube support updates
* Build: build moved from travis to github actions for Travis decommision
* Fix: 7DF Broadcast messaging

## v8.1.0
* BREAKING: VI-Firmware 8.0.0 is not backwards compatable due to stitched diagnostic responses and must be used with OpenXC-Python 2.1.0 or greater.
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -4,7 +4,7 @@ OpenXC Vehicle Interface Firmware

.. image:: /docs/_static/logo.png

:Version: 8.1.0
:Version: 8.2.0
:Web: http://openxcplatform.com
:Documentation: http://vi-firmware.openxcplatform.com
:Source: http://github.com/openxc/vi-firmware
Expand Down
2 changes: 1 addition & 1 deletion docs/compile/example-builds.rst
Expand Up @@ -257,7 +257,7 @@ while this builds the default firmware, ready for OBD2 requests for the chipKIT:
fab chipkit obd2 build
You can specify the message format with ``json``, ``protobuf``, or ``messagepack``:
You can specify the message format with ``json``, or ``protobuf``:

.. code-block:: sh
Expand Down
2 changes: 1 addition & 1 deletion docs/compile/makefile-opts.rst
Expand Up @@ -159,7 +159,7 @@ These options are passed as shell environment variables to the Makefile, e.g.
By default, the output format is ``JSON``. Set this to ``PROTOBUF`` to use a
binary output format, described more in :doc:`/advanced/binary`.

Values: ``JSON``, ``PROTOBUF``, ``MESSAGEPACK``
Values: ``JSON``, ``PROTOBUF``

Default: ``JSON``

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Expand Up @@ -49,9 +49,9 @@
# built documents.
#
# The short X.Y version.
version = '8.1.0'
version = '8.2.0'
# The full version, including alpha/beta/rc tags.
release = '8.1.0'
release = '8.2.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Expand Up @@ -4,7 +4,7 @@ OpenXC Vehicle Interface Firmware

.. image:: /_static/logo.png

:Version: 8.1.0
:Version: 8.2.0
:Web: http://openxcplatform.com
:Documentation: http://vi-firmware.openxcplatform.com
:Source: http://github.com/openxc/vi-firmware
Expand Down
6 changes: 1 addition & 5 deletions fabfile.py
Expand Up @@ -176,8 +176,8 @@ def compile_firmware(build_name, target_path):
env.firmware_release, board['extension']))

for board_name, board in env.msd_boards.items():
msd_enable()
env.board = board_name
msd_enable()
build(capture=True, do_clean=True)
local("cp build/%s/vi-firmware-%s.%s %s/vi-%s-firmware-%s-msd-ct%s.%s"
% (board['name'], board['name'], board['extension'],
Expand Down Expand Up @@ -346,10 +346,6 @@ def json():
@task
def protobuf():
env.payload_format = "PROTOBUF"

@task
def messagepack():
env.payload_format = "MESSAGEPACK"

@task
def clean():
Expand Down
2 changes: 1 addition & 1 deletion script/bootstrap/ci-requirements.txt
@@ -1 +1 @@
openxc==2.1.0
openxc==2.2.0
2 changes: 1 addition & 1 deletion script/bootstrap/pip-requirements.txt
Expand Up @@ -2,4 +2,4 @@ Fabric3==1.14.post1
ecdsa==0.13.3
prettyprint==0.1.5
pyparsing==2.2.0
openxc==2.0.0
openxc==2.2.0
4 changes: 4 additions & 0 deletions src/commands/commands.cpp
Expand Up @@ -19,6 +19,7 @@
#include "commands/modem_config_command.h"
#include "commands/rtc_config_command.h"
#include "commands/sd_mount_status_command.h"
#include "commands/get_vin_command.h"


using openxc::util::log::debug;
Expand Down Expand Up @@ -63,6 +64,8 @@ static bool handleComplexCommand(openxc_VehicleMessage* message) {
break;
case openxc_ControlCommand_Type_SD_MOUNT_STATUS:
status = openxc::commands::handleSDMountStatusCommand();
case openxc_ControlCommand_Type_GET_VIN:
status = openxc::commands::handleGetVinCommand();
default:
status = false;
break;
Expand Down Expand Up @@ -144,6 +147,7 @@ static bool validateControlCommand(openxc_VehicleMessage* message) {
case openxc_ControlCommand_Type_DEVICE_ID:
case openxc_ControlCommand_Type_PLATFORM:
case openxc_ControlCommand_Type_SD_MOUNT_STATUS:
case openxc_ControlCommand_Type_GET_VIN:
valid = true;
break;
case openxc_ControlCommand_Type_MODEM_CONFIGURATION:
Expand Down
1 change: 1 addition & 0 deletions src/commands/diagnostic_request_command.cpp
Expand Up @@ -33,6 +33,7 @@ namespace uart = openxc::interface::uart;
namespace pipeline = openxc::pipeline;

bool openxc::commands::handleDiagnosticRequestCommand(openxc_ControlCommand* command) {
openxc::diagnostics::setVinCommandInProgress(false);
bool status = diagnostics::handleDiagnosticCommand(
&getConfiguration()->diagnosticsManager, command);
sendCommandResponse(openxc_ControlCommand_Type_DIAGNOSTIC, status);
Expand Down
62 changes: 62 additions & 0 deletions src/commands/get_vin_command.cpp
@@ -0,0 +1,62 @@
#include "get_vin_command.h"

#include "config.h"
#include "diagnostics.h"
#include "interface/usb.h"
#include "util/log.h"
#include "config.h"
#include "pb_decode.h"
#include <payload/payload.h>
#include "signals.h"
#include <can/canutil.h>
#include <bitfield/bitfield.h>
#include <limits.h>
#include <openxc.pb.h>

using openxc::util::log::debug;
using openxc::config::getConfiguration;
using openxc::payload::PayloadFormat;
using openxc::signals::getCanBuses;
using openxc::signals::getCanBusCount;
using openxc::signals::getSignals;
using openxc::signals::getSignalCount;
using openxc::signals::getCommands;
using openxc::signals::getCommandCount;
using openxc::can::lookupBus;
using openxc::can::lookupSignal;

namespace can = openxc::can;
namespace payload = openxc::payload;
namespace config = openxc::config;
namespace diagnostics = openxc::diagnostics;
namespace usb = openxc::interface::usb;
namespace uart = openxc::interface::uart;
namespace pipeline = openxc::pipeline;

bool openxc::commands::handleGetVinCommand() {
char* vin;

if (openxc::diagnostics::haveVINfromCan()) {
vin = (char *)openxc::diagnostics::getVIN();
sendCommandResponse(openxc_ControlCommand_Type_GET_VIN, true, vin, strlen(vin));
} else {
openxc_ControlCommand command = openxc_ControlCommand(); // Zero Fill
command.type = openxc_ControlCommand_Type_DIAGNOSTIC;

command.type = openxc_ControlCommand_Type_DIAGNOSTIC;
command.diagnostic_request.action =
openxc_DiagnosticControlCommand_Action_ADD;

command.diagnostic_request.request.bus = 1;
command.diagnostic_request.request.mode = 9;
command.diagnostic_request.request.message_id = 0x7e0;
command.diagnostic_request.request.pid = 2;
openxc::diagnostics::setVinCommandInProgress(true);

diagnostics::handleDiagnosticCommand(
&getConfiguration()->diagnosticsManager, &command);
diagnostics::sendRequests(&getConfiguration()->diagnosticsManager, &getCanBuses()[0]);
}

return true;
}
12 changes: 12 additions & 0 deletions src/commands/get_vin_command.h
@@ -0,0 +1,12 @@
#ifndef __GET_VIN_COMMAND_H__
#define __GET_VIN_COMMAND_H__

namespace openxc {
namespace commands {

bool handleGetVinCommand();

} // namespace commands
} // namespace openxc

#endif // __GET_VIN_COMMAND_H__
3 changes: 0 additions & 3 deletions src/commands/payload_format_command.cpp
Expand Up @@ -42,9 +42,6 @@ bool openxc::commands::handlePayloadFormatCommand(openxc_ControlCommand* command
case openxc_PayloadFormatCommand_PayloadFormat_PROTOBUF:
format = PayloadFormat::PROTOBUF;
break;
case openxc_PayloadFormatCommand_PayloadFormat_MESSAGEPACK:
format = PayloadFormat::MESSAGEPACK;
break;
}

status = true;
Expand Down
3 changes: 2 additions & 1 deletion src/config.cpp
Expand Up @@ -118,7 +118,8 @@ openxc::telitHE910::TelitDevice telitDevice = {
openxc::config::Configuration* openxc::config::getConfiguration() {
static openxc::config::Configuration CONFIG = {
messageSetIndex: 0,
version: "8.1.0",
version: "8.2.0",
dummyVin: "Failed to get VIN temporary VIN is :00000000123456789",
platform: PLATFORM,
environmentMode: ENVIRONMENT_MODE,
payloadFormat: PayloadFormat::DEFAULT_OUTPUT_FORMAT,
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Expand Up @@ -110,6 +110,7 @@ typedef enum {
typedef struct {
int messageSetIndex;
const char* version;
const char* dummyVin;
const char* platform;
const char* environmentMode;
openxc::payload::PayloadFormat payloadFormat;
Expand Down

0 comments on commit 7510a54

Please sign in to comment.