บลูทูธพลังงานต่ำ (BLE) ซึ่งพร้อมใช้งานใน Android 4.3 ขึ้นไปจะสร้าง
การเชื่อมต่อระยะสั้นระหว่างอุปกรณ์เพื่อโอนข้อมูลเป็นชุด BLE
จะยังคงอยู่ในโหมดสลีปเมื่อไม่ได้เชื่อมต่อ ซึ่งช่วยให้ BLE มีแบนด์วิดท์ต่ำกว่า
และใช้พลังงานน้อยลงเมื่อเทียบกับบลูทูธคลาสสิก
BLE เหมาะสำหรับแอปต่างๆ เช่น เครื่องวัดอัตราการเต้นของหัวใจหรือคีย์บอร์ดไร้สาย
หากต้องการใช้ BLE อุปกรณ์จะต้องมีชิปเซ็ตที่รองรับ BLE
การใช้งาน
โปรไฟล์แอป BLE ปัจจุบันทั้งหมดอิงตาม
Generic
Attribute (GATT) Profile เมื่ออุปกรณ์ที่ใช้ Android โต้ตอบกับ
อุปกรณ์ BLE อุปกรณ์ที่ส่งข้อมูลจะเป็นเซิร์ฟเวอร์ และ
อุปกรณ์ที่รับข้อมูลจะเป็นไคลเอ็นต์ Android มี
API สำหรับนักพัฒนาแอปสำหรับ BLE ซึ่งรวมถึง API สำหรับการโต้ตอบระหว่าง
เซิร์ฟเวอร์ GATT และไคลเอ็นต์ GATT หากต้องการใช้ประโยชน์จาก BLE API อย่างเต็มที่
ให้ใช้
ข้อกำหนด HCI ของบลูทูธใน Android
โหมดอุปกรณ์
เมื่อใช้ BLE อุปกรณ์ที่ใช้ Android จะทำหน้าที่เป็นอุปกรณ์ต่อพ่วง
อุปกรณ์ส่วนกลาง หรือทั้ง 2 อย่างได้ โหมดอุปกรณ์ต่อพ่วงช่วยให้อุปกรณ์ส่ง
แพ็กเก็ตโฆษณาได้ โหมดกลางช่วยให้อุปกรณ์สแกนหา
โฆษณาได้ อุปกรณ์ Android ที่ทำหน้าที่เป็นทั้งอุปกรณ์ต่อพ่วงและ
อุปกรณ์ส่วนกลางจะสื่อสารกับอุปกรณ์ต่อพ่วง BLE อื่นๆ ได้ขณะ
ส่งโฆษณาในโหมดอุปกรณ์ต่อพ่วง อุปกรณ์ที่รองรับ
บลูทูธ 4.1 และต่ำกว่าจะใช้ BLE ได้ในโหมดกลางเท่านั้น ชิปเซ็ตของอุปกรณ์รุ่นเก่า
อาจไม่รองรับโหมดอุปกรณ์ต่อพ่วง BLE
การสแกน BLE
อุปกรณ์ที่ใช้ Android สามารถกำหนดเป้าหมายและสแกนหาอุปกรณ์บลูทูธที่เฉพาะเจาะจงได้อย่างมีประสิทธิภาพมากขึ้นเมื่อใช้ BLE
BLE API ช่วยให้นักพัฒนาแอปสร้าง
ตัวกรองเพื่อค้นหาอุปกรณ์โดยที่โฮสต์
คอนโทรลเลอร์ไม่ต้องเข้ามาเกี่ยวข้องมากนัก
Android 6.0 ขึ้นไปมีการสแกน BLE และการจับคู่ตัวกรองใน
ตัวควบคุมบลูทูธ อุปกรณ์สามารถกรองผลการสแกนและ
รายงานเหตุการณ์พบและสูญหาย
ที่เกี่ยวข้องกับอุปกรณ์ BLE ไปยัง Application Processor (AP) การกรอง
ยังใช้ได้กับการสแกนเป็นชุดด้วย ซึ่งจะช่วยประหยัดพลังงานเนื่องจากอุปกรณ์
จะส่งต่อการสแกน BLE ไปยังเฟิร์มแวร์ การสแกนเป็นกลุ่มจะช่วยลดความถี่ที่ AP จะตื่นขึ้นเนื่องจากการสแกน BLE เพื่อหาอุปกรณ์หรือบีคอน
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-08-22 UTC"],[],[],null,["Bluetooth Low Energy (BLE), available in Android 4.3 and higher, creates\nshort connections between devices to transfer bursts of data. BLE remains\nin sleep mode when not connected. This lets BLE provide lower bandwidth and\nreduced power consumption compared to Classic Bluetooth. BLE is ideal for\napps such as a heart-rate monitor or a wireless keyboard. To use BLE,\ndevices need to have a chipset that supports BLE.\n\nImplementation\n\nAll current BLE app profiles are based on the\n[Generic Attribute (GATT) Profile](https://www.bluetooth.com/specifications/gatt).\nWhen an Android-powered device interacts with a BLE device, the device that\nsends information is the server and the device that receives information is\nthe client. Android includes\n[developer APIs for BLE](https://developer.android.com/guide/topics/connectivity/bluetooth-le),\nincluding APIs for interactions between GATT servers and GATT clients. To\ntake full advantage of the BLE APIs, implement the\n[Android Bluetooth HCI Requirements](/docs/core/connect/bluetooth/hci_requirements).\n\nDevice modes\n\nWhen using BLE, an Android-powered device can act as a peripheral device, a\ncentral device, or both. Peripheral mode lets devices send advertisement\npackets. Central mode lets devices scan for advertisements. An Android\ndevice acting as both a peripheral and central device can communicate with\nother BLE peripheral devices while sending advertisements in peripheral\nmode. Devices supporting Bluetooth 4.1 and lower can use BLE only in\ncentral mode. Older device chipsets might not support BLE peripheral mode.\n\nBLE scanning\n\nAn Android-powered device can target and scan for specific Bluetooth devices\nmore efficiently when using BLE. BLE APIs let app developers create filters\nfor finding devices with less involvement from the host controller.\n| **Caution:** BLE scanning typically needs location permissions because BLE scanning identifies objects that can be used for geolocation. Turning off location services turns off Bluetooth scanning. n Android 12 and higher, apps that declare `neverForLocation` can get Bluetooth scanning results even when location services are off. For more details, see [Tristate location permissions](/docs/core/permissions/tristate-perms).\n\nLocation scanning\n\nA device's location services can use Bluetooth to detect Bluetooth beacons\nand provide a more accurate location. This is how users enable the feature:\n\n1. Go to **Settings** \\\u003e **Security \\& Location** \\\u003e **Location**.\n2. Check that the Location **On** /**Off** toggle is in the **On** position.\n3. Go to **Mode**.\n4. Select either **High accuracy** or **Battery saving** mode.\n\nIn Android 11 and lower, individual apps require location permissions to use\nBLE scanning, even if they're scanning only to find devices to connect to.\nIf the user disables location scanning, or doesn't grant an app location\npermissions, then the app won't receive any BLE scanning results.\n\nIn Android 12 and higher, the\n[`BLUETOOTH_SCAN`](https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_SCAN),\n[`BLUETOOTH_ADVERTISE`](https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_ADVERTISE),\nand\n[`BLUETOOTH_CONNECT`](https://developer.android.com/reference/android/Manifest.permission#BLUETOOTH_CONNECT)\npermissions can allow apps to scan for nearby devices without needing to\nrequest the location permission. For more information, see\n[Bluetooth permissions](https://developer.android.com/about/versions/12/features/bluetooth-permissions).\n\nUsers can disable system-level Bluetooth background scanning by going to\n**Settings** \\\u003e **Security \\& Location** \\\u003e **Location** \\\u003e **Scanning** and\nclicking the **Bluetooth scanning** toggle to the off position. This\ndoesn't affect BLE scanning for location or local devices.\n\nFilter scan results\n\nAndroid 6.0 and higher includes BLE scanning and filter-matching on the\nBluetooth controller. A device can filter scan results and report\n**found** and **lost** events related to BLE devices to the application\nprocessor (AP). Filtering also works for batch scans, which helps save\npower as the device offloads BLE scanning to the firmware. Batch scans\nreduce how often the AP wakes up due to BLE scanning for devices or\nbeacons.\n\nThe `OnFound`/`OnLost` feature is implemented in the Bluetooth controller\nand then tested to confirm that BLE devices aren't missed in scans. This\nprovides power savings, and it can also provide the following benefits:\n\n- For an `OnFound` event, the main AP wakes up upon the discovery of a specific device.\n- For an `OnLost` event, the AP wakes up when a specific device can't be found.\n- Framework apps get fewer unwanted notifications when a nearby device is in range.\n- Continuous scans enable framework apps to be notified when a device is out of range.\n\nA scan filter can be based on the discovery of a device's advertisements\n(the `OnFound` event). The Java layer can specify parameters such as first\ndiscovery (or a specified number of advertisements since first discovery).\nImplement BLE filtering using the\n[Advertising Packet Content Filter HCI command](/docs/core/connect/bluetooth/hci_requirements#advertising-packet-content-filter)."]]