Removed duplicate if(POST /pairings)

This commit is contained in:
Gregg 2023-07-28 19:38:16 -05:00
parent 793f7882b1
commit 131e5b1a92
2 changed files with 10 additions and 12 deletions

View File

@ -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;
@ -1648,7 +1638,7 @@ void HAPClient::removeController(uint8_t *id){
Controller *slot; Controller *slot;
if((slot=findController(id))){ // remove controller if found if((slot=findController(id))){ // remove controller if found
LOG2("\n***Removed Controller: "); LOG2("\n*** Removed Controller: ");
charPrintRow(id,36,2); charPrintRow(id,36,2);
LOG2(slot->admin?" (admin)\n":" (regular)\n"); LOG2(slot->admin?" (admin)\n":" (regular)\n");
slot->allocated=false; slot->allocated=false;
@ -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");
} }

View File

@ -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);