当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Arduino ArduinoBLE - BLE.central()用法及代码示例


查询连接的中央蓝牙®低功耗设备。

用法

BLE.central()

参数

None

返回

  • BLEDevice代表中央。

示例


  // listen for Bluetooth® Low Energy peripherals to connect:
  BLEDevice central = BLE.central();

  // if a central is connected to peripheral:
  if (central) {
    Serial.print("Connected to central: ");
    // print the central's MAC address:
    Serial.println(central.address());

    
  }


相关用法


注:本文由纯净天空筛选整理自arduino.cc大神的英文原创作品 ArduinoBLE - BLE.central()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。