Tệp kê khai – Bluetooth

Thuộc tính tệp kê khai bluetooth khai báo những quyền có sẵn cho API bluetooth.

Tệp manifest.json mẫu

{
  "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
  },
  ...
}

Tài liệu tham khảo

  • uuids (mảng chuỗi) – không bắt buộc

    Thuộc tính tệp kê khai uuids khai báo danh sách các giao thức, hồ sơ và dịch vụ mà một ứng dụng có thể giao tiếp bằng cách sử dụng.

  • socket (boolean) – không bắt buộc

    Nếu là true, hãy cấp quyền cho một ứng dụng sử dụng API bluetoothSocket

  • low_energy (boolean) – không bắt buộc

    Nếu là true, hãy cấp quyền cho một ứng dụng sử dụng API bluetoothLowEnergy

  • peripheral (boolean) – không bắt buộc

    Nếu là true, hãy cấp quyền cho một ứng dụng sử dụng các chức năng quảng cáo trong API bluetoothLowEnergy