openv / vcontrold

:fire: vcontrold Daemon for control and logging of Viessmann® type heating devices
https://github.com/openv/openv/wiki
GNU General Public License v3.0
101 stars 54 forks source link

Implemented setSystemTime #49

Closed nexx512 closed 5 years ago

nexx512 commented 5 years ago

I implemented setSystemTime using the strptime date string parser. This parser is part of the posix standard but requires the _XOPEN_SOURCE to be defined. This leads to issues with bzero and and some other deprecated functions. I decided to remove deprecated functions and turn back to standard ANSI-C functions.

I also chose to use another format for the getSystemTime command. This might have an impact to already existing applications. But I would consider command symmetry for getSystemTime and setSystemTime more important. I also would prefer an output of getSystemTime that is system locale specific and can be parsed by strptime. I thought about useind ISO date formats but that would cause problemd encoding the weekdays. So I stuck to strftime "%c".

nexx512 commented 5 years ago

Changed to ISO format. For now the timezones are ignored though.

nexx512 commented 5 years ago

Are there any chances that this can make it into master? If not, what needs to be changed to meet you coding guidelines?

ThomasCr commented 5 years ago

pls apply this PR :)

speters commented 5 years ago

Could you sort out the build problems for the Cygwin build of your pull request?

Maybe it is as simple as doing

#ifdef __CYGWIN__
#define __tm_gmtoff tm_gmtoff
#define __tm_zone tm_zone
#endif

But please check before doing so. I only guessed this from the Appveyor error log.