New Features
-
Updated HomeSpan Status logic and functionality for improved diagnostics (#848)
- Added new HS_STATUS enum type HS_CONNECTED
- reflects fully operational state where HomeSpan is connected to a WiFi or Ethernet network, paired to HomeKit and is maintaining one or more secure connections to HomeKit
- Status LED set to steady ON when in this state
- Modified HS_STATUS enum type HS_PAIRED
- reflects potential "No Response" state where HomeSpan is connected to a WiFi or Ethernet network, paired to HomeKit but does not (yet) have any open secure connections to HomeKit
- Status LED set to inverted double-blink when in this state
- Added new
std::pair<HS_STATUS,uint32_t> homeSpan.getStatus()method- returns pair containing:
- current HomeSpan Status as HS_STATUS enum type
- duration (in seconds) since HomeSpan first changed to that Status
- this thread-safe method allows user to actively poll HomeSpan status and duration from the main
loop()as alternative to usinghomeSpan.setStatusCallback()(which is only called when the HomeSpan Status changes)
- returns pair containing:
- Added new
void homeSpan.resetStatusDuration()method- this thread-safe method allows user to reset current HomeSpan Status duration to zero
- Complete re-write of HomeSpan Status documentation
- demonstrates how to use the new methods above
- provides example of using
homeSpan.getStatus()to reboot HomeSpan if the device has lost secure HomeKit connections for an extended period of time - adds table providing graphic representation of all Status LED patterns for each HomeSpan Status state
- adds direct link to this documentation on the main HomeSpan README.md page
- See HS_STATUS.md for details
- Added new HS_STATUS enum type HS_CONNECTED
-
Improvements to Web Log output (#848)
- Added new Client Connections Table (similar output to 's' CLI command)
- used as diagnostic to check whether HomeSpan has any active secure connections to HomeKit
- Added descriptive class names for use with custom style sheets
- body - background and header text (can use bod1 for backwards compatibility)
- infoTable - the top table that provides general information about the device (can use tab1 for backwards compatibility)
- clientTable - the newly-added table listing all active client connections (can use tab2 for backwards compatibility)
- logTable - the bottom table listed all the individual Web Log entries (can also use tab2 for backwards compatibility)
- See Logging.md for details
- Added new Client Connections Table (similar output to 's' CLI command)
-
Created ability to programmatically retrieve base-64 encoded Pairing Data from within a sketch (#1150)
- Added the following two new methods:
const char* homeSpan.getPairingInfo(char **buf)- allocates memory to buf and fills with the HomeSpan's Device Pairing Data
- returns buf, which must be de-allocated with
free(buf)when no longer needed
const char* Controller::getPairingInfo(char **buf)- allocates memory to buf and fills with a Controller's Pairing Data
- returns buf, which must be de-allocated with
free(buf)when no longer needed
- Using these methods duplicates the exact Accessory and Controller Pairing Data provided by the 'P' CLI Command needed to clone devices
- See Reference.md for details on these methods and Cloning.md for a full example
- Added the following two new methods:
-
Added new
boolean homeSpan.usingEthernet()method- returns true if Ethernet interface is being used, else false if WiFi is being used
-
Added new
Span& homeSpan.setControlTimes(uint32_t comTime, uint32_t resTime)method (#1149)- allows users to override HomeSpan's default hold times for the Control Button to trigger entering/exiting the Device Command Mode (default=3000ms) and for triggering a Factory Reset (default=10000ms)
-
Redirected
setVal()out-of-range warnings to WEBLOG instead of LOG0 so these warnings will be displayed in both the Serial Monitor and the Web Log -
Updated
CUSTOM_CHAR()logic so that the HAP range and HAP description are automatically set based on the range and name specified in the macro
Other Updates and Corrections
- Revised User Guide documentation (UserGuide.md) to better align with HomeSpan Status conventions
- also deleted Pages and PDF versions of User Guide since no longer needed
- Added loopTask and pollTask core and priority information to start-up diagnostics
- Corrected HAP nonce logic to utilize the full 64 bits allowed (#1144)
- Started WiFi radio during initialization so it can be used as an entropy source for random number generation (#1144)
- changed DEFAULT_LOW_MEM_THRESHOLD from 80K to 20K for warning message since WiFi is now started earlier
- Added an "invert" mode to the Blinker class that provides additional flashing patterns for the HomeSpan Status LED
- also corrected minor timing-delay mismatch in pattern logic