Difference between revisions of "Edit Signal reader assignments via M2M"

From WICE Wiki v2.92
Jump to navigation Jump to search
Line 69: Line 69:


<code>}</code>
<code>}</code>
==== 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:
<code>[</code>
<code>    {</code>
<code>        "ecu-name": "ABC",</code>
<code>        "can-bus-number": 1,</code>
<code>        "seedkey-id": 0,</code>
<code>        "nr-of-a2l-files": 1</code>
<code>    }</code>
<code>]</code>

Revision as of 15:55, 19 December 2024

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

    }

]