Gatt Dbus example and bluetoothctl question when using virtual emulator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am doing some experiments to understand Bluez DBUS API using Bluez
5.46, and feel a little bit confused about Gatt Dbus example code and
bluetoothctl.

First, I do sudo bluetoothd --experimental -d, then I create two
virtual bt interfaces and bring up example-gatt-server, then
example-gatt-client cannot find any new gatt service. Any idea?

Also, I have checked all information under org.bluez using d-feet, the
gatt service and characteristics from example-gatt-client have not yet
been added. I print all infos under ObjectManager for bluez, and
cannot find these services and characteristics.

I also try to use register-service, and register-characteristic for
hci0 using bluetoothctl,  but I cannot find any added service and
characteristics under d-feet and ObjectManager. Any idea?


bluez-5.46$ sudo ./emulator/btvirt -L -l2
Bluetooth emulator ver 5.46


bluez-5.46/test$ sudo ./example-gatt-server
Registering GATT application...
GetManagedObjects
GATT application registered
Battery Level drained: 98
Battery Level drained: 96
Battery Level drained: 94
Battery Level drained: 92
Battery Level drained: 90
Battery Level drained: 88
Battery Level drained: 86
Battery Level drained: 84

sudo ./example-gatt-client
Getting objects...
No Heart Rate Service found


sudo ./client/bluetoothctl
[NEW] Controller 00:AA:01:00:00:23 hostname [default]
[NEW] Device 00:AA:01:01:00:24 hostname #2
Agent registered
[bluetooth]# power on
Changing power on succeeded
[CHG] Controller 00:AA:01:00:00:23 Powered: yes
[bluetooth]# register-service 00001820-0000-1000-8000-00805f9b34fb
[NEW] Primary Service
/org/bluez/app/service0xd5eac0
00001820-0000-1000-8000-00805f9b34fb
Internet Protocol Support
[/org/bluez/app/service0xd5eac0] Primary (yes/no): yes
register-characteristic 00002a06-0000-1000-8000-00805f9b34fb
write-without-response
[NEW] Characteristic
/org/bluez/app/service0xd5eac0/chrc0xd5f150
00002a06-0000-1000-8000-00805f9b34fb
Alert Level
[/org/bluez/app/service0xd5eac0/chrc0xd5f150] Enter value: 0x1
[bluetooth]# register-application
[CHG] Controller 00:AA:01:00:00:23 UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:AA:01:00:00:23 UUIDs: 00001820-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:AA:01:00:00:23 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:AA:01:00:00:23 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:AA:01:00:00:23 UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller 00:AA:01:00:00:23 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
Application registered
[bluetooth]# advertise on
Advertising object registered


Thanks
Best wishes
Yunhan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux