Skip to main content

Simple Bluez D-Bus client interface

Project description

Simple Bluez D-Bus python client interface

Use like:

```
python3 -m blus
```

or

```python
import blus

class Observer(blus.DeviceObserver):

def seen(self, manager, path, device):
alias = device.get("Alias")
print("Seeing %s at %s" % (alias, path))

# device = blus.proxy_for(device)
# device.Pair()
# device.Connect()
# etc ...

blus.DeviceManager(Observer()).scan()
```

Output:

```
> python3 scanner.py

Seeing 4B-CF-80-09-16-72 at /org/bluez/hci0/dev_4B_CF_80_09_16_72
Seeing 77-0C-65-0A-7C-0F at /org/bluez/hci0/dev_77_0C_65_0A_7C_0F
Seeing 42-90-C6-B6-F0-8A at /org/bluez/hci0/dev_42_90_C6_B6_F0_8A
Seeing Apple Pencil at /org/bluez/hci0/dev_68_24_3F_07_9F_F1
Seeing 7C-38-5D-97-D3-10 at /org/bluez/hci0/dev_7C_38_5D_97_D3_10
Seeing Suunto 9 123210000194 at /org/bluez/hci0/dev_0D_8C_DA_37_BC_50
Seeing 64-2D-A9-2D-14-96 at /org/bluez/hci0/dev_64_2D_A9_2D_14_96
Seeing 78-66-CF-91-BC-38 at /org/bluez/hci0/dev_78_66_CF_91_BC_38
Seeing 66-F5-90-3B-76-FD at /org/bluez/hci0/dev_66_F5_90_3B_76_FD
Seeing [AV] Samsung Soundbar MS750 at /org/bluez/hci0/dev_54_BD_79_26_FE_D1
Seeing [TV] Samsung 7 Series (43) at /org/bluez/hci0/dev_FC_03_9F_5B_D1_1A
Seeing [TV] Samsung Q9 Series (65) at /org/bluez/hci0/dev_7C_64_56_9F_14_DF
```

Other example:
https://github.com/molobrakos/toothbrush/blob/master/toothbrush

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blus-0.0.19.tar.gz (8.7 kB view details)

Uploaded Source

File details

Details for the file blus-0.0.19.tar.gz.

File metadata

  • Download URL: blus-0.0.19.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.7

File hashes

Hashes for blus-0.0.19.tar.gz
Algorithm Hash digest
SHA256 b48b6cb04d9cb5f52be1789fafc0b295a7261a07ac43531015d883dd0d4d489a
MD5 38c682203a758e2c5426435c9eb55fcb
BLAKE2b-256 d0e4d73a9cfa61c534d7f004717bbc7d37e5b1fc9fd63950f65f593eccd7fe46

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page