mirror of
https://github.com/tugsi/Filaman.git
synced 2026-07-09 18:02:48 +02:00
fix: correct payload type check in NFC write event handling
This commit is contained in:
+2
-2
@@ -84,7 +84,7 @@ void onWsEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventTyp
|
|||||||
String message = String((char*)data);
|
String message = String((char*)data);
|
||||||
JsonDocument doc;
|
JsonDocument doc;
|
||||||
deserializeJson(doc, message);
|
deserializeJson(doc, message);
|
||||||
|
|
||||||
if (doc["type"] == "heartbeat") {
|
if (doc["type"] == "heartbeat") {
|
||||||
// Sende Heartbeat-Antwort
|
// Sende Heartbeat-Antwort
|
||||||
ws.text(client->id(), "{"
|
ws.text(client->id(), "{"
|
||||||
@@ -96,7 +96,7 @@ void onWsEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventTyp
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if (doc["type"] == "writeNfcTag") {
|
else if (doc["type"] == "writeNfcTag") {
|
||||||
if (doc["payload"].is<String>()) {
|
if (doc["payload"].is<JsonObject>()) {
|
||||||
// Versuche NFC-Daten zu schreiben
|
// Versuche NFC-Daten zu schreiben
|
||||||
String payloadString;
|
String payloadString;
|
||||||
serializeJson(doc["payload"], payloadString);
|
serializeJson(doc["payload"], payloadString);
|
||||||
|
|||||||
Reference in New Issue
Block a user