You've already forked TEF6686_ESP32
Added stereo, TA, TP flags and PTY to logbook
This commit is contained in:
@@ -5573,7 +5573,7 @@ bool handleCreateNewLogbook() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Write the header to the new CSV file
|
// Write the header to the new CSV file
|
||||||
String header = "Date,Time,Frequency,PI code,Signal,PS,RadioText\n";
|
String header = "Date,Time,Frequency,PI code,Signal,Stereo,TA,TP,PTY,PS,RadioText\n";
|
||||||
file.print(header); // Ensure that the header is written properly
|
file.print(header); // Ensure that the header is written properly
|
||||||
|
|
||||||
// Make sure the data is written before closing the file
|
// Make sure the data is written before closing the file
|
||||||
@@ -5637,11 +5637,25 @@ byte addRowToCSV() {
|
|||||||
stationName.replace(",", " "); // Replace commas in station name
|
stationName.replace(",", " "); // Replace commas in station name
|
||||||
radioTextModified.replace(",", " "); // Replace commas in radio text
|
radioTextModified.replace(",", " "); // Replace commas in radio text
|
||||||
|
|
||||||
|
// Handle PTY, TA, TP and Stereo flag
|
||||||
|
String TA;
|
||||||
|
String TP;
|
||||||
|
String Stereo;
|
||||||
|
String pty;
|
||||||
|
if (radio.rds.hasTA) TA = "•"; else TA = "-";
|
||||||
|
if (radio.rds.hasTP) TP = "•"; else TP = "-";
|
||||||
|
if (radio.getStereoStatus()) Stereo = "•"; else Stereo = "-";
|
||||||
|
pty = String(radio.rds.stationTypeCode);
|
||||||
|
|
||||||
// Construct the CSV row data
|
// Construct the CSV row data
|
||||||
String row = currentDateTime + "," +
|
String row = currentDateTime + "," +
|
||||||
frequencyFormatted + "," +
|
frequencyFormatted + "," +
|
||||||
radio.rds.picode + "," +
|
radio.rds.picode + "," +
|
||||||
signal + "," +
|
signal + "," +
|
||||||
|
Stereo + "," +
|
||||||
|
TA + "," +
|
||||||
|
TP + "," +
|
||||||
|
pty + "," +
|
||||||
stationName + "," +
|
stationName + "," +
|
||||||
radioTextModified + "\n";
|
radioTextModified + "\n";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user