Untitled

Views: 781

Anonymous   4 years ago   Never
C++   0.61 KB   Public
Crumb Tree
  • Untitled
Highlight mode ON

Click on the lines you want to highlight and share this url.

    Download   RAW   Copy   Fork
  1. //-------------------- Send to mqtt
  2.     File cacheLogFile = SD.open(CACHE_FILE);
  3.     inputChar = cacheLogFile.read();
  4.    
  5.     Serial.println("Sending:");
  6.     while(inputChar != EOF) {
  7.         if(inputChar != '\n') {
  8.             inputStr[strIndex] = inputChar;
  9.             strIndex++;
  10.             inputStr[strIndex] = '\0';
  11.         }
  12.         else {
  13.             Serial.println(inputStr);
  14.             client.publish(params.out_topic, inputStr);
  15.             delay(50);
  16.             strIndex = 0;
  17.         }
  18.         inputChar = cacheLogFile.read();
  19.     }