Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed webpage handle to save mqtt values correctly #127

Merged
merged 3 commits into from
Mar 7, 2022

Conversation

dbambus
Copy link
Collaborator

@dbambus dbambus commented Nov 15, 2021

Fixed Issue #124

@dbambus dbambus requested a review from tali November 15, 2021 18:38
@dbambus dbambus linked an issue Nov 15, 2021 that may be closed by this pull request
Comment on lines 408 to 409
index_start =
index_start + sizeof(G.MQTT_User) / sizeof(G.MQTT_User[0]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wenn hier index_start als Akkumulator verwendet und immer nur draufaddiert werden soll, dann besser index_start += ... verwenden.

payloadTextHandling(
payload, G.MQTT_Server,
sizeof(G.MQTT_Server) / sizeof(G.MQTT_Server[0]), index_start);
index_start =
index_start + sizeof(G.MQTT_Server) / sizeof(G.MQTT_Server[0]);
payloadTextHandling(payload, G.MQTT_User,
sizeof(G.MQTT_User) / sizeof(G.MQTT_User[0]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warum das / sizeof(...[0]) hier überall?
Der erste Parameter von payloadTextHandling() ist explizit als uint8_t spezifiziert, also brauchen wir doch nur die Länge in Bytes. Es kommen hier doch nie irgendwelche andere Strukturen rein, bei denen wir die Anzahl Elemente brauchen, oder?
Also reicht das erste sizeof() und wir können das alles hier etwas kürzer und übersichtlicher gestalten.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hallo @tali,

ich habe nun endlich wieder ein Abend gefunden mit der Wordclock zuzuwenden. Ich habe mit die Codepassage genauer angeschaut und paar Änderungen gemacht, sodass der Code nun an dieser stelle wesentlich leichter zu lesen ist. Ich würde mal sagen, so kann man das mergen, was meinst du ?

@dbambus dbambus merged commit 556d6d3 into ESPWortuhr:main Mar 7, 2022
@dbambus dbambus deleted the main_fixed_Mqtt_saveSettings branch March 7, 2022 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MQTT wird falsch gespeichert
2 participants