[coaps] CoAP Secure Client/Server accessible through OT API (#2716)

This commit is contained in:
Christian Stauffer
2018-09-24 23:22:08 +02:00
committed by Jonathan Hui
parent 5fe9038e33
commit 2ce47a8e9c
28 changed files with 2838 additions and 45 deletions
+21
View File
@@ -80,6 +80,10 @@
#include "cli_coap.hpp"
#endif
#if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
#include "cli_coap_secure.hpp"
#endif
#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_DEBUG_UART) && OPENTHREAD_POSIX
#include <openthread/platform/debug_uart.h>
#endif
@@ -106,6 +110,9 @@ const struct Command Interpreter::sCommands[] = {
#if OPENTHREAD_ENABLE_APPLICATION_COAP
{"coap", &Interpreter::ProcessCoap},
#endif
#if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
{"coaps", &Interpreter::ProcessCoapSecure},
#endif
#if OPENTHREAD_ENABLE_COMMISSIONER && OPENTHREAD_FTD
{"commissioner", &Interpreter::ProcessCommissioner},
#endif
@@ -287,6 +294,9 @@ Interpreter::Interpreter(Instance *aInstance)
#if OPENTHREAD_ENABLE_APPLICATION_COAP
, mCoap(*this)
#endif
#if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
, mCoapSecure(*this)
#endif
{
#ifdef OTDLL
assert(mApiInstance);
@@ -649,6 +659,17 @@ void Interpreter::ProcessCoap(int argc, char *argv[])
#endif // OPENTHREAD_ENABLE_APPLICATION_COAP
#if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
void Interpreter::ProcessCoapSecure(int argc, char *argv[])
{
otError error;
error = mCoapSecure.Process(argc, argv);
AppendResult(error);
}
#endif // OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
#if OPENTHREAD_FTD
void Interpreter::ProcessContextIdReuseDelay(int argc, char *argv[])
{