Skip to content

Commit

Permalink
integrate bsw_code_gen script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sauci committed Nov 6, 2019
1 parent 51e26b4 commit c2324be
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 58 deletions.
82 changes: 41 additions & 41 deletions config/can_tp.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@
"block size": {
"$ref": "#/definitions/block_size"
},
"communication type": {
"communication_type": {
"$ref": "#/definitions/communication_type"
},
"wait for transmission maximum": {
"wait_for_transmission maximum": {
"$ref": "#/definitions/wait_for_transmission_maximum"
},
"minimum separation time": {
"minimum_separation_time": {
"$ref": "#/definitions/minimum_separation_time"
},
"N_As timeout": {
"N_As_timeout": {
"$ref": "#/definitions/network_layer_timeout"
},
"N_Bs timeout": {
"N_Bs_timeout": {
"$ref": "#/definitions/network_layer_timeout"
},
"N_Cs timeout": {
"N_Cs_timeout": {
"$ref": "#/definitions/network_layer_timeout"
},
"N_Ar timeout": {
"N_Ar_timeout": {
"$ref": "#/definitions/network_layer_timeout"
},
"N_Br timeout": {
"N_Br_timeout": {
"$ref": "#/definitions/network_layer_timeout"
},
"N_Cr timeout": {
"N_Cr_timeout": {
"$ref": "#/definitions/network_layer_timeout"
}
}
Expand All @@ -41,7 +41,7 @@
"items": {
"type": "object",
"properties": {
"main function period": {
"main_function_period": {
"type": "number",
"minimum": 0
},
Expand All @@ -52,7 +52,7 @@
{
"type": "object",
"properties": {
"channel mode": {
"channel_mode": {
"$ref": "#/definitions/channel_mode"
},
"receivers": {
Expand All @@ -66,7 +66,7 @@
},
{
"properties": {
"addressing format": {
"addressing_format": {
"type": "string",
"enum": [
"CANTP_STANDARD",
Expand All @@ -84,14 +84,14 @@
},
{
"properties": {
"addressing format": {
"addressing_format": {
"type": "string",
"enum": [
"CANTP_MIXED",
"CANTP_MIXED29BIT"
]
},
"address extension": {
"address_extension": {
"$ref": "#/definitions/network_address_extension"
}
}
Expand All @@ -105,13 +105,13 @@
},
{
"properties": {
"addressing format": {
"addressing_format": {
"type": "string",
"enum": [
"CANTP_EXTENDED"
]
},
"target address": {
"target_address": {
"$ref": "#/definitions/network_address_extension"
}
}
Expand All @@ -132,7 +132,7 @@
},
{
"properties": {
"addressing format": {
"addressing_format": {
"type": "string",
"enum": [
"CANTP_STANDARD",
Expand All @@ -150,14 +150,14 @@
},
{
"properties": {
"addressing format": {
"addressing_format": {
"type": "string",
"enum": [
"CANTP_MIXED",
"CANTP_MIXED29BIT"
]
},
"address extension": {
"address_extension": {
"$ref": "#/definitions/network_address_extension"
}
}
Expand All @@ -171,13 +171,13 @@
},
{
"properties": {
"addressing format": {
"addressing_format": {
"type": "string",
"enum": [
"CANTP_EXTENDED"
]
},
"target address": {
"target_address": {
"$ref": "#/definitions/network_address_extension"
}
}
Expand Down Expand Up @@ -222,41 +222,41 @@
"comment": {
"type": "string"
},
"network service data unit identifier": {
"network_service_data_unit_identifier": {
"$ref": "#/definitions/network_address_extension"
},
"N_Ar timeout": {
"N_Ar_timeout": {
"$ref": "#/definitions/network_layer_timeout"
},
"N_Br timeout": {
"N_Br_timeout": {
"$ref": "#/definitions/network_layer_timeout"
},
"N_Cr timeout": {
"N_Cr_timeout": {
"$ref": "#/definitions/network_layer_timeout"
},
"block size": {
"block_size": {
"$ref": "#/definitions/block_size"
},
"minimum separation time": {
"minimum_separation_time": {
"$ref": "#/definitions/minimum_separation_time"
},
"wait for transmission maximum": {
"wait_for_transmission maximum": {
"$ref": "#/definitions/wait_for_transmission_maximum"
},
"network service data unit reference": {
"network_service_data_unit_reference": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"enable padding": {
"enable_padding": {
"type": "boolean"
},
"communication type": {
"communication_type": {
"$ref": "#/definitions/communication_type"
}
},
"required": [
"network service data unit reference"
"network_service_data_unit_reference"
]
},
"block_size": {
Expand All @@ -277,35 +277,35 @@
"comment": {
"type": "string"
},
"network service data unit identifier": {
"network_service_data_unit_identifier": {
"$ref": "#/definitions/network_address_extension"
},
"N_As timeout": {
"N_As_timeout": {
"$ref": "#/definitions/network_layer_timeout"
},
"N_Bs timeout": {
"N_Bs_timeout": {
"$ref": "#/definitions/network_layer_timeout"
},
"N_Cs timeout": {
"N_Cs_timeout": {
"$ref": "#/definitions/network_layer_timeout"
},
"network service data unit reference": {
"network_service_data_unit_reference": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"enable transmit cancellation": {
"enable_transmit_cancellation": {
"type": "boolean"
},
"enable padding": {
"enable_padding": {
"type": "boolean"
},
"communication type": {
"communication_type": {
"$ref": "#/definitions/communication_type"
}
},
"required": [
"network service data unit reference"
"network_service_data_unit_reference"
]
},
"network_address_extension": {
Expand Down
29 changes: 12 additions & 17 deletions generated/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/CanTp_PBcfg.h
add_custom_command(OUTPUT
${CMAKE_CURRENT_SOURCE_DIR}/CanTp_PBcfg.h
${CMAKE_CURRENT_SOURCE_DIR}/CanTp_PBcfg.c
DEPENDS ${CANTP_CONFIG_FILEPATH}
DEPENDS ${PROJECT_SOURCE_DIR}/script/config.h.jinja2
COMMAND ${PYTHON_EXECUTABLE} can_tp.py ${CANTP_CONFIG_FILEPATH}
-header ${CMAKE_CURRENT_SOURCE_DIR}/CanTp_PBcfg.h
#-schema ${CMAKE_SOURCE_DIR}/config/can_tp.schema.json
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/script
COMMENT "generating post-build configuration header")

add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/CanTp_PBcfg.c
DEPENDS ${CANTP_CONFIG_FILEPATH}
DEPENDS ${PROJECT_SOURCE_DIR}/script/config.c.jinja2
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/CanTp_PBcfg.h
COMMAND ${PYTHON_EXECUTABLE} can_tp.py ${CANTP_CONFIG_FILEPATH}
-source ${CMAKE_CURRENT_SOURCE_DIR}/CanTp_PBcfg.c
#-schema ${CMAKE_SOURCE_DIR}/config/can_tp.schema.json
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/script
COMMENT "generating post-build configuration source")
DEPENDS ${PROJECT_SOURCE_DIR}/script/header.h.jinja2
DEPENDS ${PROJECT_SOURCE_DIR}/script/source.c.jinja2
COMMAND bsw_code_gen
-schema ${PROJECT_SOURCE_DIR}/config/can_tp.schema.json
-template_directory ${PROJECT_SOURCE_DIR}/script
${PROJECT_SOURCE_DIR}/config/can_tp.json
${CMAKE_CURRENT_SOURCE_DIR}/CanTp_PBcfg.c
${CMAKE_CURRENT_SOURCE_DIR}/CanTp_PBcfg.h
COMMENT "generating post-build configuration files")

add_library(CanTp_PBcfg STATIC ${CMAKE_CURRENT_SOURCE_DIR}/CanTp_PBcfg.c)

Expand Down

0 comments on commit c2324be

Please sign in to comment.