weliem / bluez_inc

A C library for Bluez (BLE) that hides all DBus communication. It doesn't get easier than this. This library can also be used in C++.
MIT License
84 stars 19 forks source link

How to rename bluetooth #45

Closed tangchao90 closed 3 months ago

tangchao90 commented 3 months ago

Hi! First I want to thank you for this amazing library. I use the peripheral example in my embedded system. I insert the main function in my project. it works fine with Android or Iphone.

I can change my bluetooth name by dbus-send command, but i can't scan the new name by Android or Iphone, at the same time, i can connect it with old name

I try it

binc_adapter_stop_advertising
binc_advertisement_set_local_name
binc_adapter_start_advertising

but it has some errors

So how can I rename it with bluez_inc and it can update the new name when i scan!

tangchao90 commented 3 months ago

I have a question. If i use the bluez_inc. Don’t i need Bluetoothd daemon?

weliem commented 3 months ago

Use should use binc_advertisement_set_local_name . It works for me.

What errors are you getting? Please share some logs

tangchao90 commented 3 months ago

I succeed by restart it, I deinit then init it again. it can meet my requirements