1 /* 2 * Copyright (c) 2024 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 HISYSEVENT_INTERFACES_NATIVE_INNERKITS_HISYSEVENT_EASY_H 17 #define HISYSEVENT_INTERFACES_NATIVE_INNERKITS_HISYSEVENT_EASY_H 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 enum HiSysEventEasyType { 24 EASY_EVENT_TYPE_FAULT = 1, 25 EASY_EVENT_TYPE_STATISTIC, 26 EASY_EVENT_TYPE_SECURITY, 27 EASY_EVENT_TYPE_BEHAVIOR, 28 }; 29 30 /** 31 * @brief Easy writing sys event 32 * 33 * @param domain event domain 34 * @param name event name 35 * @param eventType event type of the event 36 * @param data customized param data to write 37 * @return 0 means success, others means failure. 38 */ 39 int HiSysEventEasyWrite(const char* domain, const char* name, enum HiSysEventEasyType eventType, const char* data); 40 41 #define OH_HiSysEvent_Easy_Write(domain, name, eventType, data) \ 42 ({ \ 43 int hiSysEventEsayWriteRet2024___ = HiSysEventEasyWrite(domain, name, eventType, data); \ 44 hiSysEventEsayWriteRet2024___; \ 45 }) 46 47 #ifdef __cplusplus 48 } 49 #endif 50 #endif // HISYSEVENT_INTERFACES_NATIVE_INNERKITS_HISYSEVENT_EASY_H