write a struct array to spiffs

CODE: SELECT ALL        long start_time_spiffs = millis();

File configFile = SPIFFS.open("/lights.conf", "w+");

if (!configFile)
{
Serial.println(F("Failed to open test.conf"));
} else {

Serial.println(F("Opened Hue_conf.txt for UPDATE...."));
Serial.printf("Start Position =%u \n", configFile.position());

unsigned char * data = reinterpret_cast<unsigned char*>(Lights); // use unsigned char, as uint8_t is not guarunteed to be same width as char...
size_t bytes = configFile.write(data, sizeof(HueLight) * _LightCount ); // C++ way

Serial.printf("END Position =%u \n", configFile.position());
configFile.close();

}

 

Source: write a struct array to spiffs – Everything ESP8266

write a struct array to spiffs was last modified: June 29th, 2022 by Jovan Stosic

Das Lied von der Erde

Das Lied von der Erde (“The Song of the Earth”) is an orchestral song cycle for two voices and orchestra written by Gustav Mahler between 1908 and 1909. Described as a symphony when published, it comprises six songs for two singers who alternate movements. Mahler specified that the two singers should be a tenor and an alto, or else a tenor and a baritone if an alto is not available.[1] Mahler composed this work following the most painful period in his life, and the songs address themes such as those of living, parting and salvation. On the centenary of Mahler’s birth, the composer and prominent Mahler conductor Leonard Bernstein described Das Lied von der Erde as Mahler’s “greatest symphony”.[2] As with his later Symphony No. 9, Mahler did not live to hear Das Lied von der Erde performed.

https://en.wikipedia.org/wiki/Das_Lied_von_der_Erde

Das Lied von der Erde was last modified: June 25th, 2022 by Jovan Stosic