1

I created one simple service in android things to use Bluetooth BLE.when I try to test it with NRF connect app it's visible as "unknown service".I want to give name something like "Speed Service".how would I do it?

Aniket patel
  • 551
  • 1
  • 5
  • 17

2 Answers2

3

This is a factor controlled by the scanning app you are using, not necessarily your Android Things device. Bluetooth LE doesn't send metadata like a "service name" over the air. Services are identified by their UUID alone. If your device implements one of the standard service UUIDs, a scanner app like NRF Connect will probably recognize and display the service type.

As another example, our Bluetooth GATT Server sample implements the standard Current Time Service by using the UUID adopted by the Bluetooth SIG for that service.

devunwired
  • 62,780
  • 12
  • 127
  • 139
1
private BluetoothAdapter bluetoothAdapter = null;
bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();

void ChangeDeviceName(){
                Log.i(LOG, "localdevicename : "+bluetoothAdapter.getName()+" localdeviceAddress : "+bluetoothAdapter.getAddress());
                bluetoothAdapter.setName("NewDeviceName");
                Log.i(LOG, "localdevicename : "+bluetoothAdapter.getName()+" localdeviceAddress : "+bluetoothAdapter.getAddress());
            }

Reference: Change the Android bluetooth device name

Hope this case is similar and of use to you.

fluffy
  • 223
  • 1
  • 14