Azure / azure-iot-arduino

Azure IoT library for the Arduino
Other
168 stars 95 forks source link

Issue with strftime when using include azureiothub? #78

Closed Tintin4000 closed 6 years ago

Tintin4000 commented 6 years ago

Can a new azure arduino library be compiled with the latest one of Microsoft?

Tintin4000 commented 6 years ago

I found that in the azureiotutility there is a time.cpp that include: size_t strftime(char s, size_t maxsize, const char format, const struct tm timeptr) { /For now esp8266 will not report time.*/ (void)(s, maxsize, format, timeptr);
return 0; } Can this be fixed or enhanced?

ewertons commented 6 years ago

Hi @Tintin4000 , let me get more details on this and I'll reply soon.

Tintin4000 commented 6 years ago

I am using the strftime function to format the time which started to return an empty string after referring the #include in the code. As posted before, I found out that the reason was that the function gets overwritten by the AzureIoTUtility (Azure/azure-iot-pal-arduino) under the esp8266 as per my earlier comment. I don't know why it is so and if it can be changed. I have for now simply comment the function in the time.cpp file. and everything seems ok.

JetstreamRoySprowl commented 6 years ago

@Tintin4000 : We've just pushed version 1.0.45 out which fixes this. That time.cpp file has been deleted because the recent versions of the ESP8266 library implement those functions