/* * Copyright (c) 2023 Fancy Code. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MCU_PROTOCOL_H #define MCU_PROTOCOL_H #include "StatusCode.h" #include #include /** * @brief The context of protocol processing is used for the association binding of protocol data transmission and * reception, ensuring the correct logic of protocol question and answer. * */ class VProtocolContext { public: VProtocolContext() = default; virtual ~VProtocolContext() = default; }; template class ProtocolContext : public VProtocolContext { public: ProtocolContext(T &value) : mData(value) {} virtual ~ProtocolContext() = default; public: T mData; }; class VProtocolBase { public: VProtocolBase() = default; virtual ~VProtocolBase() = default; public: virtual size_t WriteData(const void *buff, const size_t buffLength) { return 0; } public: }; class McuProtocol : virtual public VProtocolBase { public: McuProtocol() = default; virtual ~McuProtocol() = default; const StatusCode GetIpcMissiony(std::shared_ptr &context); }; #endif