From 12c6cf3fe19ce06683c71cc11f8991988b07bac4 Mon Sep 17 00:00:00 2001 From: Gregg Date: Mon, 1 Jan 2024 17:35:02 -0600 Subject: [PATCH] Changed HapOut delay from 1ms to 50ms for WiFi transmits. Seems to be much more stable. --- examples/Other Examples/MaxAccessories/MaxAccessories.ino | 4 ++-- src/HAP.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Other Examples/MaxAccessories/MaxAccessories.ino b/examples/Other Examples/MaxAccessories/MaxAccessories.ino index c26521b..927d0aa 100644 --- a/examples/Other Examples/MaxAccessories/MaxAccessories.ino +++ b/examples/Other Examples/MaxAccessories/MaxAccessories.ino @@ -27,7 +27,7 @@ #include "HomeSpan.h" -#define MAX_LIGHTS 2 +#define MAX_LIGHTS 60 struct RGB_Light : Service::LightBulb { @@ -73,7 +73,7 @@ void setup() { Serial.begin(115200); - homeSpan.setLogLevel(2); + homeSpan.setLogLevel(1); homeSpan.enableWebLog(500); homeSpan.begin(Category::Lighting,"HomeSpan Max"); diff --git a/src/HAP.cpp b/src/HAP.cpp index d83a412..3fc126f 100644 --- a/src/HAP.cpp +++ b/src/HAP.cpp @@ -1652,7 +1652,7 @@ void HapOut::HapStreamBuffer::flushBuffer(){ hapClient->client.write(encBuf,num+18); // transmit encrypted frame hapClient->a2cNonce.inc(); // increment nonce } - delay(1); + delay(50); } mbedtls_sha512_update_ret(ctx,(uint8_t *)buffer,num); // update hash