Skip to content

CDOT-CV/jpo-asn-pojos

 
 

Repository files navigation

jpo-asn-pojos

This repository contains generated POJOs ("Plain Old Java Objects") from ASN.1 (Abstract Syntax Notation) specifications.

Currently it includes the J2735 (2024) V2X specification. In the future, later versions of J2735, as well as additional SAE and IEEE specifications related to connected vehicles, such as IEEE 1609.2/3, etc. may be included.

Background

This project provides Java classes for encoding and decoding ASN.1 messages to and from standard Canonical XER (XML Encoding Rules) and JER (JSON Encoding Rules) formats. These classes are generated from SAE and IEEE standards to facilitate the handling of ASN.1 data structures in Java applications.

The SAE J2735/2024 specification is available as a free download from: https://www.sae.org/standards/content/j2735_202409/

The J2735 specification uses a subset of ASN.1 which is documented in the following ITU recommendations:

The XER and JER encodings are documented here:

Project Structure

Getting Started

Prerequisites

  • JDK 21 or higher
  • Gradle or Maven

Build

To build the project using Gradle:

cd jpo-asn-j2735-2024
./gradlew clean build

To build the project using Maven, from the root directory:

./mvnw clean package

Run Tests

To run tests using Gradle:

cd jpo-asn-runtime
./gradlew clean test
cd ../jpo-asn-j2735-2024
./gradlew clean check

To run tests using Maven, from the root directory:

./mvnw clean package

Installation

Use as a Submodule

To add the repository as a submodule to another project that uses it as a library, follow these steps:

  1. Add the submodule to your project: Navigate to the root directory of your project and run the following command to add the submodule:

    git submodule add https://github.com/usdot-jpo-ode/jpo-asn-pojos.git
  2. Initialize and update the submodule: After adding the submodule, initialize and update it with the following commands:

    git submodule update --init
  3. Include the submodule in your build configuration:

  • For Gradle: Add the following to your settings.gradle file to include the submodule:

    includeBuild('path/to/jpo-asn-pojos/jpo-asn-j2735-2024')

    Then, add the dependencies in your build.gradle file:

    dependencies {
        implementation('usdot.jpo.asn:jpo-asn-j2735-2024')
    }
  • For Maven: Add the submodule as a module in your pom.xml file:

    <modules>
        <module>path/to/jpo-asn-pojos</module>
    </modules>

    Then, add the dependencies in your pom.xml file:

    <dependency>
        <groupId>usdot.jpo.asn</groupId>
        <artifactId>jpo-asn-j2735-2024</artifactId>
        <version>1.0.2</version>
    </dependency>

Replace path/to/jpo-asn-pojos with the actual path to the submodule directory relative to your project's root directory.

Use as a Maven Dependency

TBD. The library JARs will be deployed to Github Maven, and hopefully Maven Central, in the future, but in the near term this repo is intended to be incorporated as a submodule into the ODE.

Usage

To use the generated POJOs in your project, include the necessary dependencies and use the provided classes for encoding and decoding ASN.1 messages. Refer to the documentation and examples provided in the jpo-asn-runtime and jpo-asn-j2735-2024 modules for detailed usage instructions.

Contributing

Contributions are welcome! Please create an issue, and submit a corresponding pull request for any enhancements or bug fixes.

License

This project is licensed under the Apache 2 License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.9%
  • Other 0.1%