Commit Graph

1806 Commits

Author SHA1 Message Date
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
Gregg 713c5c65bf Added new homeSpan.rebootCallback() function
An optional callback used to track the number of times the device reboots, where a reboot is defined as any restart where the uptime was less than a specified number of milliseconds (default=5000)
2023-11-04 10:43:28 -05:00
Gregg 965bdc71b7 Add MAC Address output to RemoteDevice.ino
Prompts user with reminder of which MAC Address to use in Main Device.
2023-11-04 09:36:31 -05:00
HomeSpan fc4b8a077b
Update Reference.md 2023-11-01 11:58:09 -05:00
HomeSpan 4b24f850d6 Update 07-AccessoryNames.ino
fix typo
2023-11-01 11:54:47 -05:00
HomeSpan 30ffc26666
Merge pull request #672 from mgeramb/ImproveExample
Add hint for UTF8 usage for names
2023-11-01 11:50:50 -05:00
Gregg b41fc3ac7e Update HomeSpan.h
Forgot braces in for-loop of autoPoll()
2023-10-31 18:21:16 -05:00
HomeSpan f482dc1b09
Merge pull request #673 from HomeSpan/dev
Moved vTaskDelay(5) from pollTask() to homeSpan.autoPoll()
2023-10-31 18:13:44 -05:00
Gregg 8b3192e122 Moved vTaskDelay(5) from pollTask() to homeSpan.autoPoll()
Adding the vTaskDelay(5) to the code that spawns the separate task is more consistent with how Arduino-ESP32 spawns the main loop() task.
2023-10-31 18:11:09 -05:00
Michael Geramb 869e768ba7 Add hint for UTF8 usage in names 2023-10-31 19:52:49 +01:00
HomeSpan e7a1bb78be
Update Logging.md 2023-10-31 08:06:35 -05:00
Gregg 42f69adf49 Made vTaskDelay(5) in pollTask conditional of using autoPoll()
vTaskDelay(5) is only needed if polling is in its own task.  If calling poll() directly, there is no need for any delay.
2023-10-30 06:29:38 -05:00