您的位置:首页 > 汽车 > 新车 > 苏州政府网站_视频生成网址链接_品牌策略的7种类型_企业培训系统

苏州政府网站_视频生成网址链接_品牌策略的7种类型_企业培训系统

2024/10/6 14:23:21 来源:https://blog.csdn.net/m0_70748845/article/details/142577537  浏览:    关键词:苏州政府网站_视频生成网址链接_品牌策略的7种类型_企业培训系统
苏州政府网站_视频生成网址链接_品牌策略的7种类型_企业培训系统

注册智慧出行连接状态的监听,用于获取业务连接状态的变更。

接口说明

接口名描述
[on] (type: ‘smartMobilityStatus’, smartMobilityTypes: SmartMobilityType[], callback: Callback): void注册智慧出行连接状态的监听。

开发步骤

  1. 导入Car Kit模块。

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

    let awareness: smartMobilityCommon.SmartMobilityAwareness = smartMobilityCommon.getSmartMobilityAwareness();
    
  3. 注册智慧出行连接状态的监听。

// 业务类型
let types: smartMobilityCommon.SmartMobilityType[] = [smartMobilityCommon.SmartMobilityType.HICAR];
// 出行连接状态回调函数
const callBack = (info: smartMobilityCommon.SmartMobilityInfo) => {hilog.info(0x0000, 'Received smart mobility info: ', JSON.stringify(info));
};
// 注册智慧出行连接状态的监听
awareness.on('smartMobilityStatus', types, callBack);

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com