diff --git a/src/HomeSpan.cpp b/src/HomeSpan.cpp index 9fade12..f44cc35 100644 --- a/src/HomeSpan.cpp +++ b/src/HomeSpan.cpp @@ -70,7 +70,9 @@ void Span::begin(Category catID, const char *displayName, const char *hostNameBa Serial.print("\nStatus LED: Pin "); Serial.print(statusPin); Serial.print("\nDevice Control: Pin "); - Serial.print(controlPin); + Serial.print(controlPin); + Serial.print("\nSketch Version: "); + Serial.print(getSketchVersion()); Serial.print("\nHomeSpan Version: "); Serial.print(HOMESPAN_VERSION); Serial.print("\nESP-IDF Version: "); @@ -422,6 +424,10 @@ void Span::checkConnect(){ else mdns_service_txt_item_set("_hap","_tcp","sf","0"); // set Status Flag = 0 + mdns_service_txt_item_set("_hap","_tcp","hspn",HOMESPAN_VERSION); // HomeSpan Version Number (info only - NOT used by HAP) + mdns_service_txt_item_set("_hap","_tcp","sketch",sketchVersion); // Sketch Version (info only - NOT used by HAP) + mdns_service_txt_item_set("_hap","_tcp","ota",otaEnabled?"yes":"no"); // OTA Enabled (info only - NOT used by HAP) + uint8_t hashInput[22]; uint8_t hashOutput[64]; char setupHash[9]; diff --git a/src/HomeSpan.h b/src/HomeSpan.h index c84e6eb..ac11576 100644 --- a/src/HomeSpan.h +++ b/src/HomeSpan.h @@ -87,6 +87,7 @@ struct Span{ String configLog; // log of configuration process, including any errors boolean isBridge=true; // flag indicating whether device is configured as a bridge (i.e. first Accessory contains nothing but AccessoryInformation and HAPProtocolInformation) HapQR qrCode; // optional QR Code to use for pairing + const char *sketchVersion="n/a"; // version of the sketch boolean connected=false; // WiFi connection status unsigned long waitTime=60000; // time to wait (in milliseconds) between WiFi connection attempts @@ -153,6 +154,8 @@ struct Span{ void setPortNum(uint16_t port){tcpPortNum=port;} // sets the TCP port number to use for communications between HomeKit and HomeSpan void setQRID(const char *id); // sets the Setup ID for optional pairing with a QR Code void enableOTA(){otaEnabled=true;} // enables Over-the-Air updates + void setSketchVersion(const char *sVer){sketchVersion=sVer;} // set optional sketch version number + const char *getSketchVersion(){return sketchVersion;} // get sketch version number }; /////////////////////////////// diff --git a/src/src.ino b/src/src.ino index d337fbf..6df17bf 100644 --- a/src/src.ino +++ b/src/src.ino @@ -15,6 +15,7 @@ void setup() { homeSpan.setMaxConnections(16); // homeSpan.setQRID("One1"); homeSpan.enableOTA(); + homeSpan.setSketchVersion("Test 1.2.3"); homeSpan.begin(Category::Lighting,"HomeSpanTest");