当前位置: 首页 > article >正文

鸿蒙开发(NEXT/API 12)【硬件(取消注册智慧出行连接状态的监听)】车载系统

取消注册智慧出行连接状态的监听。

接口说明

接口名描述
[off] (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.CAR_HOP];
// 出行连接状态回调函数
const callBack = (info: smartMobilityCommon.SmartMobilityInfo) => {
  hilog.info(0x0000, 'Received smart mobility info: ', JSON.stringify(info));
};
// 解注册智慧出行连接状态的监听 示例1
// awareness.off('smartMobilityStatus', types);
// 解注册智慧出行连接状态的监听 示例2
awareness.off('smartMobilityStatus', types, callBack);

http://www.kler.cn/news/328636.html

相关文章:

  • 记录Mybatis分页查询排序问题: Encountered unexpected token: “and“ “AND“
  • C++:STL(四)之vector的基本介绍与使用方式|容器接口
  • Python NumPy 数据分析:处理复杂数据的高效方法
  • 数据结构-3.9.栈在递归中的应用
  • React、Vue.js和Angular三大主流框架的选择对比
  • yum使用阿里云的镜像源报错 Failed connect to mirrors.aliyuncs.com:80; Connection refused“
  • 智能工厂非标自动化集成商
  • 【Python】数据可视化之点线图
  • trixbox call php发起电话呼叫
  • Vortex GPGPU的github流程跑通与功能模块波形探索
  • 回执单识别-银行回单识别API-文字识别OCR API
  • 解决 Git LFS 切换分支失败问题
  • Android AMS介绍
  • PCL LocalMaximum消除局部最大的点
  • Egress Gateway 是一个重要的组件,用于管理从服务网格内部到外部服务的流量
  • scrapy快速上手
  • Mybatis-Plus新花样(二)
  • Robot Operating System——带有协方差矩阵的三维空间中的位姿(位置和方向)
  • 基于 Seq2Seq 的中英文翻译项目(pytorch)
  • 番外篇 | 复现AC-YOLOv5,进行自动化织物缺陷检测
  • Mybatis 9种动态 sql 标签使用
  • 基于深度学习的任务序列中的快速适应
  • 基于微信小程序的宿舍报修系统的设计与实现(lw+演示+源码+运行)
  • 正交阵的概念、性质与应用
  • 激光切割机适用材质有哪些
  • 证件照换底色免费
  • Nginx基础详解4(location模块、nginx跨域问题的解决、nginx防盗链的设计原理及应用、nginx模块化解剖)
  • Vue.js 组件开发
  • 【数据库】 MongoDB 查看当前用户的角色和权限
  • C++八股进阶