Edit Signal reader assignments via M2M

From WICE Wiki v2.92
Revision as of 16:50, 19 December 2024 by Alkitjohan (talk | contribs)
Jump to navigation Jump to search

From version 1.47.0 of the API, Signal reader assignments can be edited via the API. The currently available end points for editing a specific assignment is described at https://wice.alkit.se/m2m/resource_EditSignalReaderAssignmentService.html

Editing an assignment is done by combining results from multiple end points and to help the user the sections below describes some use cases.

Add A2L signals from updated vehicle profile

One use case is when an assignment "A" is based on a vehicle profile "VP" which has A2L files associated with at least one ECU. Then a new version of the A2L file is available which contains additional signals that needs to be measured in A.

When using the portal GUI one would start with uploading the A2L file and then associate it with the ECU of the VP. After that A needs to be copied (to use the updated version of VP) and the new A2L file needs to be selected when A is copied.

After the copying process is successful the assignment can be edited and the additional signals of the new A2L file are available when selecting the signals from the signal source.

The following sections describes how to do this via M2M.

1. Upload new A2L file

Uploading a new A2L is done via https://wice.alkit.se/m2m/resource_VehicleProfileService.html#resource_VehicleProfileService_uploadNewA2LFile_attributes_file_POST.

When using Postman the necessary information is provided as in the screenshot to the right. The only required attribute is the "ecu-name".

The same function via the GUI can be seen in screenshot "Upload A2L via portal".

A successful response looks like:

Upload A2L file via m2m

[

    {

        "type": "A2L",

        "comment": "four signals",

        "enabled": true,

        "version": "1",

        "name": "four_signals",

        "id": 3,

        "ecu-name": "ABC"

    }

]

Upload A2L via portal

2. List vehicle profiles

To able to associate the new A2L file with a vehicle profile we need to obtain the ID of the vehicle profile we want to update. This is done via the end point https://wice.alkit.se/m2m/resource_VehicleProfileService.html#resource_VehicleProfileService_listProfiles_name_offset_limit_GET

A successful response to that end point may look like:

{

    "count": 1,

    "offset": 0,

    "limit": 25,

    "results": [

        {

            "name": "workshop-profile",

            "diagnosticReferenceID": 0,

            "id": 1

        }

    ]

}

3. List ECUS of a vehicle profile

To know which ECU in the vehicle profile we want to associated the A2L file with we need to list the configured ECUs for the vehicle profile of interest. This is done via: https://wice.alkit.se/m2m/resource_VehicleProfileService.html#resource_VehicleProfileService_getEcuToA2LAssociatonSummary_profileID_GET

Here we provide the "id" of the profile obtained in the previous step.

A successful response may look like:

[

    {

        "ecu-name": "ABC",

        "can-bus-number": 1,

        "seedkey-id": 0,

        "nr-of-a2l-files": 1

    }

]

4. Associate A2L file with ECU

To associate the uploaded A2L file with the ECU "ABC" in the response of step 3 above the following end point is used: https://wice.alkit.se/m2m/resource_VehicleProfileService.html#resource_VehicleProfileService_addEcuA2LAssociation_profileID_toBeMade_PUT

Associate A2L file with ECU
Associate A2L via GUI

A request example with a successful response can be seen in the screenshot to the right. The ID of the uploaded A2L file from step 1 along with the CAN bus number of the ECU is provided. This is the same as when selecting the CAN bus and the A2L file when association a file with an ECU using the portal GUI. An example can also be seen in a screenshot to the right.