cordova-plugin-bluetoothle icon indicating copy to clipboard operation
cordova-plugin-bluetoothle copied to clipboard

Set name of peripheral

Open arnoudcommandeur opened this issue 5 years ago • 5 comments

Hi all, now can I set the name of the peripheral for Android device running the app? I only see the name of my phone when i am scanning.

Thanks

arnoudcommandeur avatar May 02 '20 23:05 arnoudcommandeur

You should be able to pass a name parameter to the startAdvertising() method.

randdusing avatar May 03 '20 21:05 randdusing

Hi @randdusing I already, but no difference:

bluetoothle.startAdvertising(log, log, {"service":"1234","name":"Hello World","timeout":180000});   

Do you have another suggestion?

arnoudcommandeur avatar May 04 '20 10:05 arnoudcommandeur

I am trying to run my app as central and peripheral at the same time. The central and peripheral roles are established properly. But the problem I am facing is that the peripheral name is gets set to some random 8 characters e.g., "b5803c96", "89ee180f" on different devices. @randdusing do you have any idea what is exactly going on. I have used the exact codes from github.

sbhm2 avatar May 06 '20 08:05 sbhm2

@sbhm2 which phone do you use?

arnoudcommandeur avatar May 07 '20 07:05 arnoudcommandeur

@sbhm2 which phone do you use?

I have used Redmi Note 5(Android 8), where I got the name(on .getAdaptorInfo() and on scan) 89ee180f and Redmi Note 6 Pro(Android 9), where I got the name(on .getAdaptorInfo() and on scan) b5803c96. Also in both cases, the default device Bluetooth name was different.

sbhm2 avatar May 07 '20 10:05 sbhm2