Skip to main content

Scripted example

A scripted namespace remaps signals from other namespaces, which can involve simple renaming or more complex transformations. Here is an example of what an interface.json might look like:

{
"chains": [
{
"type": "udp",
"namespace": "VehicleBus",
"server_port": 2001,
"target_host": "127.0.0.1",
"target_port": 2000,
"database": "VehicleBus.dbc",
"public": false
},
{
"namespace": "vss",
"type": "scripted",
"database": "vss_signals.json",
"public": true
}
]
}

In this configuration, we have chosen to make the VehicleBus namespace private, concealing its signals from clients and resulting in only displaying signals available from the vss namespace.

Using this example of a scripted signal database:

{
"description": "VSS mapping information",
"formatVersion": "0.1.0",
"simple_mapping": {
"Vehicle.Speed": {
"namespace": "VehicleBus",
"name": "ID32_vehicleSpeed"
}
}
}

only one signal will be exposed, named Vehicle.Speed. This exposed signal is mapped from the internal signal named ID32_vehicleSpeed within the VehicleBus namespace.

A more comprehensive introduction can be found here.