Removed duplicate if(POST /pairings)
This commit is contained in:
parent
793f7882b1
commit
131e5b1a92
16
src/HAP.cpp
16
src/HAP.cpp
|
|
@ -251,16 +251,6 @@ void HAPClient::processRequest(){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!strncmp(body,"POST /pairings ",15) && // POST PAIRINGS
|
|
||||||
strstr(body,"Content-Type: application/pairing+tlv8") && // check that content is TLV8
|
|
||||||
tlv8.unpack(content,cLen)){ // read TLV content
|
|
||||||
tlv8.print(2); // print TLV records in form "TAG(INT) LENGTH(INT) VALUES(HEX)"
|
|
||||||
LOG2("------------ END TLVS! ------------\n");
|
|
||||||
|
|
||||||
postPairingsURL(); // process URL
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
notFoundError();
|
notFoundError();
|
||||||
LOG0("\n*** ERROR: Bad POST request - URL not found\n\n");
|
LOG0("\n*** ERROR: Bad POST request - URL not found\n\n");
|
||||||
return;
|
return;
|
||||||
|
|
@ -1660,10 +1650,14 @@ void HAPClient::removeController(uint8_t *id){
|
||||||
|
|
||||||
STATUS_UPDATE(start(LED_PAIRING_NEEDED),HS_PAIRING_NEEDED)
|
STATUS_UPDATE(start(LED_PAIRING_NEEDED),HS_PAIRING_NEEDED)
|
||||||
|
|
||||||
if(homeSpan.pairCallback) // if set, invoke user-defined Pairing Callback to indicate device has been paired
|
if(homeSpan.pairCallback) // if set, invoke user-defined Pairing Callback to indicate device has been un-paired
|
||||||
homeSpan.pairCallback(false);
|
homeSpan.pairCallback(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG2("\n");
|
||||||
|
} else {
|
||||||
|
LOG2("\n*** Request to Remove Controller Ignored - Controller Not Found: ");
|
||||||
|
charPrintRow(id,36,2);
|
||||||
LOG2("\n");
|
LOG2("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,10 @@ void setup() {
|
||||||
// homeSpan.setControlPin(21);
|
// homeSpan.setControlPin(21);
|
||||||
|
|
||||||
homeSpan.setLogLevel(2);
|
homeSpan.setLogLevel(2);
|
||||||
|
// homeSpan.reserveSocketConnections(10);
|
||||||
|
|
||||||
|
// homeSpan.setApSSID("HS_Setup");
|
||||||
|
// homeSpan.setApPassword("");
|
||||||
|
|
||||||
// .setStatusPin(13);
|
// .setStatusPin(13);
|
||||||
// homeSpan.setSerialInputDisable(true);
|
// homeSpan.setSerialInputDisable(true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue