• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (C) 2025 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 #include "cooperate_hisysevent.h"
17 
18 #include "hisysevent.h"
19 
20 #undef LOG_TAG
21 #define LOG_TAG "CooperateHisysevent"
22 namespace OHOS {
23 namespace Msdp {
24 namespace DeviceStatus {
25 namespace {
26     const std::string COOPERTATE_BEHAVIOR { "COOPERTATE_BEHAVIOR" };
27     const std::string ORG_PKG_NAME { "device_status" };
28 } // namespace
29 
ReportCooperateRadarInfo(struct CooperateRadarInfo & cooperateRadarInfo)30 void CooperateRadar::ReportCooperateRadarInfo(struct CooperateRadarInfo &cooperateRadarInfo)
31 {
32     HiSysEventWrite(
33         OHOS::HiviewDFX::HiSysEvent::Domain::MSDP,
34         COOPERTATE_BEHAVIOR,
35         HiviewDFX::HiSysEvent::EventType::BEHAVIOR,
36         "ORG_PKG", ORG_PKG_NAME,
37         "FUNC", cooperateRadarInfo.funcName,
38         "BIZ_STATE", cooperateRadarInfo.bizState,
39         "BIZ_STAGE", cooperateRadarInfo.bizStage,
40         "STAGE_RES", cooperateRadarInfo.stageRes,
41         "BIZ_SCENE", cooperateRadarInfo.bizScene,
42         "ERROR_CODE", cooperateRadarInfo.errCode,
43         "HOST_PKG", cooperateRadarInfo.hostName,
44         "LOCAL_NET_ID", cooperateRadarInfo.localNetId,
45         "PEER_NET_ID", cooperateRadarInfo.peerNetId,
46         "TO_CALL_PKG", cooperateRadarInfo.toCallPkg,
47         "LOCAL_DEV_TYPE", cooperateRadarInfo.localDeviceType,
48         "PEER_DEV_TYPE", cooperateRadarInfo.peerDeviceType);
49 }
50 
51 } // namespace DeviceStatus
52 } // namespace Msdp
53 } // namespace OHOS
54