/* * 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 SD_CARD_HANDLE_H #define SD_CARD_HANDLE_H #include "IHalCpp.h" #include "StatusCode.h" #include "StorageBase.h" #include class SdCardHandle : public VSdCardHalMonitor, virtual public StorageBase { public: SdCardHandle() = default; virtual ~SdCardHandle() = default; void ReportEvent(const SdCardHalStatus &status) override; StatusCode GetSdCardInfo(SdCardInfo &info) override; StatusCode FormatSDCardNow(void) override; void SdCardInit(void); void SdCardUnInit(void); protected: StatusCode SdSaveFile(const std::string &sourceFile, const std::string &savePaht); private: StorageEvent StorageEventConvert(const SdCardHalStatus &status); protected: std::shared_ptr mSdCardHal; }; #endif