vectorgrp / XCPlite

Simple implementation of the ASAM XCP on Ethernet protocol
MIT License
163 stars 88 forks source link

No function to create physical calibration parameter #36

Closed Stridetofreedom closed 3 months ago

Stridetofreedom commented 1 year ago

Hi Vector group,

I found that you only provided with below 4 calibration related creation functions: image But I can't find them offering physical meanings to calibration parameters (factor and offset). So if we want to see calibration parameters with physical value showing on CANape, how should we realize it?

Can we modify the function to be like below to make it work? void A2lCreatePhysParameter_(const char name, int size, uint32_t addr, const char comment, double factor, double offset, const char unit, double min, double max) {       const char conv = "NO";       if (factor != 0.0 || offset != 0.0) {             fprintf(gA2lFile, "/begin COMPU_METHOD %s_COMPU_METHOD \"\" LINEAR \"%%6.3\" \"%s\" COEFFS_LINEAR %g %g /end COMPU_METHOD\n", name, unit!=NULL?unit:"", factor, offset);             conv = name;             gA2lConversions++;       }       fprintf(gA2lFile, "/begin CHARACTERISTIC %s \"%s\" VALUE 0x%X %s 0 %s_COMPU_METHOD %g %g PHYS_UNIT \"%s\" /end CHARACTERISTIC\n",             name, comment, addr, getParType(size), conv, min, max, unit);       gA2lParameters++; }

Look forward to some reply. Thanks