volkszaehler / libsml

Implementation in C of the Smart Message Language (SML) protocol
GNU General Public License v3.0
85 stars 49 forks source link

sml_server : add unit conversion from unit.h #44

Closed devZer0 closed 6 years ago

devZer0 commented 6 years ago

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 6 years ago

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 6 years ago

Fine with me.