hello i am working on Esp32 module and i have got a task to send the txt file content from Esp32 to a third party mobile app. i have established the bluetooth connection between Esp32 and bluetooth module and can send the messages from serial monitor to the app and vice-versa. But i don,t know how to send the file content from Esp32 to the application. i am storing the file in the flash memory of Esp32 with the help of SPIFFS library.
The application that i am using is "Serial bluetooth terminal" . Will be really thankful if somebody help me with this.
i have written this code till now
#include "SPIFFS.h"
void setup() {
Serial.begin(115200);
if(!SPIFFS.begin(true)){
Serial.println("An Error has occurred while mounting SPIFFS");
return;
}
File file = SPIFFS.open("/test_plugin.txt");
if(!file){
Serial.println("Failed to open file for reading");
return;
}
Serial.println("File Content:");
while(file.available()){
Serial.write(file.read());
}
file.close();
}
void loop() {}