Added RT+ routines
This commit is contained in:
+9
-9
@@ -4677,23 +4677,23 @@ void read_encoder() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void tryWiFi() {
|
void tryWiFi() {
|
||||||
tft.drawRoundRect(1, 60, 319, 140, 5, TFT_WHITE);
|
if (!setupmode) tft.drawRoundRect(1, 60, 319, 140, 5, TFT_WHITE);
|
||||||
tft.fillRoundRect(3, 62, 315, 136, 5, TFT_BLACK);
|
if (!setupmode) tft.fillRoundRect(3, 62, 315, 136, 5, TFT_BLACK);
|
||||||
tft.setFreeFont(FONT14);
|
if (!setupmode) tft.setFreeFont(FONT14);
|
||||||
tft.setTextColor(TFT_WHITE);
|
if (!setupmode) tft.setTextColor(TFT_WHITE);
|
||||||
tft.drawCentreString(myLanguage[language][55], 155, 80, GFXFF);
|
if (!setupmode) tft.drawCentreString(myLanguage[language][55], 155, 80, GFXFF);
|
||||||
if (wc.autoConnect()) {
|
if (wc.autoConnect()) {
|
||||||
Server.begin();
|
Server.begin();
|
||||||
Udp.begin(9031);
|
Udp.begin(9031);
|
||||||
remoteip = IPAddress (WiFi.localIP()[0], WiFi.localIP()[1], WiFi.localIP()[2], subnetclient);
|
remoteip = IPAddress (WiFi.localIP()[0], WiFi.localIP()[1], WiFi.localIP()[2], subnetclient);
|
||||||
tft.setTextColor(TFT_GREEN);
|
if (!setupmode) tft.setTextColor(TFT_GREEN);
|
||||||
tft.drawCentreString(myLanguage[language][57], 155, 120, GFXFF);
|
if (!setupmode) tft.drawCentreString(myLanguage[language][57], 155, 120, GFXFF);
|
||||||
wifi = true;
|
wifi = true;
|
||||||
} else {
|
} else {
|
||||||
Server.end();
|
Server.end();
|
||||||
Udp.stop();
|
Udp.stop();
|
||||||
tft.setTextColor(TFT_RED);
|
if (!setupmode) tft.setTextColor(TFT_RED);
|
||||||
tft.drawCentreString(myLanguage[language][56], 155, 120, GFXFF);
|
if (!setupmode) tft.drawCentreString(myLanguage[language][56], 155, 120, GFXFF);
|
||||||
wifi = false;
|
wifi = false;
|
||||||
XDRGTKTCP = false;
|
XDRGTKTCP = false;
|
||||||
RDSSPYTCP = false;
|
RDSSPYTCP = false;
|
||||||
|
|||||||
+76
-2
@@ -444,9 +444,71 @@ void TEF6686::readRDS(bool showrdserrors)
|
|||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case RDS_GROUP_14A:
|
case RDS_GROUP_10A:
|
||||||
|
case RDS_GROUP_10B:
|
||||||
|
case RDS_GROUP_11A:
|
||||||
|
case RDS_GROUP_11B:
|
||||||
|
case RDS_GROUP_12A:
|
||||||
|
case RDS_GROUP_12B: {
|
||||||
|
uint16_t content_byte_1 = (rds.rdsB & 0x07);
|
||||||
|
content_byte_1 = (content_byte_1 << 0x03);
|
||||||
|
content_byte_1 += (rds.rdsC >> 0x0D);
|
||||||
|
uint16_t content_byte_2 = (rds.rdsC & 0x01);
|
||||||
|
content_byte_2 = (content_byte_2 << 0x05);
|
||||||
|
content_byte_2 += (rds.rdsD >> 0x0B);
|
||||||
|
uint16_t start_marker_1 = (rds.rdsC >> 0x07);
|
||||||
|
start_marker_1 = (start_marker_1 & 0x3F);
|
||||||
|
uint16_t length_marker_1 = (rds.rdsC >> 0x01);
|
||||||
|
length_marker_1 = (length_marker_1 & 0x3F);
|
||||||
|
uint16_t start_marker_2 = (rds.rdsD >> 0x05);
|
||||||
|
start_marker_2 = (start_marker_2 & 0x3F);
|
||||||
|
uint16_t length_marker_2 = (rds.rdsD & 0x1F);
|
||||||
|
rds.hasRDSplus = true;
|
||||||
|
|
||||||
|
if (content_byte_1 == 0x04) { // Artist
|
||||||
|
rds.hasMusicArtist = true;
|
||||||
|
for (int i = 0; i <= length_marker_1; i++)rds.musicArtist[i] = rt_buffer2[i + start_marker_1];
|
||||||
|
rds.musicArtist[length_marker_1 + 1] = 0;
|
||||||
|
} else if (content_byte_1 == 0x01) { // Title
|
||||||
|
rds.hasMusicTitle = true;
|
||||||
|
for (int i = 0; i <= length_marker_1; i++)rds.musicTitle[i] = rt_buffer2[i + start_marker_1];
|
||||||
|
rds.musicTitle[length_marker_1 + 1] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (content_byte_2 == 0x04) { // Artist
|
||||||
|
rds.hasMusicArtist = true;
|
||||||
|
for (int i = 0; i <= length_marker_2; i++)rds.musicArtist[i] = rt_buffer2[i + start_marker_2];
|
||||||
|
rds.musicArtist[length_marker_2 + 1] = 0;
|
||||||
|
} else if (content_byte_2 == 0x01) { // Title
|
||||||
|
rds.hasMusicTitle = true;
|
||||||
|
for (int i = 0; i <= length_marker_2; i++)rds.musicTitle[i] = rt_buffer2[i + start_marker_2];
|
||||||
|
rds.musicTitle[length_marker_2 + 1] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (content_byte_1 == 0x24) { // Host
|
||||||
|
rds.hasStationHost = true;
|
||||||
|
for (int i = 0; i <= length_marker_1; i++)rds.stationHost[i] = rt_buffer2[i + start_marker_1];
|
||||||
|
rds.stationHost[length_marker_1 + 1] = 0;
|
||||||
|
} else if (content_byte_2 == 0x24) { // Host
|
||||||
|
rds.hasStationHost = true;
|
||||||
|
for (int i = 0; i <= length_marker_2; i++)rds.stationHost[i] = rt_buffer2[i + start_marker_2];
|
||||||
|
rds.stationHost[length_marker_2 + 1] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (content_byte_1 == 0x21) { // Event
|
||||||
|
rds.hasStationEvent = true;
|
||||||
|
for (int i = 0; i <= length_marker_1; i++)rds.stationEvent[i] = rt_buffer2[i + start_marker_1];
|
||||||
|
rds.stationEvent[length_marker_1 + 1] = 0;
|
||||||
|
} else if (content_byte_2 == 0x21) { // Event
|
||||||
|
rds.hasStationEvent = true;
|
||||||
|
for (int i = 0; i <= length_marker_2; i++)rds.stationEvent[i] = rt_buffer2[i + start_marker_2];
|
||||||
|
rds.stationEvent[length_marker_2 + 1] = 0;
|
||||||
|
}
|
||||||
|
} break;
|
||||||
|
|
||||||
|
case RDS_GROUP_14A: {
|
||||||
rds.hasEON = true; // Group is there, so we have EON
|
rds.hasEON = true; // Group is there, so we have EON
|
||||||
break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rdsBprevious = rds.rdsB;
|
rdsBprevious = rds.rdsB;
|
||||||
@@ -475,6 +537,14 @@ void TEF6686::clearRDS (bool fullsearchrds)
|
|||||||
for (i = 0; i < 17; i++) rds.stationType[i] = 0;
|
for (i = 0; i < 17; i++) rds.stationType[i] = 0;
|
||||||
for (i = 0; i < 6; i++) rds.picode[i] = 0;
|
for (i = 0; i < 6; i++) rds.picode[i] = 0;
|
||||||
for (i = 0; i < 50; i++) af[i].frequency = 0;
|
for (i = 0; i < 50; i++) af[i].frequency = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < 32; i++) {
|
||||||
|
rds.musicArtist[i] = 0;
|
||||||
|
rds.musicTitle[i] = 0;
|
||||||
|
rds.stationEvent[i] = 0;
|
||||||
|
rds.stationHost[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
rds.ECC = 0;
|
rds.ECC = 0;
|
||||||
rds.stationTypeCode = 32;
|
rds.stationTypeCode = 32;
|
||||||
rds.hasECC = false;
|
rds.hasECC = false;
|
||||||
@@ -488,6 +558,10 @@ void TEF6686::clearRDS (bool fullsearchrds)
|
|||||||
rt_process = false;
|
rt_process = false;
|
||||||
ps_process = false;
|
ps_process = false;
|
||||||
rds.rdsreset = true;
|
rds.rdsreset = true;
|
||||||
|
rds.hasMusicTitle = false;
|
||||||
|
rds.hasMusicArtist = false;
|
||||||
|
rds.hasStationEvent = false;
|
||||||
|
rds.hasStationHost = false;
|
||||||
correctpi = false;
|
correctpi = false;
|
||||||
ps_counter = 0;
|
ps_counter = 0;
|
||||||
af_counter = 0;
|
af_counter = 0;
|
||||||
|
|||||||
@@ -99,6 +99,10 @@ typedef struct _rds_ {
|
|||||||
String stationText;
|
String stationText;
|
||||||
char stationType[17];
|
char stationType[17];
|
||||||
char picode[6];
|
char picode[6];
|
||||||
|
char musicTitle[48];
|
||||||
|
char musicArtist[48];
|
||||||
|
char stationHost[48];
|
||||||
|
char stationEvent[48];
|
||||||
uint16_t hours, minutes, days, months, years, offsetplusmin, rdsA, rdsB, rdsC, rdsD, rdsErr;
|
uint16_t hours, minutes, days, months, years, offsetplusmin, rdsA, rdsB, rdsC, rdsD, rdsErr;
|
||||||
int8_t offset;
|
int8_t offset;
|
||||||
int ECC;
|
int ECC;
|
||||||
@@ -115,6 +119,11 @@ typedef struct _rds_ {
|
|||||||
bool hasAF;
|
bool hasAF;
|
||||||
bool hasCT;
|
bool hasCT;
|
||||||
bool rtAB;
|
bool rtAB;
|
||||||
|
bool hasRDSplus;
|
||||||
|
bool hasMusicTitle;
|
||||||
|
bool hasMusicArtist;
|
||||||
|
bool hasStationHost;
|
||||||
|
bool hasStationEvent;
|
||||||
bool correct;
|
bool correct;
|
||||||
bool filter;
|
bool filter;
|
||||||
bool underscore;
|
bool underscore;
|
||||||
@@ -183,6 +192,7 @@ class TEF6686 {
|
|||||||
bool ps_process;
|
bool ps_process;
|
||||||
bool rt_process;
|
bool rt_process;
|
||||||
char rt_buffer[65];
|
char rt_buffer[65];
|
||||||
|
char rt_buffer2[65];
|
||||||
bool useRTPlus = true;
|
bool useRTPlus = true;
|
||||||
bool checkDouble (uint16_t value);
|
bool checkDouble (uint16_t value);
|
||||||
bool ABold;
|
bool ABold;
|
||||||
|
|||||||
Reference in New Issue
Block a user