1
I Use This!
Activity Not Available
Analyzed over 3 years ago. based on code collected over 3 years ago.

Project Summary

bluez-python - A BlueZ python binding on top of dbus-python

Requirements

In order to use bluez-python you need following software packages:

- Python 2.5 or later
- Linux Bluetooth protocol stack (BlueZ)
- Python bindings for D-Bus (dbus-python)
Installation

From a command shell:

# python setup.py install

Notes

- Only supports BlueZ4 API
- Checking the doc directory in the BlueZ source package is always a good idea.
Contact

Li Dongyang

For additional information, check the page on the BlueZ wiki:

http://wiki.bluez.org/wiki/bluez-python
an example on discovering devices:

#!/usr/bin/env python
import bluez
import gobject

def device_found(address, properties):
print "[ " + address + " ]"

for key in properties.keys():
value = properties[key]
if (key == "Class"):
print " %s = 0x%06x" % (key, value)
else:
print " %s = %s" % (key, value)

manager = bluez.Manager('gobject')
adapter = manager.DefaultAdapter()
adapter.HandleSignal(device_found, 'DeviceFound')
adapter.StartDiscovery()
mainloop = gobject.MainLoop()
try:
mainloop.run()
except KeyboardInterrupt:
mainloop.quit()and another example on pairing a device:

#!/usr/bin/env python
import sys
import bluez
import gobject

def reply_device(device):
print device.GetProperties() # print the device's properties on success

def reply_error(error):
raise error

manager = bluez.Manager('gobject')
adapter = manager.DefaultAdapter()
agent = manager.CreateAgent() # use the build-in simple-agent to get a PIN
mainloop = gobject.MainLoop()
adapter.CreatePairedDevice(sys.argv[1], agent, 'DisplayYesNo', reply_handler=reply_device, error_handler=reply_error)
try:
mainloop.run()
except KeyboardInterrupt:
mainloop.quit()

Tags

bluez dbus python

In a Nutshell, bluez-python...

GNU Library or "Lesser" GPL (LGPL)
Permitted

Commercial Use

Modify

Distribute

Place Warranty

Use Patent Claims

Forbidden

Sub-License

Hold Liable

Required

Include Copyright

Include License

Distribute Original

Disclose Source

State Changes

Include Install Instructions

These details are provided for information only. No information here is legal advice and should not be used as such.

All Licenses

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    you can embed statistics from Open Hub on your site
  • ...
    in 2016, 47% of companies did not have formal process in place to track OS code
  • ...
    you can subscribe to e-mail newsletters to receive update from the Open Hub blog

30 Day Summary

Apr 26 2015 — May 26 2015

12 Month Summary

May 26 2014 — May 26 2015

Ratings

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!