Arduino 101-BLE查询:特征和广告

Arduino 101-BLE查询:特征和广告,arduino,bluetooth-lowenergy,Arduino,Bluetooth Lowenergy,我对Arduino 101上的BLE外围设备有以下疑问: 可以公布任何特征值(动态数据),而不是公布数据包中的UUID。如果是的话,有哪些API?我的目标是获取adv数据包中的任何温度数据,而不是连接到外围设备 当前观察结果:我只能使用API setAdvertisedServiceUuid和setLocalName发布服务UUID和本地名称 2.在下面的代码中,我能够在第一个实例中启动并捕获广告,但在letter实例中,begin的返回值为false。我做错什么了吗?其目的是启动和停止广告,甚

我对Arduino 101上的BLE外围设备有以下疑问:

  • 可以公布任何特征值(动态数据),而不是公布数据包中的UUID。如果是的话,有哪些API?我的目标是获取adv数据包中的任何温度数据,而不是连接到外围设备
  • 当前观察结果:我只能使用API setAdvertisedServiceUuid和setLocalName发布服务UUID和本地名称

    2.在下面的代码中,我能够在第一个实例中启动并捕获广告,但在letter实例中,begin的返回值为false。我做错什么了吗?其目的是启动和停止广告,甚至可能更改广告数据

    #include <CurieBle.h>
    
    
    void setup() {  
        // set LED pin to output mode
        pinMode(ledPin, OUTPUT);
        Serial.begin(9600); 
    }
    
    void loop() {  
        //BLE Peripheral
        BLEPeripheral * blePeripheral = new BLEPeripheral; 
    
        //Set the Local Name
        blePeripheral->setLocalName("MyDevice");
    
        //Start Advertising
        blePeripheral->begin();
    
        //Run the advertisement for 20 seconds
        delay(20000);
    
        //Stop the advertisement
        blePeripheral->end();
    
        //Delete the BLE Peripheral
        delete blePeripheral;
    
        //Wait 5 seconds before starting the next adv
        delay(5000);
    }
    
    #包括
    无效设置(){
    //将LED引脚设置为输出模式
    引脚模式(LED引脚,输出);
    Serial.begin(9600);
    }
    void loop(){
    //可编程外围设备
    BLEPERIAL*BLEPERIAL=新BLEPERIAL;
    //设置本地名称
    blePeripheral->setLocalName(“我的设备”);
    //开始做广告
    blepheripal->begin();
    //播放广告20秒
    延迟(20 000);
    //停止广告
    blepheripal->end();
    //删除可删除的外围设备
    删除外围设备;
    //等待5秒钟,然后启动下一个adv
    延迟(5000);
    }
    
    任何帮助都将不胜感激

    谢谢。 施华洛普

    BLEPeripheral blePeripheral;  // BLE Peripheral Device (the board you're programming)
    BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // BLE LED Service
    
    // BLE LED Switch Characteristic - custom 128-bit UUID, read and writable by central
    BLEUnsignedCharCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);