微信小程序报错:notifyBLECharacteristicValueChange:fail:nodescriptor的解决办法

文章目录

一、发现问题

微信小程序报错:notifyBLECharacteristicValueChange:fail:nodescriptor

二、分析问题

这个提示有点问题,应该是该Characteristic的Descriptor有问题,而不能说nodescriptor。

描述符的类型不能是0x2901的Characteristic User Description。

应该是0x2902的Client Characteristic Configuration

二、解决问题

修改蓝牙设备的Descriptor UUID即可。

不同的Descriptor UUID定义如下。

c 复制代码
#define ESP_GATT_UUID_CHAR_EXT_PROP                 0x2900          /*  Characteristic Extended Properties */
#define ESP_GATT_UUID_CHAR_DESCRIPTION              0x2901          /*  Characteristic User Description*/
#define ESP_GATT_UUID_CHAR_CLIENT_CONFIG            0x2902          /*  Client Characteristic Configuration */
#define ESP_GATT_UUID_CHAR_SRVR_CONFIG              0x2903          /*  Server Characteristic Configuration */
#define ESP_GATT_UUID_CHAR_PRESENT_FORMAT           0x2904          /*  Characteristic Presentation Format*/
#define ESP_GATT_UUID_CHAR_AGG_FORMAT               0x2905          /*  Characteristic Aggregate Format*/
#define ESP_GATT_UUID_CHAR_VALID_RANGE              0x2906          /*  Characteristic Valid Range */
#define ESP_GATT_UUID_EXT_RPT_REF_DESCR             0x2907          /*  External Report Reference */
#define ESP_GATT_UUID_RPT_REF_DESCR                 0x2908          /*  Report Reference */
#define ESP_GATT_UUID_NUM_DIGITALS_DESCR            0x2909          /*  Number of Digitals */
#define ESP_GATT_UUID_VALUE_TRIGGER_DESCR           0x290A          /*  Value Trigger Setting */
#define ESP_GATT_UUID_ENV_SENSING_CONFIG_DESCR      0x290B          /*  Environmental Sensing Configuration */
#define ESP_GATT_UUID_ENV_SENSING_MEASUREMENT_DESCR 0x290C          /*  Environmental Sensing Measurement */
#define ESP_GATT_UUID_ENV_SENSING_TRIGGER_DESCR     0x290D          /*  Environmental Sensing Trigger Setting */
#define ESP_GATT_UUID_TIME_TRIGGER_DESCR            0x290E          /*  Time Trigger Setting */

修改后,微信小程序的报错就消失了。

觉得好,就一键三连呗(点赞+收藏+关注)

相关推荐
前端小万3 天前
写公众号赚了 3000 块后,我做了一款叫 "一键成稿" 的软件
前端·微信小程序
拖孩3 天前
代码我能全交给 AI,流量主这 500 个访客它一个都替不了我
前端·后端·微信小程序
甜到心里的蛋糕3 天前
如何用企业微信实现让微信收到通知实时通知
服务器·python·微信小程序·fastapi
2601_963870203 天前
基于springboot的综合网上购物商场系统
微信小程序·小程序·课程设计
2601_963869954 天前
力序健身房管理系统
微信小程序·小程序
拖孩4 天前
给小程序加「一键发公众号贴图」,我把 wx.shareToOfficialAccount 的三个坑趟了一遍
前端·后端·微信小程序
K成长日志5 天前
BLE链路层-隐私保护
网络·物联网·蓝牙·iot·ble
K成长日志5 天前
BLE链路层-Feature Support
网络·嵌入式·无线通信·蓝牙·iot·ble
StevenLdh5 天前
第四期 · 云端同步与冲突仲裁:离线可写、多端一致的工程解法
java·微信小程序
m0_462803885 天前
会议签到如何设置手写签名?从创建签到到导出签名 PDF 的完整流程
微信小程序