mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 11:17:46 +00:00
[coaps] introduce Coap::SecureSession along with Dtls::Transport (#11056)
This commit introduces the `Dtls::Transport` and `Dtls::Session` classes, separating session-related functions from transport-related behaviors. It also introduces the `Coap::SecureSession` class, which handles CoAP processing over a DTLS session. This simplifies the code by allowing `Coap::SecureSession` to inherit many of its methods from `Dtls::Session`, avoiding repetition. It also separates CoAP-specific message processing from transport-related functionality. `Tmf::SecureAgent` and `ApplicationCoapSecure` are updated to act as both a `Dtls::Transport` and a single `Coap::SecureSession`.
This commit is contained in:
@@ -273,8 +273,8 @@ Message::Priority Agent::DscpToPriority(uint8_t aDscp)
|
||||
#if OPENTHREAD_CONFIG_SECURE_TRANSPORT_ENABLE
|
||||
|
||||
SecureAgent::SecureAgent(Instance &aInstance)
|
||||
: Coap::CoapSecureBase(aInstance, mDtls)
|
||||
, mDtls(aInstance, kNoLinkSecurity)
|
||||
: Coap::Dtls::Transport(aInstance, kNoLinkSecurity)
|
||||
, Coap::SecureSession(aInstance, static_cast<Coap::Dtls::Transport &>(*this))
|
||||
{
|
||||
SetResourceHandler(&HandleResource);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user