• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef UPDATER_FLASHD_DEFINE_H
17 #define UPDATER_FLASHD_DEFINE_H
18 
19 #include "common.h"
20 #include "flashd/flashd.h"
21 #include "log/log.h"
22 
23 namespace Flashd {
24 #define FLASHD_LOGE(format, ...) Logger(Updater::ERROR, (__FILE_NAME__), (__LINE__), format, ##__VA_ARGS__)
25 #define FLASHD_LOGD(format, ...) Logger(Updater::DEBUG, (__FILE_NAME__), (__LINE__), format, ##__VA_ARGS__)
26 #define FLASHD_LOGI(format, ...) Logger(Updater::INFO, (__FILE_NAME__), (__LINE__), format, ##__VA_ARGS__)
27 #define FLASHD_LOGW(format, ...) Logger(Updater::WARNING, (__FILE_NAME__), (__LINE__), format, ##__VA_ARGS__)
28 }
29 
30 namespace Hdc {
31 constexpr const char *CMDSTR_UPDATE_SYSTEM = "update";
32 constexpr const char *CMDSTR_FLASH_PARTITION = "flash";
33 constexpr const char *CMDSTR_ERASE_PARTITION = "erase";
34 constexpr const char *CMDSTR_FORMAT_PARTITION = "format";
35 constexpr int TASK_UPDATER = TASK_APP + 1;
36 
37 enum FlashdCommander {
38     CMD_UPDATER_UPDATE_INIT = 4000,
39     CMD_UPDATER_FLASH_INIT,
40     CMD_UPDATER_CHECK,
41     CMD_UPDATER_BEGIN,
42     CMD_UPDATER_DATA,
43     CMD_UPDATER_FINISH,
44     CMD_UPDATER_ERASE,
45     CMD_UPDATER_FORMAT,
46     CMD_UPDATER_PROGRESS
47 };
48 }
49 #endif
50