ROS and DBus : Advertisement.GetAll not a Python function

asked 2020-11-16 03:19:04 -0500

Haygreaves gravatar image

updated 2020-11-16 11:23:38 -0500

gvdhoorn gravatar image

Hello everyone,

Hope you're doing good. It's my first post on ROS topic, I hope you could help me with an error I got when I run my launch file. I'm using python-dbus in order to make a bidirectional communication between a BLE device and a BLE peripheral. I use the bluez example of gatt-server and example-advertisement

I'm using python 2.7 with bluez 4.3 and I got an error when I compile my file with the dbus.service.method you can find on line 99 of example_advertisement.

@dbus.service.method(DBUS_PROP_IFACE,
                         in_signature='s',
                         out_signature='a{sv}')
    def GetAll(self, interface):
        print 'GetAll'
        if interface != LE_ADVERTISEMENT_IFACE:
            raise InvalidArgsException()
        print 'returning props'
        return self.get_properties()[LE_ADVERTISEMENT_IFACE]

The output error is :

TypeError: <cyfunction Advertisement.GetAll at 0x76188d30> is not a Python function

If anyone knew how to solve this problem, I'll be grateful for life !

edit retag flag offensive close merge delete