2

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?

Jon Gauthier
  • 25,202
  • 6
  • 63
  • 69

1 Answers1

6

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).

Community
  • 1
  • 1
Jon Gauthier
  • 25,202
  • 6
  • 63
  • 69
  • I think the line-number is wrong (you might have been looking at the column number?). The line in question is 467. Thanks for figuring this out though! – Greg Apr 13 '13 at 12:58
  • Doh! Thanks for catching that :) – Jon Gauthier Apr 13 '13 at 14:41
  • I'd love it if someone could just contribute the built binary for 10.8 to a fork of the github project for this. For those of us without XCode and uninterested playing with the project in the ide. `LightAquaBlue framework, found at /Library/Frameworks/LightAquaBlue.framework` – dlamblin Apr 20 '13 at 03:29
  • Added a link to my `LightAquaBlue.framework` — hopefully it works on your end. – Jon Gauthier Apr 20 '13 at 23:14