From 4e4108fe1c3365a52874a5f37dd4cbf60a6d848b Mon Sep 17 00:00:00 2001 From: Gregg Date: Sat, 1 Aug 2020 08:38:44 -0500 Subject: [PATCH] Move "SENT ENCRYPTED" Log2 message Added message to sendEncrypted function, instesd of having is repeated everywhere. --- src/HAP.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/HAP.cpp b/src/HAP.cpp index 8c7d037..80a898c 100644 --- a/src/HAP.cpp +++ b/src/HAP.cpp @@ -800,9 +800,7 @@ int HAPClient::getAccessoriesURL(){ LOG2("\n"); sendEncrypted(body,(uint8_t *)jBuf.buf,nBytes); - - LOG2("-------- SENT ENCRYPTED! --------\n"); - + return(1); } // getAccessories @@ -1020,9 +1018,7 @@ int HAPClient::getCharacteristicsURL(char *urlBuf){ LOG2("\n"); sendEncrypted(body,(uint8_t *)jsonBuf,nBytes); // note recasting of jsonBuf into uint8_t* - - LOG2("-------- SENT ENCRYPTED! --------\n"); - + return(1); } @@ -1064,9 +1060,7 @@ int HAPClient::putCharacteristicsURL(char *json){ LOG2(body); sendEncrypted(body,NULL,0); - - LOG2("-------- SENT ENCRYPTED! --------\n"); - + } else { // multicast respose is required int nBytes=homeSpan.sprintfAttributes(pObj,n,NULL); // get JSON response - includes terminating null (will be recast to uint8_t* below) @@ -1086,7 +1080,6 @@ int HAPClient::putCharacteristicsURL(char *json){ sendEncrypted(body,(uint8_t *)jsonBuf,nBytes); // note recasting of jsonBuf into uint8_t* - LOG2("-------- SENT ENCRYPTED! --------\n"); } // Create and send Event Notifications if needed @@ -1225,7 +1218,6 @@ void HAPClient::tlvRespond(){ LOG2("------------ SENT! --------------\n"); } else { sendEncrypted(body,tlvData,nBytes); - LOG2("-------- SENT ENCRYPTED! --------\n"); } } // tlvRespond @@ -1305,7 +1297,9 @@ void HAPClient::sendEncrypted(char *body, uint8_t *dataBuf, int dataLen){ } client.write(httpBuf,count); // transmit all encrypted frames to Client - + + LOG2("-------- SENT ENCRYPTED! --------\n"); + } // sendEncrypted /////////////////////////////////////////////////////////////////////////////////