清单 - 蓝牙

bluetooth 清单属性声明了适用于 Bluetooth 的权限 API。

manifest.json 示例

{
  "name": "My Bluetooth app",
  "bluetooth": {
    // Permission for chrome.bluetoothSocket:
    // The application is allowed to communicate with devices
    // using the protocols, profiles, or services identified by
    // the UUIDs 0x1105 and 0x1106 using the BluetoothSocket API.
    "uuids": [ "1105", "1106" ],
    "socket": true
  },
  ...
}
{
  "name": "My Bluetooth app",
  "bluetooth": {
    // Permission for chrome.bluetoothLowEnergy:
    // The application is allowed to communicate with devices
    // using the profiles identified by the UUIDs 0x180D, 0x1809 and 0x180F
    // using the BluetoothLowEnergy API.
    "uuids": [ "180D", "1809", "180F" ],
    "low_energy": true
  },
  ...
}

参考

  • uuids(字符串数组)- 可选

    uuids 清单属性声明了应用要包含的协议、配置文件和服务的列表 进行通信

  • socket(布尔值)- 可选

    如果为 true,则授权应用使用 bluetoothSocket API

  • low_energy(布尔值)- 可选

    如果为 true,则授权应用使用 bluetoothLowEnergy API

  • peripheral(布尔值)- 可选

    如果为 true,则授权应用使用 bluetoothLowEnergy API