sml_server : add unit conversion from unit.h
devZer0 opened this issue · 2 comments
devZer0 commented
what about getting unit.h from vzlogger (https://github.com/volkszaehler/vzlogger/blob/master/include/unit.h ) and include , instead of just statically checking for "W" or "Wh" ? that would be more complete for an universal sml parser binary...
int unitcode = (entry->unit) ? *entry->unit : 0;
char *unit = dlms_get_unit(unitcode);
if ( unit != NULL )
printf("%s",unit);
else
printf("n/a");
hmueller01 commented
Good point. I will look into this.
@andig Is it a problem if I integrate unit.h from vzlogger into examples? Licence should be ok.
andig commented
Fine with me.