zigbeeAnaloglibrary.jar的使用

本文介绍了如何在Android项目中使用zigbeeAnaloglibrary.jar包来获取四通道独立采集模块的数据。内容包括jar和so文件的添加、串口的打开、数据接收线程的启动,以及在子线程中通过回调函数和Handler更新UI的操作步骤。
摘要由CSDN通过智能技术生成

zigbeeAnaloglibrary.jar包是用来获取四通道独立采集模块中的数据的

首先将jar包和so文件添加到工程,可参考

https://blog.csdn.net/qq_40733723/article/details/89032484
基本步骤
1、初始化ui
2、初始化zigbee
(1)打开串口
(2)如果串口打开成功则开启数据接收线程
3、初始化回调函数,由于子线程无法更新ui,需要发送消息给ui线程
4、创建Handler用来接收子线程发来的消息

xml代码

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="20dp"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="30sp"
        android:textColor="@android:color/black"
        android:text="温度:"/>
    <TextView
        android:id="@+id/tvTemp"
        android:layout_width="wrap_content"
        android:te
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值