Commit Graph

291 Commits

Author SHA1 Message Date
Gregg b7de0cf710 Created Generic PushButton
Wll be used for control button.  Nothing to do with buttons that control Accessories, which are handled by SpanButton.
2020-09-26 16:23:44 -05:00
Gregg 6a2d0741aa Finished 'U' unparing routines
Next Up:  Add method to break out of WiFi connection loop by using push button in case WiFi SSID/PWD has changed but there is no desire to unpair controllers.  To Do:  Move blinking status light setting to named macros.
2020-09-24 09:29:52 -05:00
Gregg 69c7d939b8 Update HomeSpan.cpp
Setup Code now saved after serialConfig() or apConfig().

Next up: Create 'U' command to unpair controller.  Change function of control button so it unpairs (short press) or resets WiFi (long press).

To do:  Revisit statusLED blinking paterns to make sure they are clear and consistent - save them as macros in settings.h
2020-09-23 08:51:13 -05:00
Gregg 7d19df3f69 Added 'S' command to change setup code
Verified all functionality works as expected.  Next Up:  Add this code to both serial and AP network configurations.  To Do: alter 'H' command so it removes controllers (unpairs) but retains HAP ID and other data. - perhaps make this 'U' command?
2020-09-22 08:14:02 -05:00
Gregg c9a661573d Made NVS Handles static variables of HAPClient
Now have nvs_handle hapNVS, wifiNVS, and srpNVS.  All three are opened once in HAPClient::init()
2020-09-22 07:28:02 -05:00
Gregg 446679abab Created SRP6A:createVerifyCode()
This generates an SRP verification code from a setupCode and randomly-generated salt.  Function creates the salt internally and returns both the resulting verification code and salt that was used.  These are stored in NVS permanently.

Next Step: create SRP6A:loadVerifycode()
2020-09-20 22:00:01 -05:00
Gregg b0307c9ab0 Completed WiFi credentials code
WiFi data now set/resest/saved as needed.  Next up: saving/resetting Setup Code.
2020-09-20 08:25:16 -05:00
Gregg d93c45c0bc Updated Network:apConfigure
Improved Robustness - all functionality now completed.
2020-09-19 08:39:27 -05:00
Gregg dd6c8d904a Completed Network::apConfig() 2020-09-15 07:00:31 -05:00
Gregg 123e2924a5 Completed Network::serialConfigure()
Next up: update and complete Network::apConfigure()
2020-09-12 10:06:44 -05:00
Gregg 4a6c737c72 Moving serial wifi update into Network.cpp 2020-09-07 11:02:44 -05:00
Gregg 3da2b9a311 Change Config.cpp to Network.cpp
Move all configuration code into Network.cpp, eliminating any calls or connection to HAP.cpp.  Network.cpp is now standalone for HomeSpan.cpp to call directly to handle ALL apects of WiFI and Setup Code initialization.

Also move TempBuffer from HAP.h to Utils.h so it can be used by Network.h
2020-09-06 08:24:13 -05:00
Gregg af3c093cdc updated configure() 2020-09-04 22:19:14 -05:00
Gregg a5e0b1c0ad cleaning up Configure()
TO DO: Add max length to other form inputs;  try limiting number of connections to exactly 1.  Next:  parse form data and initiate wifi connection.
2020-09-04 07:27:50 -05:00
Gregg 9a80b8fa41 Moved all captive code into Configure.cpp 2020-09-03 21:48:08 -05:00
Gregg efe33fcdb9 Created captiveAccessURL()
Developing captive AP routines inside HAP.cpp
2020-09-01 22:08:51 -05:00
Gregg cd5b3115f5 Further updates to Captive AP Mode 2020-09-01 08:34:59 -05:00
Gregg 705a0922e1 Started work on CaptiveAP
Added span::config(hostName) to provide CaptiveAP at start-up.
2020-08-30 22:07:16 -05:00
Gregg b42dd9dfba Implemented Reset Button
Allows for reset of HAP (press for 5 seconds, but less than 10) or Factory reset (press for 10 second).  Use  setResetPin to change from default of pint 21.
2020-08-23 08:14:31 -05:00
Gregg 2172ac1ce6 Implemented Blinker statusLED
Replaced manual blinking with automated Blinker statusLED
2020-08-22 21:52:25 -05:00
Gregg f056b6ae82 Completed SpanButton()
And finished code for Example 15 to verify SpanButton() works as expected.  To Do: add comments and notes to Example 15.
2020-08-20 21:39:13 -05:00
Gregg c997ca3462 Created Example 15
Initial implementation of SpanButton PushButton object and check() logic
2020-08-20 07:29:15 -05:00
Gregg 6c5a5835e6 Eliminated TimedResets from Library
This is no longer needed since PushButtons can be easily emulated from within a Service loop() as per Example 14.  Library is now fully up-to-date: TimedResets and SpanEvents have been fully removed.
2020-08-17 21:54:43 -05:00
Gregg 9cecc0a31a Updated Example 13
Completed new framework for using loop() methods and deleted all code related to new SpanEvent() and event() loops.  Re-worked Example 13 to utilize new framework and validated it functions as expected.
2020-08-16 21:46:58 -05:00
Gregg 1efeb2880b Created checkNotifications()
This will replace older checkEvents() after testing validates new and improved methodology.
2020-08-16 12:27:39 -05:00
Gregg 53f51cc11b Created new framework for Service loops()
Service loops() called for only those Services with over-ridden loop() methods.  TO DO: update event logic to follow new framework.  Vector should point to all CHARACTERISTICS that are updated to setVal()
2020-08-16 08:45:24 -05:00
Gregg 0ade00eb9a Implemented checkTimedWrites()
This check all timed write PID/TTL entries and clears all those that are expired.  This completes the implementation of Timed Write functionality as required for PUT /prepare requests.
2020-08-14 17:46:35 -05:00
Gregg ffb7b7ed87 Updated putCharacteristics to use Timed Writes
Must next create small routine to clean up expire PIDs - something like: clearPIDs()
2020-08-14 09:59:48 -05:00
Gregg 8d6db796cb Reworking checkEvents()
creating code to allow for multiple characteristics to be updated within event() call.  To Do: define anogther sensor that supports multiple characteristics.  also need to check that "new SpanEvent" works as expected from within a defined service.
2020-08-10 21:59:30 -05:00
Gregg 2e3daef92a Created Example 13
Created checkEvents(), which is a simplified (better) version of checkTimedResets().  To do:  re-write checkTimedResets() to mimic checkEvents();
2020-08-09 22:15:58 -05:00
Gregg e7c2fc46f7 Renamed SpanPut to SpanBuf 2020-08-09 20:33:15 -05:00
Gregg 471d62f3c2 created standalone eventNotify function
putCharacteristics and checkNotifications now both call the same eventNotify routing.  This is being done to prepare for services that will stream notifications back to client (like a temperature sensor, or pushbutton).  TO DO:  rename checkNotifications to check TimedResets, and rename SpanPut to something more generic.
2020-08-09 09:25:10 -05:00
Gregg 1347e4fd5c Added getVal and getNewVal
Updated Example 11 to use getVal and getNewVal, but kept distinction between integer and double Characteristics
2020-08-03 21:23:50 -05:00
Gregg 6646aae799 Fixed bug in updateCharacteristics
Fixed bug that was causing a crash when trying to update to separate services at the same time.
2020-08-01 11:29:15 -05:00
Gregg 0a07f9666d Updated TimedReset
Allow for any characteristic that is not read-only, which should leave out all string characteristics.

Upon reset, zero out all 8 bytes of UVal memory, instead of simply setting UVal.BOOL to false.  This allows use of TimedReset for any characteristic with a numerical value.
2020-08-01 08:32:16 -05:00
Gregg 861a37c7a1 Converted AutoOff to TimedResets 2020-07-29 07:26:13 -05:00
Gregg 59494a129f Added HomeSpan Version number
And added DATE/TIME of Compile
2020-07-29 06:28:24 -05:00
Gregg ce17b08d4d Update HomeSpan.cpp
Added edp-idf version
2020-07-25 22:13:03 -05:00
Gregg 47e7f7b6b4 Converted StatusCode to Class
Converted "statusCode Enum" to "StatusCode Class Enum" and moved from HomeSpan.h to Settings.h
2020-07-24 21:54:09 -05:00
Gregg 8a905c4d35 SpanRange Updated
Updated SpanRange to register itself automatically to the most recent Characteristic.  This is more consistent with the overall framework and no longer requires user to access the range variable directly.
2020-07-19 06:25:09 -05:00
Gregg cccb61f946 Initial commit 2020-07-18 21:47:39 -05:00