tobiasschuerg / InfluxDB-Client-for-Arduino

Simple library for sending measurements to an InfluxDB with a single network request. Supports ESP8266 and ESP32.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getTimeStamp signature

fl4p opened this issue · comments

Hi,
thanks for this lib.

Signature of getTimeStamp(struct timeval *tv, int secFracDigits) should be
getTimeStamp(const struct timeval *tv, int secFracDigits), so we don't have to cast away the const when using this func externally.

Or even better, consider using references to match the general C++ style:
getTimeStamp(const struct timeval &tv, int secFracDigits)

Thanks, @fl4p, for the feedback.
I admit there should be the const qualified before struct timeval *tv.
However, its usage should stay idiomatic. As the struct timeval is from C time API, it is mostly used as a pointer and it is better to keep it so.