This completes re-work of all JSON buffer memory management to use HAPOut.
Next up: Stress test with Max Accessories to see how many Accessories we can now handle.
This removes last of large-sized JSON buffers - everything has now been converted to using hapOut.
Next up: Must add prettyPrint to hapOut to support 'd' command
Hashing of entire database is now done piecemeal within HapOut, preventing the need to load the entire database into a large buffer just to obtain a unique hash.
Modified updateDatabase() to use HapOut.getHash()
But declared Streamer inside HomeSpan.h instead of separate Streamer.h since it should only be used when HomeSpan.h is used.
Also, changed class structure so that it is "final" by removing virtual tags and making all protected variables private.
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.
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
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.
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]
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.