Re: How does bluetoothctl work from the command line with gatt?

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

 



Hi John,

On Tue, Jul 12, 2022 at 11:09 AM John Klug <John.Klug@xxxxxxxxxxxxx> wrote:
>
> How does one do the following in bluetoothctl from a script and command line that one would do in gatttool as follows:
>
> # gatttool -i hci0 -b $bd_addr -u 2a29 --char-read
> handle: 0x0017  value: 54 65 78 61 73 20 49 6e 73 74 72 75 6d 65 6e 74 73
> # gatttool -i hci0 -b $bd_addr --char-desc | grep -i aa22
> handle = 0x002f, uuid = f000aa22-0451-4000-b000-000000000000
> # gatttool -i hci0 -b $bd_addr -a 0x002f --char-write-req -n 01
> Characteristic value was written successfully
>
>
> For instance:
>
> # bluetoothctl connect CC:78:AB:7E:87:07
> Attempting to connect to CC:78:AB:7E:87:07
> Connection successful
> # bluetoothctl gatt.select-attribute 2a29
> # bluetoothctl gatt.read
> No attribute selected
> # bluetoothctl gatt.select-attribute f000aa22-0451-4000-b000-000000000000
> # bluetoothctl gatt.acquire-write
> No attribute selected
> # bluetoothctl gatt.write 0x01
> No attribute selected

You will probably need to wait for the daemon to resolve the services
which will then export the attributes as D-Bus objects that can be
accessed by bluetoothctl, note that some services are handled
internally by bluetoothd (e.g. GAP and GATT services) which perhaps is
the case of 0x2a29, although we don't currently have any D-Bus
property for Manufacturer like we do for name
(org.bluez.Device1.Name).

-- 
Luiz Augusto von Dentz



[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