Commit Graph

1868 Commits

Author SHA1 Message Date
Gregg b960c2fdaf Initial integration of local SRP6A into Pair Setup 2023-12-27 17:13:32 -06:00
Gregg da55b9b6b1 Start re-working SRP6A's use in Pair-Setup to make it local instead of global 2023-12-27 14:31:22 -06:00
Gregg beef66eec0 Added new initializer to TempBuffer
Allows TempBuffer to be initialized by concatenation of multiple existing buffers.

Constructor contains pairs of (T *buf), nElements, where last argument MUST BE NULL to signify end of variable argument list.

Will work with any type T, and nElements is in units of elements of type T.
2023-12-26 15:53:38 -06:00
Gregg 223107d8aa Cleaning up postverify 2023-12-26 10:38:33 -06:00
Gregg 6280c17154 Removed all old TLV code 2023-12-25 22:17:08 -06:00
Gregg 3c172da714 Completed and fully tested refactoring of TLV8
Next up: remove old TLV code and clean up
2023-12-25 22:04:02 -06:00
Gregg 76a6a2bde9 Completed postPairSetup and fully tested - also changes TLV8 from vector to forward_list
Changed TLV8 from vector to forward_list to ensure iterators are always retained after adding new elements.

Nest: refactor postPairings
2023-12-25 14:46:11 -06:00
Gregg 0e0f1dcb1c Completed initial re-factoring of postPairSetup - must test! 2023-12-24 17:35:25 -06:00
Gregg edb0cc1be0 added TLV length function
Checks that iterator exists (i.e. does not equal end()) and returns length, else returns -1.  Can be used for checking for both the presence, and length, of a TLV record
2023-12-24 15:22:00 -06:00
Gregg 66e7fc6654 Starting re-factoring of postPairSetup 2023-12-23 21:21:34 -06:00
Gregg fe3389da3b Preparing for re-factoring postPairSetup 2023-12-23 15:59:04 -06:00
Gregg 6e323976fd Completed re-factoring of postPairVerify using new TLV8
Next: re-factor postPairSetup
2023-12-23 15:44:01 -06:00
Gregg 1587f56626 Starting to integrate new TLV8 into postPairVerify 2023-12-23 14:29:53 -06:00
Gregg aa700f94f1 Added new TLV8 class
To do: Refactor HAP.cpp to use new TLV8 class
2023-12-22 12:07:26 -06:00
HomeSpan e715d670e3
Update README.md 2023-12-20 06:39:47 -06:00
HomeSpan 781250b362
Update README.md 2023-12-20 06:39:03 -06:00
HomeSpan 30152e61cf
Update README.md 2023-12-20 06:38:31 -06:00
HomeSpan 503143c355
Update NOW.md 2023-12-20 06:14:35 -06:00
Gregg a6a84b5e21 Added ability to turn off SpanPoint encryption
New class-level method SpanPoint::setEncryption(boolean encrypt).  Default is to use encryption unless method is called with encrypt=false.

With encryption, 7 connections max; without encryption, 20 connections max.
 Serial Monitor provides warnings if connections are exceeded.
2023-12-19 09:08:37 -06:00
Gregg 9708678dcf Update MaxAccessories.ino 2023-11-30 08:45:12 -06:00
Gregg cf0fd7c881 Merge branch 'release-1.8.1-dev' of https://github.com/HomeSpan/HomeSpan into release-1.8.1-dev 2023-11-26 18:19:39 -06:00
Gregg 83ad277aa0 Addressed issue with new Characteristic enum constants 2023-11-26 18:19:36 -06:00
HomeSpan b0243ce28e
Merge pull request #704 from frankonski/ntp_doc_update
Correction to time server URL doc
2023-11-26 17:24:26 -05:00
Francois 37e2e0dcb1 Correction to time server URL doc 2023-11-26 17:04:09 -05:00
Gregg ead05d8690 Added Characteristic Constants
Added constants to Characteristics that describe states.

Example: Characteristic::SecuritySystemTargetState::ARM_STAY
2023-11-25 18:22:59 -06:00
Gregg 70126cb04f Eliminated .get() from TempBuffer objects where possible
Stylistic only.  Cannot remove .get() when a TempBuffer is being re-cast.  Also can't remove .get() when cast can't be determined, such as when used in Serial.printf() [potential to do: explore if this can be addressed, though this is stylistic only and has no impact on code]
2023-11-25 16:48:23 -06:00
Gregg f6ebc1ae22 Changed various static and dynamic stack-based buffers to TempBuffer
Also added casting overload to TempBuffer so that get() method is no longer needed
2023-11-25 16:13:24 -06:00
Gregg c417fe74f7 Create partitions.csv 2023-11-25 10:43:32 -06:00
Gregg 841851d020 Create MaxAccessories.ino
Demonstrates use of custom partition and shows how PSRAM is used in background when available
2023-11-24 18:09:29 -06:00
Gregg c4e88d7df0 Streamlined NVS recall for String values
Avoids need for intermediate variable
2023-11-24 18:05:49 -06:00
Gregg 9e3f6c8303 Override new operator for SpanAccessory, SpanService, and SpanCharacteristic
New Operator now uses PSRAM if available, else uses Internal RAM.  Obviates the need for the ps_new() macro, though will keep definition since it may be useful for any class that does not already override malloc() to use PSRAM.
2023-11-24 10:30:20 -06:00
Gregg b7c294d210 Change NVS storage for Characteristics to always use nvs_set_u64()
Reduces NVS consumption by from 3 to only 1 records when storing numerical values.

Also:  Fixed memory problem in getCharacteristics by replacing dynamically-sized stack buffers with TempBuffer (must do this everywhere), which was causing stack probllem when combination number of Accessories and number of Characteristics got very large.
2023-11-24 09:53:12 -06:00
Gregg 9e0512e48b Address WebLog size issue that limited number of entries
Added logic to sequentially transmit chunks of the HTML response String whenever it grows beyond 1024 bytes.  This ensures the number of WebLog entries does not create a very large HTML String that eats up all the free heap space.  WebLog entries are now only limited by storage of the entries themselves.  Tested successfully with 500 entries.
2023-11-22 06:15:43 -06:00
Gregg 2bc107032c Added HS_REALLOC macro for generalized realloc() when using PSRAM
When using PSRAM, changing the number of Accessories no longer creates any change to heap usage on internal RAM.  The entire Accessory will be stored in PSRAM.
2023-11-21 18:36:51 -06:00
Gregg 458a4fb357 Added ps_new() macro
A more generic version of `new(*ptr)` that allocates from PSRAM if present, otherwise is that same a normal `new`
2023-11-21 18:06:27 -06:00
Gregg 8268e519dd PSRAM: Adds custom allocator and HS_MALLOC/HS_CALLOC macros
Forces all heap requests to be drawn from PSRAM, unless the device does not contain PSRAM.

To do:  Provide easy-to-use NEW() macro; add custom allocator to unordered sets; auto-shrink vectors after updateDatabase()
2023-11-20 21:57:20 -06:00
HomeSpan 77e7ff2b2e
Merge pull request #689 from frankonski/fix_html_weblog
Fixing HTML syntax error in weblogs.
2023-11-15 20:47:33 -05:00
Francois a9578924c2 Fixing HTML syntax error in weblogs. 2023-11-15 08:06:07 -05:00
Gregg 4ab7503a72 Added error checking for NVS storage
Also added NVS storage diagnostic to 'm' command.
2023-11-12 21:37:33 -06:00
Gregg 1e62a038f1 Changed unordered_set to vector when checking for duplicate AID
This eliminated the use of unordered_set everywhere in HomeSpan
2023-11-12 12:33:09 -06:00
Gregg 98d6abeb1f Changed storage of required and optional Characteristics from unordered_set to vector
Significantly reduces memory usage - unordered_sets take up much more memory and using std::find from <algorithm> is as efficient as using find() method of an unordered_set.

To do: Remove all uses of unordered_set across HomeSpan wherever possible
2023-11-12 09:48:46 -06:00
Gregg ae60a84855 Update HAPClient::sendEncrypted() to send individual frames to save memory
Rather than use a large temporary buffer to store all encrypted frames to transmit all at once, each encrypted frame is transmitted as soon as created, which means the temporary buffer only needs to be large enough to store a single encrypted frame.

For a device with a large number of Accessories, this can save 15-20 KB of temporary storage, allowing for more Accessories.

Note this change does not reduce the size of the unencrypted message that is initially produced and can also be quite large.  Potential for future project.
2023-11-11 10:26:25 -06:00
Gregg c1834fb301 Update 07-AccessoryNames.ino 2023-11-11 09:22:56 -06:00
HomeSpan 452558319f
Update README.md 2023-11-06 05:02:52 -06:00
HomeSpan 184b658f5c
Update Reference.md 2023-11-04 16:28:26 -05:00
HomeSpan 92a6391fe5
Update README.md 2023-11-04 16:26:44 -05:00
Gregg 6bfeefcded Merge branch 'release-1.8.1-dev' of https://github.com/HomeSpan/HomeSpan into release-1.8.1-dev 2023-11-04 13:22:21 -05:00
Gregg 6f19141a49 Update src.ino 2023-11-04 13:22:12 -05:00
HomeSpan 68ccfc9858
Update Reference.md 2023-11-04 13:21:23 -05:00
Gregg 1194bd27f6 Update src.ino 2023-11-04 12:52:03 -05:00