Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在swift中搜索不到设备?? #9

Closed
miws opened this issue Nov 16, 2015 · 7 comments
Closed

在swift中搜索不到设备?? #9

miws opened this issue Nov 16, 2015 · 7 comments

Comments

@miws
Copy link

miws commented Nov 16, 2015

    baby = BabyBluetooth.shareBabyBluetooth()
    babyDelegate()
    baby?.scanForPeripherals()
    baby?.begin()

并且不能象例子中的 baby?.scanForPeripherals().begin()这样使用。
以上代码在控制台只显示了:

CBCentralManagerStatePoweredOn
就没有了

@coolnameismy
Copy link
Owner

sorry,babybluetooth暂不支持swift版本。后续会开发swift版本。预计3个月左右。

发自我的 iPhone

在 2015年11月16日,下午8:52,蜜友工作室 notifications@github.com 写道:

baby = BabyBluetooth.shareBabyBluetooth()
babyDelegate()
baby?.scanForPeripherals()
baby?.begin()

并且不能象例子中的 baby?.scanForPeripherals().begin()这样使用。
以上代码在控制台只显示了:

CBCentralManagerStatePoweredOn
就没有了


Reply to this email directly or view it on GitHub.

@miws
Copy link
Author

miws commented Nov 16, 2015

我使用混合编程方法已经集成进入工程了,可以调用,只是没有效果。

@coolnameismy
Copy link
Owner

嗯。因为objc的链式方程是用block实现的。swift无法用。你执行单个方法可能会进委托,多个一起执行就不行了。

发自我的 iPhone

在 2015年11月16日,下午8:55,蜜友工作室 notifications@github.com 写道:

我使用混合编程方法已经集成进入工程了,可以调用,只是没有效果。


Reply to this email directly or view it on GitHub.

@lyluoyuan
Copy link

请教个问题,我现在做蓝牙,用bluetooth这个框架,只能搜到和连上苹果设备(mac , iphone),即使用您这个demo也是这样的,其他有蓝牙4.0的设备搜不到或者连不上

@coolnameismy
Copy link
Owner

嗯。因为objc的链式方程是用block实现的。swift无法用。你执行单个方法可能会进委托,多个一起执行就不行了

@gnastnosaj
Copy link

babyBluetooth?.scanForPeripherals()().begin()()
这样写没用吗

@gnastnosaj
Copy link

CBCentralManagerStatePoweredOn
discover perpheral Optional("L28T_00199")
discover perpheral Optional("L28T_00199")
discover perpheral Optional("L28T_00199")
discover perpheral Optional("L28T_00199")
discover perpheral Optional("AirIII")
discover perpheral Optional("L28T_00199")
discover perpheral Optional("L28T_00199")
discover perpheral Optional("AirIII")
discover perpheral Optional("AirIII")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants