Question

I'm using Nickolay Yegorov's port of LightBlue for OS X 10.8. Immediately upon importing the lightblue module, I get the following error:

Traceback (most recent call last):
  File "commander.py", line 3, in <module>
    import lightblue
  File "/usr/local/lib/python2.7/site-packages/lightblue/__init__.py", line 160, in <module>
    from _lightblue import *
  File "/usr/local/lib/python2.7/site-packages/lightblue/_lightblue.py", line 397, in <module>
    class _AsyncDeviceInquiry(Foundation.NSObject):
TypeError: Error when calling the metaclass bases
    class _AsyncDeviceInquiry does not correctly implement protocol IOBluetoothDeviceInquiryDelegate: the signature for method deviceInquiryComplete:error:aborted: is v@:@iB instead of v@:@iZ

It seems like there might be a version mismatch. Is there a known fix for this problem?

Was it helpful?

Solution

Open the file src/mac/_lightblue.py in the source from Yegorov's repo. Find line 467 (looks like the following):

deviceInquiryComplete_error_aborted_ = objc.selector(
    deviceInquiryComplete_error_aborted_, signature="v@:@iB")

Change the string v@:@iB to v@:@iZ. Reinstall LightBlue from this source:

cd <lightblue_root> && sudo python setup.py install

This should solve the signature error.

Binary

dlamblin requested a binary with this fix. Here is my LightAquaBlue.framework, built for OS X 10.8.2 with Python 2.7.4 (put in /Library/Frameworks).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top