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

Add bi-directional (stream + get/set) support and refactoring of the internal classes #330

Merged
merged 17 commits into from
Jun 15, 2018

Conversation

kotl
Copy link
Collaborator

@kotl kotl commented May 8, 2018

  • This refactoring is fully compatible with previous FirebaseArduino.h interface and will use same or less amount of RAM if used in one-way mode (stream-only or get/set only).

  • From now on, you won't need two instances of FirebaseArduino in order to be able to stream and change values at the same time: second https connection will be created dynamically and work while you are using stream mode. Bi-directional operation does require almost twice as much RAM, leaving only about 10k left for vanilla sample in ESP8266. You will also need to use ESP8266 Arduino core 2.4.1 at the very least (that's when bi-directional support became possible due to fixes in https context).

  • Internal classes have been refactored into 2 to simplify development in future.

  • contrib/src/modem was adjusted to use FirebaseArduino, but has not been tested enough. please let me know if you still use it and if you encounter any bugs.

@proppy
Copy link
Contributor

proppy commented May 14, 2018

Thanks for working on this!

Internal classes have been refactored into 2 to simplify development in future.

I wonder if we could simplify further. I don't think we need the extra layer of indirection and we can consolidate Firebase and FirebaseArduino in a single object. (and I'm not even sure we need the FirebaseCall/Stream helper class either).

contrib/src/modem was adjusted to use FirebaseArduino, but has not been tested enough. please let me know if you still use it and if you encounter any bugs.

I think we could deprecate modem (/cc @ed7coyne) and reduce the scope of the project to maintaining the core library.

@@ -37,7 +37,7 @@ class FirebaseArduino {
* \param host Your firebase db host, usually X.firebaseio.com.
* \param auth Optional credentials for the db, a secret or token.
*/
void begin(const String& host, const String& auth = "");
virtual void begin(const String& host, const String& auth = "");
Copy link
Contributor

Choose a reason for hiding this comment

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

curious why this need to be virtual now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • Before virtual functions were in Firebase.h/FirebaseCall/FirebaseStream -> so they can be mocked in mock-firebase.h. Since that went away and modem library had to use FirebaseArduino instead, interface that needed to be mocked had to be declared virtual.
    So if modem library rests in peace -> (or just the unit tests for it) -> it won't be needed.

@kotl
Copy link
Collaborator Author

kotl commented May 15, 2018

We can definitely compact and reduce it further. Let's call it continuous refactoring, this was just the first sprint :)

Btw, can we start tagging changes with version numbers? and maybe add that to release note history?
( I can't do that )

@proppy
Copy link
Contributor

proppy commented May 15, 2018

@kotl let me try to get you added as an admin.

Is that OK if I submit a PR against your branch to make further refactoring? Or would you prefer we do that in separate PRs?

@kotl
Copy link
Collaborator Author

kotl commented May 15, 2018

just sent you invite to my repo. go ahead.

@proppy
Copy link
Contributor

proppy commented Jun 5, 2018

@kotl Sorry for the late reply. I don't want to block this further. So maybe we should merge and keep iterating?

What do you think?

@proppy
Copy link
Contributor

proppy commented Jun 15, 2018

Sorry for the lack of followup: merging this, let's iterate!

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