Completed adding LIST to HAPClient::postPairingsURL()
HomeSpan now correctly responds to pairing list requests
This commit is contained in:
parent
7325baa1a5
commit
17410e825e
19
src/HAP.cpp
19
src/HAP.cpp
|
|
@ -966,14 +966,23 @@ int HAPClient::postPairingsURL(){
|
|||
tlv8.val(kTLVType_State,pairState_M2); // set State=<M2>
|
||||
break;
|
||||
|
||||
case 5:
|
||||
case 5: {
|
||||
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
|
||||
tlv8.val(kTLVType_State,pairState_M2); // set State=<M2>
|
||||
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");
|
||||
|
|
|
|||
|
|
@ -554,15 +554,6 @@ void Span::processSerialCommand(const char *c){
|
|||
|
||||
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': {
|
||||
|
||||
LOG0("\n*** HomeSpan Status ***\n\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue