当前位置: 首页 > news >正文

房天下网站建设女生说wap是什么意思

房天下网站建设,女生说wap是什么意思,柳州住房和城乡建设厅网站,网上做网站广告投放前言 最近接了一个外包#xff0c;发现了esp32连接小程序会有很多bug#xff0c;所以接下来会慢慢更新解决方案#xff0c;还是需要多接触项目才能进步呀兄弟们#xff01; 附上uuid的生成链接#xff1a; // See the following for generating UUIDs: // https://www.uu…前言 最近接了一个外包发现了esp32连接小程序会有很多bug所以接下来会慢慢更新解决方案还是需要多接触项目才能进步呀兄弟们 附上uuid的生成链接 // See the following for generating UUIDs: // https://www.uuidgenerator.net/ 问题 这里借用一下别人博客遇到的问题。 后面重新开看流程时发现使用 wx.getBLEDeviceCharacteristics的时候有出现了三个特征值以至于报错博主问题原链接 我们可以看到微信小程序维护的也....现在2024年了这个bug还没修好..... 链接 解决办法 问题发现 解决办法只能从esp32代码来入手首先来看看原本的蓝牙连接代码,我们可以看到首先在开头就写了四个uuid特征码来进行蓝牙初始化创建、发送、接收这就是导致问题出现的关键 #define SERVICE_UUID 1596c77c-cf40-4137-9957-d24916f8e50b //你可以通过上面的网址去生成UUID #define CHARACTERISTIC_UUID 1596c77c-cf40-4137-9957-d24916f8e50b #define CHARACTERISTIC_UUID_RX 1596c77c-cf40-4137-9957-d24916f8e50b #define CHARACTERISTIC_UUID_TX 1596c77c-cf40-4137-9957-d24916f8e50bvoid setup() {chipId String((uint32_t)ESP.getEfuseMac(), HEX);chipId.toUpperCase(); // chipid ESP.getEfuseMac(); // Serial.printf(Chip id: %s\n, chipid.c_str());Serial.println(chipId:chipId);Serial.println();Serial.printf(Chip id: %s\n, chipId.c_str());// Create the BLE DeviceBLEDevice::init(xhn_Service);// Create the BLE ServerpServer BLEDevice::createServer();pServer-setCallbacks(new MyServerCallbacks());//随机生成的uuid放入BLEService *pService pServer-createService(SERVICE_UUID);// Create a BLE CharacteristicpTxCharacteristic pService-createCharacteristic(CHARACTERISTIC_UUID_TX, BLECharacteristic::PROPERTY_NOTIFY);pTxCharacteristic-addDescriptor(new BLE2902());BLECharacteristic * pRxCharacteristic pService-createCharacteristic(CHARACTERISTIC_UUID_RX, uuid_RX, BLECharacteristic::PROPERTY_WRITE);pRxCharacteristic-setCallbacks(new MyCallbacks());// Start the servicepService-start();// Start advertisingpServer-getAdvertising()-start();Serial.println(Waiting a client connection to notify...); }String readString;void loop() {if (deviceConnected) {// pTxCharacteristic-setValue(txValue, 1);// pTxCharacteristic-notify();// txValue;// delay(10); // bluetooth stack will go into congestion, if too many packets are sent}while (Serial.available() 0) {if (deviceConnected) {delay(3);readString Serial.read();pTxCharacteristic-setValue(chipId.c_str()); // pTxCharacteristic-setValue((uint32_t)ESP.getEfuseMac());pTxCharacteristic-notify();Serial.println(chipId);}}// disconnectingif (!deviceConnected oldDeviceConnected) {delay(500); // give the bluetooth stack the chance to get things readypServer-startAdvertising(); // restart advertisingSerial.println(start advertising);oldDeviceConnected deviceConnected;}// connectingif (deviceConnected !oldDeviceConnected) {// do stuff here on connectingoldDeviceConnected deviceConnected;} } 问题解决 因为我们初始化接收、发送时传递的都是同一个uuid所以导致特征码重复而报错所以我们就可以在初始化的时候使用一个uuid在发送或接收使用uuid时切换另一个因为获取uuid的目的是为了让小程序绑定设备码所以在初始化的时候我们就可以绑定成功从而uuid的作用就不重要了。 这边以修改接收的uuid为例其实修改一行就解决问题了或者你将发送的UUID的修改成别的uuid也可以只要你在小程序绑定号设备号就行因为设备号是不会改变的。 #define SERVICE_UUID 1596c77c-cf40-4137-9957-d24916f8e50b //你可以通过上面的网址去生成UUID #define CHARACTERISTIC_UUID 1596c77c-cf40-4137-9957-d24916f8e50b #define CHARACTERISTIC_UUID_RX 2abe697b-cad9-409b-802e-624646c3e69c #define CHARACTERISTIC_UUID_TX 1596c77c-cf40-4137-9957-d24916f8e50bvoid setup() {chipId String((uint32_t)ESP.getEfuseMac(), HEX);chipId.toUpperCase(); // chipid ESP.getEfuseMac(); // Serial.printf(Chip id: %s\n, chipid.c_str());Serial.println(chipId:chipId);Serial.println();Serial.printf(Chip id: %s\n, chipId.c_str());// Create the BLE DeviceBLEDevice::init(xhn_Service);// Create the BLE ServerpServer BLEDevice::createServer();pServer-setCallbacks(new MyServerCallbacks());//随机生成的uuid放入BLEService *pService pServer-createService(SERVICE_UUID);// Create a BLE CharacteristicpTxCharacteristic pService-createCharacteristic(CHARACTERISTIC_UUID_TX, BLECharacteristic::PROPERTY_NOTIFY);pTxCharacteristic-addDescriptor(new BLE2902());BLECharacteristic * pRxCharacteristic pService-createCharacteristic(CHARACTERISTIC_UUID_RX, BLECharacteristic::PROPERTY_WRITE);pRxCharacteristic-setCallbacks(new MyCallbacks());// Start the servicepService-start();// Start advertisingpServer-getAdvertising()-start();Serial.println(Waiting a client connection to notify...); }String readString;void loop() {if (deviceConnected) {// pTxCharacteristic-setValue(txValue, 1);// pTxCharacteristic-notify();// txValue;// delay(10); // bluetooth stack will go into congestion, if too many packets are sent}while (Serial.available() 0) {if (deviceConnected) {delay(3);readString Serial.read();pTxCharacteristic-setValue(chipId.c_str()); // pTxCharacteristic-setValue((uint32_t)ESP.getEfuseMac());pTxCharacteristic-notify();Serial.println(chipId);}}// disconnectingif (!deviceConnected oldDeviceConnected) {delay(500); // give the bluetooth stack the chance to get things readypServer-startAdvertising(); // restart advertisingSerial.println(start advertising);oldDeviceConnected deviceConnected;}// connectingif (deviceConnected !oldDeviceConnected) {// do stuff here on connectingoldDeviceConnected deviceConnected;} }
http://www.w-s-a.com/news/876735/

相关文章:

  • 网站开发安全机制北京做网站多少钱合理
  • 扁平化 公司网站建设大型视频网站需要的资金量
  • 免费建各种网站淄博网站建设yx718
  • 凡科网建站入门教程运城市网站建设
  • 黄浦区未成年人思想道德建设网站oa系统是什么
  • 微信里的网站怎么做电子商务网站开发平台
  • 易企秀网站怎么做轮播图网站建设张世勇
  • 网站备案幕布尺寸建立网页的几个步骤
  • pc网站页面找出网站所有死链接
  • 专业做seo的网站网站内连接
  • 阿里云网站开发服务器想开网站建设公司
  • 网站开发不足之处茶叶seo网站推广与优化方案
  • 响应式网站建设系统网站优化怎么做 有什么技巧
  • 班级网站做哪些方面wordpress标签 扩展
  • 如何在电商上购物网站Wordpress 域名授权插件
  • 网站建设后台怎么弄昆明如何做好关键词推广
  • 自己怎么做个网站优酷视频网站开发
  • 2015做网站前景电子商务营销的发展现状
  • 官方网站建设情况说明电子商务网站开发的形式有
  • 网站建设玖金手指排名11专业建站公司建站系统
  • 全球排名前十网站百度网站官网网址
  • 商家在携程旅游网站怎样做宣传做网站公司苏州
  • 芜湖做网站都有哪些广州音乐制作公司
  • 青岛好的网站制作推广注册公司流程步骤
  • 怎么制作营销网站模板wordpress苗木模板
  • 手机网站样例wordpress 排序
  • 济南网站建设手机网站开发人员需要去做原型吗
  • 动易网站模板下载微信支付 wordpress
  • 学校建设外文网站情况阿里云 建设网站怎么样
  • 网站建设与网页设计制作深圳网站建设首选上榜网络