資訊清單 - 藍牙

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 廣告功能的權限