开发者社区
社区提问意见反馈
开发者钉组织
扫描二维码
加入支付宝开发者钉组织
android 开发文档
windows 开发文档
linux 开发文档
iot 小程序开发文档
其它
api
收银台
刷脸核身
刷脸登录
会员与授权
发送付款码
发送和接收小指令
版本查询
获取系统属性
系统设置页面
二维码识别
生成二维码
ui 控制
语音播报
本地数据库
本地图片存储
串口通信
外设管理
打印指令
监听按键事件
身份证读卡器适配
电子秤
钱箱
非接卡通信
ic 卡通信
红外测温仪
消息服务
日志服务
前后屏通信
更多使用指南
开发 > 开放能力接入 > 其它 > api >  > 红外测温仪监听
收藏
订阅更新
我的文档
设置
简介
红外测温仪监听 是监听红外测温仪与主机设备连接状态的 api。主要有以下两个步骤:
1等待红外测温仪的回调。
2结束监听红外测温仪。
接口调用
示例代码
.js 示例代码
javascript
复制代码
page({
data: {
buttons: [
{ method: 'getdeviceid', label: '获取红外测温仪设备id' },
{ method: 'setemittance', label: '设置辐射率' },
{ method: 'setmodel', label: '设置温度模型' },
{ method: 'setautocalibration', label: '设置自动校准' },
],
switch: false,
monitor: false,
src: '',
temperature: ''
},
onload() {
this.setdata({
message: '红外测温仪测试'
});
},
//切换开始/停止监听红外测温仪
togglemonitorir() {
if (this.data.monitor) {
//停止监听红外测温仪
my.ix.offmonitorir({
complete: (r) => {
this.setdata({
message: "已停止监听红外测温仪"
})
},
});
} else {
//开始监听红外测温仪
my.ix.onmonitorir((r) => {
if (r.temperature != null) {
var temp = r.temperature.tostring();
temp = temp.substring(0, temp.indexof('.') 2);
1. 等待红外测温仪的回调
my.ix.onmonitorir
出参
名称
类型
描述
temperature
number
测量到的温度。
heatbitmap
string
bitmap 经过 base64 编码后的字符串。
temperaturelist
json array
所有温度点数据数组。
error
string
错误信息。
onemittancechange
number
模块辐射率。
message
string
模块消息。
2. 结束监听红外测温仪
my.ix.offmonitorir
内容没有解决您的问题?您还可以前往 或 寻求帮助
凯发k8官方网娱乐官方 copyright © 支付宝(杭州)信息技术有限公司  | icp证浙b2-20160559
该文档对你是否有帮助?
当前页面目录
网站地图