如何以编程方式确定蓝牙主/从角色?
因此,在蓝牙微微网中,有一个主设备和最多七个从设备。主设备设置从设备同步的时钟和跳频。但有没有办法确定哪个设备是主设备,哪个设备是从设备呢?我主要对便携式设备(Android,iPhone)感兴趣,但乞丐不能是选择者,如果有人有这个领域的信息我会感兴趣。
谢谢
So in a bluetooth piconet, there is one master with upto seven slaves. The master sets the clock and frequency hop that the slaves sync with. But is there a way to determine which device is the master and which is the slave? I'm mainly interested in portable devices (Android,iPhone) but beggars can't be choosers, if anybody has info in this field I would be interested.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为不可能以编程方式做到这一点。设备所承担的主/从角色对用户(应用程序)来说是不可见的。同一设备可以充当一个微微网的主设备和(相邻)微微网中的从设备在您的应用程序中需要决定的是设备是否充当客户端或服务器或两者,以及它支持的服务(配置文件)是什么。
I don't think it's possible to do it programatically.The master/slave roles which a device assumes is invisible to the user(application).The same device can act as a master of one piconet and a slave in an (adjacent) piconet.What needs to be decided in your application is whether the device will act as a client or a server or both and what will be the services(profiles) that it supports.
这取决于您使用的平台。
应该可以读取与连接的设备相关的信息,并且设备的角色理想情况下应该是 API 中该信息的一部分。
因此,如果连接的设备是主要设备,您可以推断您是辅助设备,依此类推。
-丹尼斯
It depends on the platform you are using.
It should be possible to read the information associated with a connected device and the role of the device should ideally be part of that information in the API.
So if the connected device is Primary you can infer that you are secondary and so on.
-Dennis