Completed adding LIST to HAPClient::postPairingsURL()

HomeSpan now correctly responds to pairing list requests
This commit is contained in:
Gregg 2023-07-29 08:35:01 -05:00
parent 7325baa1a5
commit 17410e825e
2 changed files with 15 additions and 15 deletions

View File

@ -966,14 +966,23 @@ int HAPClient::postPairingsURL(){
tlv8.val(kTLVType_State,pairState_M2); // set State=<M2> tlv8.val(kTLVType_State,pairState_M2); // set State=<M2>
break; break;
case 5: case 5: {
LOG1("List...\n"); LOG1("List...\n");
// NEEDS TO BE IMPLEMENTED - UNSURE IF THIS IS EVER USED BY HOMEKIT TempBuffer <uint8_t> tBuf(listControllers(NULL));
tlv8.clear(); // clear TLV records char *body;
tlv8.val(kTLVType_State,pairState_M2); // set State=<M2> 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
break;
LOG2("\n>>>>>>>>>> ");
LOG2(client.remoteIP());
LOG2(" >>>>>>>>>>\n");
LOG2(body);
listControllers(tBuf.get());
sendEncrypted(body,tBuf.get(),tBuf.len());
free(body);
return(1);
}
default: default:
LOG0("\n*** ERROR: 'Method' TLV record is either missing or not set to either 3, 4, or 5 as required\n\n"); LOG0("\n*** ERROR: 'Method' TLV record is either missing or not set to either 3, 4, or 5 as required\n\n");

View File

@ -554,15 +554,6 @@ void Span::processSerialCommand(const char *c){
switch(c[0]){ switch(c[0]){
case 'Z': {
Serial.printf("\n\n");
TempBuffer <uint8_t> 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': { case 's': {
LOG0("\n*** HomeSpan Status ***\n\n"); LOG0("\n*** HomeSpan Status ***\n\n");