<template>
	<div>
		<div class="closeBtn">
			<u-button type="primary" @click="closeBloone">断开连接</u-button>
			<u-toast ref="uToast"></u-toast>
		</div>
	</div>
</template>

<script>
	import ecBLE from '@/utils/ecBLE/ecBLE.js'
	export default{
		data(){
			return{
				
			}
		},
		methods:{
			closeBloone(){
				let id = getApp().globalData.deviceInfo.id
				ecBLE.stopBluetoothDevicesDiscovery();
				let that = this
				console.log(id);
				uni.closeBLEConnection({
				  deviceId: id,
				  success: function(res) {
					  getApp().globalData.id = ''
					  that.$refs.uToast.show({
						message: "关闭蓝牙连接成功！",
						type: "success",
						icon: false,
					  });
				  },
				})
				// uni.closeBluetoothAdapter({
					
				// })
			}
		}
	}
</script>

<style scoped>
	.closeBtn{
		width: 150px;
		margin: 20px;
	}
</style>