简体   繁体   中英

How to get the Serial Number of the Remote Device over Bluetooth?

In my application, I discovered bluetooth devices and thus got the following ---

  • Name of Bluetooth Device.
  • Hardware address of Bluetooth Device.

This is done by getting BluetoothDevice object for each discovered device and calling object.getName() and object.getAddress() .

I also want to get the Serial number of each discovered bluetooth device.

I know to get the serial number of my own device as ---

android.os.Build.SERIAL

(Updated URLs)

Many bluetooth low energy profiles provide a service called Device Information .
Assigned UUID: 0x180A
https://www.bluetooth.com/specifications/gatt/services/

Under this service there is a Serial Number String characteristic which can hold a serial number specific to the Bluetooth low energy device.
Assigned UUID: 0x2A25
https://www.bluetooth.com/specifications/gatt/characteristics/

This is optional though and not all BLE profiles will have it, and you have to connect to the device to retrieve this information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM