diff --git a/src/HAP.cpp b/src/HAP.cpp index ad6fe14..2e5c51a 100644 --- a/src/HAP.cpp +++ b/src/HAP.cpp @@ -966,14 +966,23 @@ int HAPClient::postPairingsURL(){ tlv8.val(kTLVType_State,pairState_M2); // set State= break; - case 5: - LOG1("List...\n"); + case 5: { + LOG1("List...\n"); - // NEEDS TO BE IMPLEMENTED - UNSURE IF THIS IS EVER USED BY HOMEKIT + TempBuffer tBuf(listControllers(NULL)); - tlv8.clear(); // clear TLV records - tlv8.val(kTLVType_State,pairState_M2); // set State= - break; + char *body; + asprintf(&body,"HTTP/1.1 200 OK\r\nContent-Type: application/pairing+tlv8\r\nContent-Length: %d\r\n\r\n",tBuf.len()); // create Body with Content Length = size of TLV data + + LOG2("\n>>>>>>>>>> "); + LOG2(client.remoteIP()); + LOG2(" >>>>>>>>>>\n"); + LOG2(body); + listControllers(tBuf.get()); + sendEncrypted(body,tBuf.get(),tBuf.len()); + free(body); + return(1); + } default: LOG0("\n*** ERROR: 'Method' TLV record is either missing or not set to either 3, 4, or 5 as required\n\n"); diff --git a/src/HomeSpan.cpp b/src/HomeSpan.cpp index 082c547..70ab0d2 100644 --- a/src/HomeSpan.cpp +++ b/src/HomeSpan.cpp @@ -554,15 +554,6 @@ void Span::processSerialCommand(const char *c){ switch(c[0]){ - case 'Z': { - Serial.printf("\n\n"); - TempBuffer tBuf(HAPClient::listControllers(NULL)); - Serial.printf("Buffer Size: %d\n",tBuf.len()); - HAPClient::listControllers(tBuf.get()); - HAPClient::hexPrintRow(tBuf.get(),tBuf.len(),0); - break; - } - case 's': { LOG0("\n*** HomeSpan Status ***\n\n");