ericklein / air_quality

displays and logs local indoor and outdoor weather and air quality information
MIT License
0 stars 0 forks source link

Generalized and separated all the networking code #53

Closed disquisitioner closed 2 years ago

disquisitioner commented 2 years ago

Rearranged the networking code that had been in the main sketch file (air_quality.ino) so it's in a separate file as a class. This eliminates the need for all the #ifdefs in the main sketch that handled wifi vs. ethernet. All the necessary code for both wifi and ethernet is now implemented in a separate AQ_Network class that handles network differences internally, substantially simplifying the structure of the main sketch. That new class and all those ifdefs are now just in aq_network.cpp (and aq_network.h).

At the same time I modified post_dweet() so it used the generalized network class interface, cleaning up that code and yielding a version that works for both wifi and ethernet (when the previous version only worked with wifi).

ericklein commented 2 years ago

Closing this request so you can pull from master and incorporate master branch changes.