Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Clean up api for serialization, fix bug with config fetching from webserver. #235

Merged
merged 3 commits into from
Dec 15, 2016

Conversation

ed7coyne
Copy link
Collaborator

@ed7coyne ed7coyne commented Dec 9, 2016

Fixed bug where the webserver would close its connection while serving the config. The fix uses more memory due to extra copy but deeper debugging is required to determine whether the bug that is closing the connection is in ArduinoJson or in ESP8266WebServer's client object.

Also cleaned up interface for serialization by making it a class.

…ialization logic cleaner, fix bug where sometimes the connection would be closed while printing the config.

// We need a mutable char array here, otherwise a copy will be made.
void ReadFromJson(char* string);
static Config Deserialize(char* string);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I wonder if you could just have a DeserializeTo(Config& config) w/ a ConfigJsonSerializer ctor that takes a string.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good suggestion, updated the signature.

Copy link
Contributor

@proppy proppy left a comment

Choose a reason for hiding this comment

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

just a question/nit.

* Fixed default config initialization.
* Added Firething call to delete stored config.
@ed7coyne
Copy link
Collaborator Author

Added a couple of other fixes I did from testing on friday.

@ed7coyne ed7coyne merged commit e1c03c5 into FirebaseExtended:master Dec 15, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants