postPairingsURL - fix controller update
ensure updating existing controller does retain original permissions
This commit is contained in:
		
							parent
							
								
									62e6913dc2
								
							
						
					
					
						commit
						cb0b722bb1
					
				|  | @ -931,10 +931,11 @@ int HAPClient::postPairingsURL(){ | |||
|       } | ||||
| 
 | ||||
|       if((newCont=findController(tlv8.buf(kTLVType_Identifier)))){ | ||||
|         int originalPermissions=tlv8.val(kTLVType_Permissions); | ||||
|         tlv8.clear();                                         // clear TLV records
 | ||||
|         tlv8.val(kTLVType_State,pairState_M2);                // set State=<M2>
 | ||||
|         if(!memcmp(cPair->LTPK,newCont->LTPK,32)){                       // requested Controller already exists and LTPK matches
 | ||||
|           newCont->admin=tlv8.val(kTLVType_Permissions)==1?true:false;     // update permission of matching Controller
 | ||||
|           newCont->admin=originalPermissions==1?true:false;     // update permission of matching Controller
 | ||||
|         } else { | ||||
|           tlv8.val(kTLVType_Error,tagError_Unknown);         // set Error=Unknown
 | ||||
|         } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Daniel Skowroński
						Daniel Skowroński