自学内容网 自学内容网

鸿蒙开发(NEXT/API 12)【硬件(获取出行业务事件信息)】车载系统

获取出行业务事件信息。

接口说明

接口名描述
[getSmartMobilityEvent] (type: SmartMobilityType, eventName: string): Promise获取出行业务事件信息。

开发步骤

  1. 导入Car Kit模块。

    import { smartMobilityCommon } from '@kit.CarKit';
    
  2. 获取SmartMobilityEventAwareness实例。

    let awareness: smartMobilityCommon.SmartMobilityAwareness = smartMobilityCommon.getSmartMobilityAwareness();
    
  3. 获取出行业务事件信息。

// 业务类型
let type = smartMobilityCommon.SmartMobilityType.CAR_HOP;
// 事件名称
let eventName = 'CAR_HOP_EVENT';
// 获取出行业务事件信息
let event: smartMobilityCommon.SmartMobilityEvent = awareness.getSmartMobilityEvent(type, eventName);

原文地址:https://blog.csdn.net/m0_70748845/article/details/142567706

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!