This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dbus | |
import time | |
bus = dbus.SystemBus() | |
#Build a proxy for the Adapter | |
adapter_proxy = bus.get_object("org.bluez", "/org/bluez/hci0") | |
#Call the method StartDiscovery from the adapter api then StopDiscovery | |
adapter_proxy.StartDiscovery(dbus_interface="org.bluez.Adapter1") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dbus | |
import time | |
""" | |
This gist will do the following things : | |
1. Setup GLib and a MainLoop. MainLoop is required to receive signals from the dbus | |
2. Define a simple callback function that will be associated to the signal "Properties Changed" for a specific object (Characteristic). | |
The callback function will be called when the characteristic value is updated or it's property changed. | |