mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
feat(openthread): modification of uart and spi spinel based on openthread 41ef807
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "esp_err.h"
|
||||
#include "esp_openthread.h"
|
||||
#include "esp_openthread_types.h"
|
||||
#include "hal/uart_types.h"
|
||||
#include "lib/spinel/spinel_interface.hpp"
|
||||
#include "lib/hdlc/hdlc.hpp"
|
||||
#include "openthread/error.h"
|
||||
|
||||
namespace esp {
|
||||
namespace openthread {
|
||||
|
||||
/**
|
||||
* This class defines an template to adapt both UartSpinelInterface and SpiSpinelInterface.
|
||||
*
|
||||
*/
|
||||
template <typename InterfaceType> class SpinelInterfaceAdapter {
|
||||
public:
|
||||
/**
|
||||
* @brief This constructor of object.
|
||||
*/
|
||||
SpinelInterfaceAdapter(void) {}
|
||||
|
||||
/**
|
||||
* @brief This destructor of the object.
|
||||
*
|
||||
*/
|
||||
~SpinelInterfaceAdapter(void) {}
|
||||
|
||||
/**
|
||||
* @brief This method return the underlying spinel interface.
|
||||
*
|
||||
* @return The underlying spinel interface.
|
||||
*
|
||||
*/
|
||||
InterfaceType &GetSpinelInterface(void) { return mSpinelInterface; }
|
||||
|
||||
private:
|
||||
InterfaceType mSpinelInterface;
|
||||
};
|
||||
|
||||
} // namespace openthread
|
||||
} // namespace esp
|
||||
Reference in New Issue
Block a user