主要流程:
1.初始化蓝牙适配器openBluetoothAdapter,如果不成功就onBluetoothAdapterStateChange监听蓝牙适配器状态变化事件
2.startBluetoothDevicesDiscovery开始搜寻附近的蓝牙外围设备
3.onBluetoothDeviceFound监听寻找到新设备的事件,可以用代码匹配设备
4 .createBLEConnection创建蓝牙连接,顺便在stopBluetoothDevicesDiscovery关闭搜寻附近的蓝牙外围设备
注意:由于系统限制,Android 上获取到的 deviceId 为设备 MAC 地址,iOS 上则为设备 uuid。
5.getBLEDeviceServices获取蓝牙设备所有服务
6.getBLEDeviceCharacteristics获取蓝牙设备某个服务中所有特征值
7.onBLECharacteristicValueChange监听蓝牙设备发送给你的数据
8.writeBLECharacteristicValue向蓝牙设备发送一个0x00的16进制数据或者writeBLECharacteristicValueString发送字符串



![[Linux]开发环境搭建](https://img-blog.csdnimg.cn/img_convert/123baa2d618a90e2b793d89228981a2c.png)








![[MAUI]数据绑定和MVVM:MVVM的属性验证](https://img-blog.csdnimg.cn/img_convert/22c9c9c9cf9242d6fe1f3d873a57e1c5.png#pic_center)







