From 5c1aec2299ea077f01732d7d7f7a4358def7feb9 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Thu, 1 Nov 2018 09:01:54 -0700 Subject: [PATCH] [cli] fix typo in CoapSecure (#3243) --- src/cli/cli.hpp | 4 +- src/cli/cli_coap_secure.cpp | 74 ++++++++++++++++++------------------- src/cli/cli_coap_secure.hpp | 4 +- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/cli/cli.hpp b/src/cli/cli.hpp index 98659d480..d4be3917e 100644 --- a/src/cli/cli.hpp +++ b/src/cli/cli.hpp @@ -99,7 +99,7 @@ struct Command class Interpreter { friend class Coap; - friend class CoapsSecure; + friend class CoapSecure; friend class UdpExample; public: @@ -447,7 +447,7 @@ private: #endif // OPENTHREAD_ENABLE_APPLICATION_COAP #if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE - CoapsSecure mCoapSecure; + CoapSecure mCoapSecure; #endif // OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE }; diff --git a/src/cli/cli_coap_secure.cpp b/src/cli/cli_coap_secure.cpp index e79d5b772..8bceb44f3 100644 --- a/src/cli/cli_coap_secure.cpp +++ b/src/cli/cli_coap_secure.cpp @@ -45,7 +45,7 @@ namespace ot { namespace Cli { -CoapsSecure::CoapsSecure(Interpreter &aInterpreter) +CoapSecure::CoapSecure(Interpreter &aInterpreter) : mInterpreter(aInterpreter) , mShutdownFlag(false) , mUseCertificate(false) @@ -57,7 +57,7 @@ CoapsSecure::CoapsSecure(Interpreter &aInterpreter) memset(&mPskId, 0, sizeof(mPskId)); } -void CoapsSecure::PrintHeaderInfos(otCoapHeader *aHeader) const +void CoapSecure::PrintHeaderInfos(otCoapHeader *aHeader) const { otCoapCode mCoapCode; otCoapType mCoapType; @@ -90,7 +90,7 @@ void CoapsSecure::PrintHeaderInfos(otCoapHeader *aHeader) const static_cast(otCoapHeaderCodeToString(aHeader))); } -void CoapsSecure::PrintPayload(otMessage *aMessage) const +void CoapSecure::PrintPayload(otMessage *aMessage) const { uint8_t buf[kMaxBufferSize]; uint16_t bytesToPrint; @@ -124,7 +124,7 @@ void CoapsSecure::PrintPayload(otMessage *aMessage) const mInterpreter.mServer->OutputFormat("\r\n> "); } -otError CoapsSecure::Process(int argc, char *argv[]) +otError CoapSecure::Process(int argc, char *argv[]) { otError error = OT_ERROR_NONE; bool mVerifyPeerCert = true; @@ -147,9 +147,9 @@ otError CoapsSecure::Process(int argc, char *argv[]) } otCoapSecureSetSslAuthMode(mInterpreter.mInstance, mVerifyPeerCert); SuccessOrExit(error = otCoapSecureStart(mInterpreter.mInstance, OT_DEFAULT_COAP_SECURE_PORT, this)); - otCoapSecureSetClientConnectedCallback(mInterpreter.mInstance, &CoapsSecure::HandleClientConnect, this); + otCoapSecureSetClientConnectedCallback(mInterpreter.mInstance, &CoapSecure::HandleClientConnect, this); #if CLI_COAP_SECURE_USE_COAP_DEFAULT_HANDLER - otCoapSecureSetDefaultHandler(mInterpreter.mInstance, &CoapsSecure::DefaultHandle, this); + otCoapSecureSetDefaultHandler(mInterpreter.mInstance, &CoapSecure::DefaultHandle, this); #endif // CLI_COAP_SECURE_USE_COAP_DEFAULT_HANDLER #ifdef MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED if (mUseCertificate) @@ -231,8 +231,8 @@ otError CoapsSecure::Process(int argc, char *argv[]) sockaddr.mPort = static_cast(value); } - SuccessOrExit(error = otCoapSecureConnect(mInterpreter.mInstance, &sockaddr, - &CoapsSecure::HandleClientConnect, this)); + SuccessOrExit( + error = otCoapSecureConnect(mInterpreter.mInstance, &sockaddr, &CoapSecure::HandleClientConnect, this)); mInterpreter.mServer->OutputFormat("Coap Secure connect: "); } else @@ -244,7 +244,7 @@ otError CoapsSecure::Process(int argc, char *argv[]) { mResource.mUriPath = mUriPath; mResource.mContext = this; - mResource.mHandler = &CoapsSecure::HandleServerResponse; + mResource.mHandler = &CoapSecure::HandleServerResponse; if (argc > 1) { @@ -304,7 +304,7 @@ exit: return error; } -otError CoapsSecure::Stop(void) +otError CoapSecure::Stop(void) { otError error = OT_ERROR_ABORT; otCoapRemoveResource(mInterpreter.mInstance, &mResource); @@ -313,12 +313,12 @@ otError CoapsSecure::Stop(void) return error; } -void OTCALL CoapsSecure::HandleClientConnect(bool aConnected, void *aContext) +void OTCALL CoapSecure::HandleClientConnect(bool aConnected, void *aContext) { - static_cast(aContext)->HandleClientConnect(aConnected); + static_cast(aContext)->HandleClientConnect(aConnected); } -void CoapsSecure::HandleClientConnect(bool aConnected) +void CoapSecure::HandleClientConnect(bool aConnected) { if (aConnected) { @@ -348,15 +348,15 @@ void CoapsSecure::HandleClientConnect(bool aConnected) OT_UNUSED_VARIABLE(aConnected); } -void OTCALL CoapsSecure::HandleServerResponse(void * aContext, - otCoapHeader * aHeader, - otMessage * aMessage, - const otMessageInfo *aMessageInfo) +void OTCALL CoapSecure::HandleServerResponse(void * aContext, + otCoapHeader * aHeader, + otMessage * aMessage, + const otMessageInfo *aMessageInfo) { - static_cast(aContext)->HandleServerResponse(aHeader, aMessage, aMessageInfo); + static_cast(aContext)->HandleServerResponse(aHeader, aMessage, aMessageInfo); } -void CoapsSecure::HandleServerResponse(otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) +void CoapSecure::HandleServerResponse(otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { otError error = OT_ERROR_NONE; otCoapHeader responseHeader; @@ -441,7 +441,7 @@ exit: } } -otError CoapsSecure::ProcessRequest(int argc, char *argv[]) +otError CoapSecure::ProcessRequest(int argc, char *argv[]) { otError error = OT_ERROR_NONE; otMessage * message = NULL; @@ -546,7 +546,7 @@ otError CoapsSecure::ProcessRequest(int argc, char *argv[]) if ((coapType == OT_COAP_TYPE_CONFIRMABLE) || (coapCode == OT_COAP_CODE_GET)) { - error = otCoapSecureSendRequest(mInterpreter.mInstance, message, &CoapsSecure::HandleClientResponse, this); + error = otCoapSecureSendRequest(mInterpreter.mInstance, message, &CoapSecure::HandleClientResponse, this); } else { @@ -565,19 +565,19 @@ exit: return error; } -void OTCALL CoapsSecure::HandleClientResponse(void * aContext, - otCoapHeader * aHeader, - otMessage * aMessage, - const otMessageInfo *aMessageInfo, - otError aError) +void OTCALL CoapSecure::HandleClientResponse(void * aContext, + otCoapHeader * aHeader, + otMessage * aMessage, + const otMessageInfo *aMessageInfo, + otError aError) { - static_cast(aContext)->HandleClientResponse(aHeader, aMessage, aMessageInfo, aError); + static_cast(aContext)->HandleClientResponse(aHeader, aMessage, aMessageInfo, aError); } -void CoapsSecure::HandleClientResponse(otCoapHeader * aHeader, - otMessage * aMessage, - const otMessageInfo *aMessageInfo, - otError aError) +void CoapSecure::HandleClientResponse(otCoapHeader * aHeader, + otMessage * aMessage, + const otMessageInfo *aMessageInfo, + otError aError) { if (aError != OT_ERROR_NONE) { @@ -596,15 +596,15 @@ void CoapsSecure::HandleClientResponse(otCoapHeader * aHeader, } #if CLI_COAP_SECURE_USE_COAP_DEFAULT_HANDLER -void OTCALL CoapsSecure::DefaultHandle(void * aContext, - otCoapHeader * aHeader, - otMessage * aMessage, - const otMessageInfo *aMessageInfo) +void OTCALL CoapSecure::DefaultHandle(void * aContext, + otCoapHeader * aHeader, + otMessage * aMessage, + const otMessageInfo *aMessageInfo) { - static_cast(aContext)->DefaultHandle(aHeader, aMessage, aMessageInfo); + static_cast(aContext)->DefaultHandle(aHeader, aMessage, aMessageInfo); } -void CoapsSecure::DefaultHandle(otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) +void CoapSecure::DefaultHandle(otCoapHeader *aHeader, otMessage *aMessage, const otMessageInfo *aMessageInfo) { OT_UNUSED_VARIABLE(aMessage); diff --git a/src/cli/cli_coap_secure.hpp b/src/cli/cli_coap_secure.hpp index e9c9ee4ab..da1f40354 100644 --- a/src/cli/cli_coap_secure.hpp +++ b/src/cli/cli_coap_secure.hpp @@ -55,7 +55,7 @@ class Interpreter; * This class implements the CLI CoAP Secure server and client. * */ -class CoapsSecure +class CoapSecure { public: /** @@ -64,7 +64,7 @@ public: * @param[in] aInterpreter The CLI interpreter. * */ - CoapsSecure(Interpreter &aInterpreter); + CoapSecure(Interpreter &aInterpreter); /** * This method interprets a list of CLI arguments.