Skip to content

Commit

Permalink
J2735 2020 upgrade (#568)
Browse files Browse the repository at this point in the history
<!-- Thanks for the contribution, this is awesome. -->

# PR Details
## Description
Upgrades include new ASN1 folders containing 2020 version of J2735.
Changes were made to many files to allow for use of older and this new
standard. These changes are indicated by "#if SAEJ2735_SPEC < 2020".
This line specifies which standard is to be used by V2X Hub:
https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/j2735-2020-upgrade/src/tmx/Asn_J2735/CMakeLists.txt#L44

## Related Issue

<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context
New versions of the standard are being published. These changes are
required to keep up with industry needs.

## How Has This Been Tested?
Tested all message encoding/decoding with these unit tests: 

https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/j2735-2020-upgrade/src/tmx/TmxUtils/test/J2735MessageTest.cpp
Additional testing was completed on a local instance to ensure messages
were generated properly and adhered to the updated standard. Encoded
messages were cross-checked with an existing decoder:
https://www.marben-products.com/decoder-asn1-automotive/

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [ ] Defect fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [x] Breaking change (fix or feature that cause existing functionality
to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] I have added any new packages to the sonar-scanner.properties file
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the **CONTRIBUTING** document.
[V2XHUB Contributing
Guide](https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/develop/Contributing.md)
- [x] I have added tests to cover my changes.
- [x] All new and existing tests passed.
  • Loading branch information
jwillmartin authored Feb 20, 2024
1 parent 623713b commit d886fae
Show file tree
Hide file tree
Showing 1,364 changed files with 135,180 additions and 56 deletions.
3 changes: 2 additions & 1 deletion src/tmx/Asn_J2735/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FOREACH (SOURCE_DIR ${SOURCE_DIRS})
STRING (SUBSTRING ${SAEJ2735_SPEC} 1 -1 SAEJ2735_SPEC_DEF)

ADD_LIBRARY (${LIBRARY_NAME} SHARED ${${LIBRARY_NAME}_SOURCES})
TARGET_INCLUDE_DIRECTORIES (${LIBRARY_NAME} PUBLIC
TARGET_INCLUDE_DIRECTORIES (${LIBRARY_NAME} PUBLIC
$<BUILD_INTERFACE:${${LIBRARY_NAME}_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include/asn_j2735_${SAEJ2735_SPEC}>)
TARGET_COMPILE_DEFINITIONS (${LIBRARY_NAME} PUBLIC "-DSAEJ2735_SPEC=${SAEJ2735_SPEC_DEF}")
Expand All @@ -41,3 +41,4 @@ ENDFOREACH ()

UNSET (LIBRARY_NAME)
UNSET (SAEJ2735_SPEC)
SET (ASN_J2735_LIBRARIES "asn_j2735_r2020" PARENT_SCOPE)
84 changes: 84 additions & 0 deletions src/tmx/Asn_J2735/include/asn_j2735_r2020/ANY.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*-
* Copyright (c) 2004-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef ASN_TYPE_ANY_H
#define ASN_TYPE_ANY_H

#include <OCTET_STRING.h> /* Implemented via OCTET STRING type */

#ifdef __cplusplus
extern "C" {
#endif

typedef struct ANY {
uint8_t *buf; /* BER-encoded ANY contents */
int size; /* Size of the above buffer */

asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
} ANY_t;

extern asn_TYPE_descriptor_t asn_DEF_ANY;
extern asn_TYPE_operation_t asn_OP_ANY;
extern asn_OCTET_STRING_specifics_t asn_SPC_ANY_specs;

#define ANY_free OCTET_STRING_free

#if !defined(ASN_DISABLE_PRINT_SUPPORT)
#define ANY_print OCTET_STRING_print
#endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */

#define ANY_compare OCTET_STRING_compare

#define ANY_constraint asn_generic_no_constraint

#if !defined(ASN_DISABLE_BER_SUPPORT)
#define ANY_decode_ber OCTET_STRING_decode_ber
#define ANY_encode_der OCTET_STRING_encode_der
#endif /* !defined(ASN_DISABLE_BER_SUPPORT) */

#if !defined(ASN_DISABLE_XER_SUPPORT)
#define ANY_decode_xer OCTET_STRING_decode_xer_hex
xer_type_encoder_f ANY_encode_xer;
#endif /* !defined(ASN_DISABLE_XER_SUPPORT) */

#if !defined(ASN_DISABLE_JER_SUPPORT)
jer_type_encoder_f ANY_encode_jer;
#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */

#if !defined(ASN_DISABLE_UPER_SUPPORT)
per_type_decoder_f ANY_decode_uper;
per_type_encoder_f ANY_encode_uper;
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
#if !defined(ASN_DISABLE_APER_SUPPORT)
per_type_decoder_f ANY_decode_aper;
per_type_encoder_f ANY_encode_aper;
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */

/******************************
* Handy conversion routines. *
******************************/

/* Convert another ASN.1 type into the ANY. This implies DER encoding. */
int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);
ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);
#if !defined(ASN_DISABLE_APER_SUPPORT)
int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr);
ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr);
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */

/* Convert the contents of the ANY type into the specified type. */
int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
#if !defined(ASN_DISABLE_APER_SUPPORT)
int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
#endif /* !defined(ASN_DISABLE_APER_SUPPORT) */

#define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size))
#define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \
&asn_DEF_ANY, (buf), (size))

#ifdef __cplusplus
}
#endif

#endif /* ASN_TYPE_ANY_H */
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "ProbeVehicleData"
* found in "J2735-ProbeVehicleData.asn"
* `asn1c -pdu=MessageFrame -fcompound-names -fincludes-quoted -no-gen-JER`
*/

#ifndef _AccelSteerYawRateConfidence_H_
#define _AccelSteerYawRateConfidence_H_


#include "asn_application.h"

/* Including external dependencies */
#include "YawRateConfidence.h"
#include "AccelerationConfidence.h"
#include "SteeringWheelAngleConfidence.h"
#include "constr_SEQUENCE.h"

#ifdef __cplusplus
extern "C" {
#endif

/* AccelSteerYawRateConfidence */
typedef struct AccelSteerYawRateConfidence {
YawRateConfidence_t yawRate;
AccelerationConfidence_t acceleration;
SteeringWheelAngleConfidence_t steeringWheelAngle;

/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AccelSteerYawRateConfidence_t;

/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AccelSteerYawRateConfidence;
extern asn_SEQUENCE_specifics_t asn_SPC_AccelSteerYawRateConfidence_specs_1;
extern asn_TYPE_member_t asn_MBR_AccelSteerYawRateConfidence_1[3];

#ifdef __cplusplus
}
#endif

#endif /* _AccelSteerYawRateConfidence_H_ */
#include "asn_internal.h"
46 changes: 46 additions & 0 deletions src/tmx/Asn_J2735/include/asn_j2735_r2020/Acceleration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "Common"
* found in "J2735-Common.asn"
* `asn1c -pdu=MessageFrame -fcompound-names -fincludes-quoted -no-gen-JER`
*/

#ifndef _Acceleration_H_
#define _Acceleration_H_


#include "asn_application.h"

/* Including external dependencies */
#include "NativeInteger.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Acceleration */
typedef long Acceleration_t;

/* Implementation */
extern asn_per_constraints_t asn_PER_type_Acceleration_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_Acceleration;
asn_struct_free_f Acceleration_free;
asn_struct_print_f Acceleration_print;
asn_constr_check_f Acceleration_constraint;
ber_type_decoder_f Acceleration_decode_ber;
der_type_encoder_f Acceleration_encode_der;
xer_type_decoder_f Acceleration_decode_xer;
xer_type_encoder_f Acceleration_encode_xer;
oer_type_decoder_f Acceleration_decode_oer;
oer_type_encoder_f Acceleration_encode_oer;
per_type_decoder_f Acceleration_decode_uper;
per_type_encoder_f Acceleration_encode_uper;
per_type_decoder_f Acceleration_decode_aper;
per_type_encoder_f Acceleration_encode_aper;

#ifdef __cplusplus
}
#endif

#endif /* _Acceleration_H_ */
#include "asn_internal.h"
59 changes: 59 additions & 0 deletions src/tmx/Asn_J2735/include/asn_j2735_r2020/AccelerationConfidence.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "ProbeVehicleData"
* found in "J2735-ProbeVehicleData.asn"
* `asn1c -pdu=MessageFrame -fcompound-names -fincludes-quoted -no-gen-JER`
*/

#ifndef _AccelerationConfidence_H_
#define _AccelerationConfidence_H_


#include "asn_application.h"

/* Including external dependencies */
#include "NativeEnumerated.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Dependencies */
typedef enum AccelerationConfidence {
AccelerationConfidence_unavailable = 0,
AccelerationConfidence_accl_100_00 = 1,
AccelerationConfidence_accl_010_00 = 2,
AccelerationConfidence_accl_005_00 = 3,
AccelerationConfidence_accl_001_00 = 4,
AccelerationConfidence_accl_000_10 = 5,
AccelerationConfidence_accl_000_05 = 6,
AccelerationConfidence_accl_000_01 = 7
} e_AccelerationConfidence;

/* AccelerationConfidence */
typedef long AccelerationConfidence_t;

/* Implementation */
extern asn_per_constraints_t asn_PER_type_AccelerationConfidence_constr_1;
extern asn_TYPE_descriptor_t asn_DEF_AccelerationConfidence;
extern const asn_INTEGER_specifics_t asn_SPC_AccelerationConfidence_specs_1;
asn_struct_free_f AccelerationConfidence_free;
asn_struct_print_f AccelerationConfidence_print;
asn_constr_check_f AccelerationConfidence_constraint;
ber_type_decoder_f AccelerationConfidence_decode_ber;
der_type_encoder_f AccelerationConfidence_encode_der;
xer_type_decoder_f AccelerationConfidence_decode_xer;
xer_type_encoder_f AccelerationConfidence_encode_xer;
oer_type_decoder_f AccelerationConfidence_decode_oer;
oer_type_encoder_f AccelerationConfidence_encode_oer;
per_type_decoder_f AccelerationConfidence_decode_uper;
per_type_encoder_f AccelerationConfidence_encode_uper;
per_type_decoder_f AccelerationConfidence_decode_aper;
per_type_encoder_f AccelerationConfidence_encode_aper;

#ifdef __cplusplus
}
#endif

#endif /* _AccelerationConfidence_H_ */
#include "asn_internal.h"
45 changes: 45 additions & 0 deletions src/tmx/Asn_J2735/include/asn_j2735_r2020/AccelerationSet4Way.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "Common"
* found in "J2735-Common.asn"
* `asn1c -pdu=MessageFrame -fcompound-names -fincludes-quoted -no-gen-JER`
*/

#ifndef _AccelerationSet4Way_H_
#define _AccelerationSet4Way_H_


#include "asn_application.h"

/* Including external dependencies */
#include "Acceleration.h"
#include "VerticalAcceleration.h"
#include "YawRate.h"
#include "constr_SEQUENCE.h"

#ifdef __cplusplus
extern "C" {
#endif

/* AccelerationSet4Way */
typedef struct AccelerationSet4Way {
Acceleration_t Long;
Acceleration_t lat;
VerticalAcceleration_t vert;
YawRate_t yaw;

/* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx;
} AccelerationSet4Way_t;

/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AccelerationSet4Way;
extern asn_SEQUENCE_specifics_t asn_SPC_AccelerationSet4Way_specs_1;
extern asn_TYPE_member_t asn_MBR_AccelerationSet4Way_1[4];

#ifdef __cplusplus
}
#endif

#endif /* _AccelerationSet4Way_H_ */
#include "asn_internal.h"
45 changes: 45 additions & 0 deletions src/tmx/Asn_J2735/include/asn_j2735_r2020/AddGrpB_Angle.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "AddGrpB"
* found in "J2735_201603_ASN_CC.asn"
* `asn1c -gen-PER -fcompound-names -fincludes-quoted -fskeletons-copy`
*/

#ifndef _AddGrpB_Angle_H_
#define _AddGrpB_Angle_H_


#include "asn_application.h"

/* Including external dependencies */
#include "NativeInteger.h"

#ifdef __cplusplus
extern "C" {
#endif

/* AddGrpB_Angle */
typedef long AddGrpB_Angle_t;

/* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_AddGrpB_Angle;
asn_struct_free_f AddGrpB_Angle_free;
asn_struct_print_f AddGrpB_Angle_print;
asn_constr_check_f AddGrpB_Angle_constraint;
ber_type_decoder_f AddGrpB_Angle_decode_ber;
der_type_encoder_f AddGrpB_Angle_encode_der;
xer_type_decoder_f AddGrpB_Angle_decode_xer;
xer_type_encoder_f AddGrpB_Angle_encode_xer;
oer_type_decoder_f AddGrpB_Angle_decode_oer;
oer_type_encoder_f AddGrpB_Angle_encode_oer;
per_type_decoder_f AddGrpB_Angle_decode_uper;
per_type_encoder_f AddGrpB_Angle_encode_uper;
per_type_decoder_f AddGrpB_Angle_decode_aper;
per_type_encoder_f AddGrpB_Angle_encode_aper;

#ifdef __cplusplus
}
#endif

#endif /* _AddGrpB_Angle_H_ */
#include "asn_internal.h"
Loading

0 comments on commit d886fae

Please sign in to comment.