Improve:McuManager include cleaner.

This commit is contained in:
Fancy code 2024-06-17 16:46:03 +08:00
parent 5e4354cde0
commit be27463b15
6 changed files with 33 additions and 1 deletions

View File

@ -13,7 +13,8 @@
* limitations under the License. * limitations under the License.
*/ */
#include "McuAskBase.h" #include "McuAskBase.h"
#include "ILog.h" #include "IMcuManager.h"
#include <semaphore.h>
McuAskBase::McuAskBase(const McuAskBlock isBlock, const McuAskReply needReply, const unsigned int timeoutMs) McuAskBase::McuAskBase(const McuAskBlock isBlock, const McuAskReply needReply, const unsigned int timeoutMs)
: mIsBlock(isBlock), mNeedReply(needReply), mTimeout(timeoutMs) : mIsBlock(isBlock), mNeedReply(needReply), mTimeout(timeoutMs)
{ {

View File

@ -14,6 +14,9 @@
*/ */
#include "IMcuManager.h" #include "IMcuManager.h"
#include "ILog.h" #include "ILog.h"
#include "IMcuManager.h"
#include "StatusCode.h"
#include <memory>
mcu_ask_date_time::mcu_ask_date_time(const unsigned short year, const unsigned char mon, const unsigned char day, mcu_ask_date_time::mcu_ask_date_time(const unsigned short year, const unsigned char mon, const unsigned char day,
const unsigned char hour, const unsigned char min, const unsigned char second) const unsigned char hour, const unsigned char min, const unsigned char second)
: mYear(year), mMon(mon), mDay(day), mHour(hour), mMin(min), mSecond(second) : mYear(year), mMon(mon), mDay(day), mHour(hour), mMin(min), mSecond(second)

View File

@ -14,7 +14,19 @@
*/ */
#include "McuDevice.h" #include "McuDevice.h"
#include "ILog.h" #include "ILog.h"
#include "IMcuManager.h"
#include "McuProtocol.h"
#include "StatusCode.h"
#include "UartDevice.h"
#include <chrono>
#include <cstdlib>
#include <list>
#include <memory>
#include <mutex>
#include <stdio.h>
#include <string.h> #include <string.h>
#include <sys/types.h>
#include <thread>
constexpr int SLEEP_TIME_MS = 1000; constexpr int SLEEP_TIME_MS = 1000;
constexpr bool REMOVE_THE_ASK = true; constexpr bool REMOVE_THE_ASK = true;
constexpr bool KEEP_THE_ASK = false; constexpr bool KEEP_THE_ASK = false;

View File

@ -14,7 +14,19 @@
*/ */
#include "McuManagerImpl.h" #include "McuManagerImpl.h"
#include "ILog.h" #include "ILog.h"
#include "IMcuManager.h"
#include "McuAskBase.h" #include "McuAskBase.h"
#include "McuDevice.h"
#include "McuProtocol.h"
#include "StatusCode.h"
#include <chrono>
#include <condition_variable>
#include <functional>
#include <list>
#include <map>
#include <memory>
#include <mutex>
#include <thread>
class McuRecvImpl class McuRecvImpl
{ {
public: public:

View File

@ -14,7 +14,10 @@
*/ */
#include "McuManagerMakePtr.h" #include "McuManagerMakePtr.h"
#include "ILog.h" #include "ILog.h"
#include "IMcuManager.h"
#include "McuManagerImpl.h" #include "McuManagerImpl.h"
#include "StatusCode.h"
#include <memory>
bool CreateMcuManager(void) bool CreateMcuManager(void)
{ {
auto instance = std::make_shared<IMcuManager>(); auto instance = std::make_shared<IMcuManager>();

View File

@ -13,6 +13,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include "UartRecvAsk.h" #include "UartRecvAsk.h"
#include "McuAskBase.h"
UartRecvAsk::UartRecvAsk() : McuAskBase(McuAskBlock::NOT_BLOCK, McuAskReply::NEED_REPLY) UartRecvAsk::UartRecvAsk() : McuAskBase(McuAskBlock::NOT_BLOCK, McuAskReply::NEED_REPLY)
{ {
} }