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
82 stars 19 forks source link

Peripheral - Device Information Service #48

Closed JoeDexcom closed 1 week ago

JoeDexcom commented 1 month ago

I built the basic example project and connected it to a generic scanner.

When connected, it is finding a device information service, with one characteristic, the PnP ID. I'm building this on an PC running Ubuntu.

Is the device information service added automatically because that's what the PC provides? I can't seem to add a device information service myself with any characteristics.

The project I'm trying to build is a device that emulates another device (as a POC, the example I'm building is a Nonin 3230 pulse oximeter). So I want to mimic all of the services and characteristics, including the device information service.

But I can't seem to add my own, and don't know what to do about the one that seems to be there.

weliem commented 1 month ago

A similar is has already been reported on this. Yes, Bluez adds the Device Information service itself. I haven't yet found a way to prevent this or add things to it...

weliem commented 1 week ago

You can disable the DIS service in /etc/bluetooth/main.conf

Add DeviceID = false to prevent Bluez from adding its own DIS service

JoeDexcom commented 5 days ago

Excellent! Looks like i had to reboot the machine to make it work. I tried doing bluetootctl power off/power on, but then what happened is it created TWO device information services (the one it used to have with the PnPID, and then the one i created).

Maybe i didn't have to reboot, but rebooting did it. There must be a cache or something somewhere that held onto the one it used to create on its own.