/* * 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. */ #include "McuMonitor.h" #include "ILog.h" #include "IMcuManager.h" #include void McuMonitor::Init(std::shared_ptr &monitor) { IMcuManager::GetInstance()->SetMcuMonitor(monitor); } void McuMonitor::UnInit(void) { } void McuMonitor::RecvIpcMissionEvent(std::shared_ptr &recv, const IpcMission &mission) { } void McuMonitor::RecvMcuHeartBeatEvent(std::shared_ptr &recv) { } void McuMonitor::RecvGetIntervalStartEvent(std::shared_ptr &recv) { LogInfo("RecvGetIntervalStartEvent\n"); std::shared_ptr> recvData = std::dynamic_pointer_cast>(recv); if (recvData) { recvData->mDataRecvReply.mHour = 10; recvData->mDataRecvReply.mMin = 10; recvData->mDataRecvReply.mSecond = 10; recv->ReplyFinished(true); } recv->ReplyFinished(false); } void McuMonitor::RecvGetDateTime(std::shared_ptr &recv) { LogInfo("RecvGetDateTime\n"); std::shared_ptr> recvData = std::dynamic_pointer_cast>(recv); if (recvData) { recvData->mDataRecvReply.mYear = 2024; recvData->mDataRecvReply.mMon = 10; recvData->mDataRecvReply.mDay = 10; recvData->mDataRecvReply.mHour = 10; recvData->mDataRecvReply.mMin = 10; recvData->mDataRecvReply.mSecond = 10; recv->ReplyFinished(true); } recv->ReplyFinished(false); } void McuMonitor::RecvGetPirSensitivity(std::shared_ptr &recv) { LogInfo("RecvGetPirSensitivity\n"); std::shared_ptr> recvData = std::dynamic_pointer_cast>(recv); if (recvData) { recvData->mDataRecvReply.mSensitivity = 9; recv->ReplyFinished(true); } recv->ReplyFinished(false); }