Audio_char information Text , How to seperate each Info a a own char ? #304
Replies: 3 comments
-
Hello Micha2007fe, then put a number in front of the data packet, for example, so that the recipient can assign the packets transmitter #include "HardwareSerial.h"
HardwareSerial MySerial(1);
void setup() {
Serial.begin(115200);
MySerial.begin(115200, SERIAL_8N1, 13, 14);
....
}
// optional
void audio_info(const char *info){
Serial.print("info "); Serial.println(info);
MySerial.printf("%c%s\n", 1, info);
}
void audio_showstreamtitle(const char *info){
Serial.print("streamtitle ");Serial.println(info);
MySerial.printf("%c%s\n", 2, info);
} receiver HardwareSerial MySerial(1);
void setup() {
Serial.begin(115200);
MySerial.begin(115200, SERIAL_8N1, 13, 14);
....
}
void loop(){
....
if(MySerial.available() > 0){
int8_t r;
String info, st;
r = MySerial.read();
if (r == 1) {info = MySerial.readStringUntil('\n'); log_i("info: %s", info.c_str());}
if (r == 2) {st = MySerial.readStringUntil('\n'); log_i("streamtitle: %s", st.c_str());}
}
} |
Beta Was this translation helpful? Give feedback.
-
Hello schreibfaul1, so many thanks for your help and tips. I was lucky that I receive the help from you, so fast :-) So I go and try it out... :-) kind regards |
Beta Was this translation helpful? Give feedback.
-
Hello schreibfaul1, many , many thanks to you !!!!!!! kind regards |
Beta Was this translation helpful? Give feedback.
-
Hi,
I use this great lib and now I try to send the audio_char text . e.g.
.... to an second ESP over Uart....
Can anybody help me please and advise me , how to seperate each to a own char or string ?
Char 1 or string 1 = audio_info
Char 2 or string 2 = audio_showstation
and so on....
I say many thanks for any tips and hints ....
Beta Was this translation helpful? Give feedback.
All reactions