diff --git a/examples/sPSN_Chat/sPSN_Chat.ino b/examples/sPSN_Chat/sPSN_Chat.ino index e7b228bf1438dc7015d2dcc90f5f7b8953117193..bc309b4f0aa7a42513b147af06811129aace185c 100644 --- a/examples/sPSN_Chat/sPSN_Chat.ino +++ b/examples/sPSN_Chat/sPSN_Chat.ino @@ -36,7 +36,7 @@ char topicSub[MAX_LEN_TOPICS] = {""}; //Array für neues Empfangs-Topi char topicPub[MAX_LEN_TOPICS] = {""}; //Array für eigenes Sende-Topic //Callback-Funktion wird bei neuen Daten automatisch aufgerufen -void clientCallback(char* mTopic, int mToLength, char* mData, int mDaLength) { +void newData(char* mTopic, int mToLength, char* mData, int mDaLength) { Serial.print(mTopic); Serial.print(":\t"); Serial.println(mData); @@ -54,7 +54,7 @@ void setup() { sSerial.begin(SERIAL_BAUD); //Starte SoftwareSerielle Schnittstelle (zu IR-Link-Modulen) - psnClient.begin(sSerial, clientCallback); //Starte PubSubClient mit SoftwareSerial und Callbackfunktion "clientCallback" + psnClient.begin(sSerial, newData); //Starte PubSubClient mit SoftwareSerial und Callbackfunktion "clientCallback" sReader.begin(Serial); //AUSGABE INFOTEXT diff --git a/examples/sPSN_Client1/sPSN_Client1.ino b/examples/sPSN_Client1/sPSN_Client1.ino index e17005086f286493089dcf3ca436d9ab92b2147f..116aa540bfa463764ee267ec15b0ff0edc27ec3c 100644 --- a/examples/sPSN_Client1/sPSN_Client1.ino +++ b/examples/sPSN_Client1/sPSN_Client1.ino @@ -42,7 +42,7 @@ DidacticPSNetClient psnClient; //Erzeuge PubSub-Client-Instanz //Callback-Funktion - wird beim Empfang neuer Daten aufgerufen -void clientCallback(char* mTopic, int mToLength, char* mData, int mDaLength) { +void newData(char* mTopic, int mToLength, char* mData, int mDaLength) { Serial.print("CB: "); Serial.print(mTopic); Serial.print(" | "); @@ -65,7 +65,7 @@ void setup() { pinMode(LED_PIN,OUTPUT); - psnClient.begin(sSerial, clientCallback); //Starte PubSub Client an SoftwareSerial Schnittstelle + psnClient.begin(sSerial, newData); //Starte PubSub Client an SoftwareSerial Schnittstelle //psnClient.begin(Serial, clientCallback); //Starte PubSub Client an Serial Schnittstelle psnClient.subscribe(topicSubscribe); //Lege fest zu welchem Topic Daten empfangen werden sollen diff --git a/examples/sPSN_Client2/sPSN_Client2.ino b/examples/sPSN_Client2/sPSN_Client2.ino index 5e49f515a0ae66a38edcbd61446f3009e42a0ba3..98193ecbafcc23988ff68e1b0b224938de9f546b 100644 --- a/examples/sPSN_Client2/sPSN_Client2.ino +++ b/examples/sPSN_Client2/sPSN_Client2.ino @@ -41,7 +41,7 @@ UnblockingTimer uTimer; //Callback-Funktion - wird beim Empfang neuer Daten aufgerufen -void clientCallback(char* mTopic, int mToLength, char* mData, int mDaLength) { +void newData(char* mTopic, int mToLength, char* mData, int mDaLength) { Serial.print("CB: "); Serial.print(mTopic); Serial.print(" | "); @@ -62,7 +62,7 @@ void setup() { Serial.begin(SERIAL_BAUD); //Starte Serielle Schnittstelle (zum PC) sSerial.begin(SERIAL_BAUD); //Starte SoftwareSerielle Schnittstelle (zu IR-Link-Modulen) - psnClient.begin(sSerial, clientCallback); //Starte PubSub Client an SoftwareSerial Schnittstelle + psnClient.begin(sSerial, newData); //Starte PubSub Client an SoftwareSerial Schnittstelle //psnClient.begin(Serial, clientCallback); //Starte PubSub Client an Serial Schnittstelle psnClient.subscribe(topicSubscribe); //Lege fest zu welchem Topic Daten empfangen werden sollen diff --git a/examples/sPSN_ClientMinimal/sPSN_ClientMinimal.ino b/examples/sPSN_ClientMinimal/sPSN_ClientMinimal.ino index 9dbedeaeebe2cba05d76c2639917f9db5e2f72b7..dfd3f235d0f52776292da8809e4449705ac7ccd7 100644 --- a/examples/sPSN_ClientMinimal/sPSN_ClientMinimal.ino +++ b/examples/sPSN_ClientMinimal/sPSN_ClientMinimal.ino @@ -29,7 +29,7 @@ SoftwareSerial sSerial(10, 11); //Erzeuge SoftwareSerial-Instanz mit Rx = Pin10 DidacticPSNetClient psnClient; //Erzeuge PubSub-Client-Instanz //Callback-Funktion - wird beim Empfang neuer Daten aufgerufen -void clientCallback(char* mTopic, int mToLength, char* mPayload, int mPayloadLength) { +void newData(char* mTopic, int mToLength, char* mPayload, int mPayloadLength) { Serial.print("Nachricht von: "); Serial.print(mTopic); Serial.print(" - "); @@ -42,7 +42,7 @@ void setup() { Serial.begin(2400); //Starte Serielle Schnittstelle (zum PC) sSerial.begin(2400); //Starte SoftwareSerielle Schnittstelle (zu IR-Link-Modulen) - psnClient.begin(sSerial, clientCallback); //Starte PubSub Client an SoftwareSerial Schnittstelle + psnClient.begin(sSerial, newData); //Starte PubSub Client an SoftwareSerial Schnittstelle //Hier EMPFANGS-TOPIC ANPASSEN -> default "client2" psnClient.subscribe("client2"); //Lege fest zu welchem Topic Daten empfangen werden sollen