例程默认是BT例子,先把它改成BLE的工程,修改宏定义即可,修改app_config.h里面的BTDM_STACK_ENABLE_BT为0,然后编译报错,因为里面有提示如果BTDM_STACK_ENABLE_BT为0,另外几个服务也不可使用,找到对应的宏全部改为0即可
![image.png image.png](data/attachment/forum/202502/11/224313tppo20opq10to6z1.png)
2 修改app_ble.c程序完成对米家温湿度计2的扫描和连接
修改扫描的蓝牙名称为米家温湿度计2的广播名称
![image.png image.png](https://static.assets-stash.eet-china.com/forum/202502/11/173928520684468224646gg0kd14s0yekdkep.png)
修改温湿度数据所在UUID
#define SP_CHAR1_UUID 0xCCC1//0xFFF3 john 改成温湿度的uuid
在gatt_callback函数里面处理接收到的温湿度数据
![image.png image.png](https://static.assets-stash.eet-china.com/forum/202502/11/173928529828248224818sds3sss3tx5yos3i.png)
完整的log如下
![image.png image.png](https://static.assets-stash.eet-china.com/forum/202502/11/173928657937760230939bumcmewgv552c1gv.png)
3 修改显示功能
![image.png image.png](https://static.assets-stash.eet-china.com/forum/202502/11/17392866348037231034kt0fr0ixti118x1a.png)
可以看到米家温湿度计2的温度和湿度数据已经传输到FR3068x-C开发板
![image.png image.png](https://static.assets-stash.eet-china.com/forum/202502/11/173928679351495231313fdr6ozes0z8ehzwv.png)