vue app混合开发蓝牙串口连接(报错java.io.IOException: read failed, socket might closed or timeout, read ret: -1;a...

本文介绍了在Vue应用中进行蓝牙串口连接的开发过程,并针对可能出现的java.io.IOException错误提供了解决方案,建议遇到问题的开发者可以尝试使用蓝牙开发助手作为服务端来排查问题。
摘要由CSDN通过智能技术生成
我使用的uni-app
<template>
    <view class="bluetooth">
        <!-- 发送数据 -->
        <view class="send" v-if="send_data_onoff">
            <view class="uni-textarea">
                <textarea placeholder-style="color:#F76260" v-model="send_data_list" placeholder="请输入发送数据"/>
                <view @tap="send_data" class="fasong">发送</view>
            </view>
        </view>
        <!-- 没有匹配的蓝牙设备 -->
        <view class="no_match_bluetooth_list" v-if="no_match_list.length!=0">
            <view class="h1">已搜索的蓝牙:</view>
            <block  v-for="(item,index) in no_match_list" :key="index">
                <view class="uni-list" @tap="search_bluetooth(item.SN)">
                    <view class="uni-list-cell" hover-class="uni-list-cell-hover">
                        <view class="uni-list-cell-navigate uni-navigate-right uni-media-list ">
                            <view class="uni-media-list-body">
                                <view>蓝牙名称:{
   {item.name}}</view>
                                <view>SN:{
   {item.SN}}</view>
                            </view>
                        </view>
                    </view>
                </view>
            </block>
        </view>
        
        <!-- 已匹配的蓝牙设备 -->
        <view class="no_match_bluetooth_list" v-if="match_list.length!=0">
            <view class="h1">已匹配的蓝牙:</view>
            <block  v-for="(item,index) in match_list" :key="index">
                <view class="uni-list" @tap="print(item.SN)">
                    <view class="uni-list-cell" hover-class="uni-list-cell-hover">
                        <view class="uni-list-ce
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值