J2ME 中的蓝牙服务问题无法发现
我尝试创建一个服务:
LocalDevice localDevice = LocalDevice.getLocalDevice();
localDevice.setDiscoverable(DiscoveryAgent.GIAC);
String url = "btl2cap://localhost:"+uuid.toString()+";name="+name+";authorize=true;authenticate=true;encrypt=true";
L2CAPConnectionNotifier notifier = (L2CAPConnectionNotifier)Connector.open(url);
ServiceRecord = localDevice.getRecord(notifier);
// Set some attributes
// ...
conn = notifier.acceptAndOpen();
//...
我在诺基亚 5800 和诺基亚 2760 上运行此代码,在 5800 上我可以看到 2760,但反之亦然,我不知道问题是什么,我认为存在安全问题...
有什么想法吗?
谢谢!
I try to create a service with:
LocalDevice localDevice = LocalDevice.getLocalDevice();
localDevice.setDiscoverable(DiscoveryAgent.GIAC);
String url = "btl2cap://localhost:"+uuid.toString()+";name="+name+";authorize=true;authenticate=true;encrypt=true";
L2CAPConnectionNotifier notifier = (L2CAPConnectionNotifier)Connector.open(url);
ServiceRecord = localDevice.getRecord(notifier);
// Set some attributes
// ...
conn = notifier.acceptAndOpen();
//...
I run this code on a Nokia 5800 and Nokia 2760, with 5800 I can see 2760, but not vice versa, I don't know what is the problem, I have think security problems...
Any ideas?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题出在搜索中,设备抛出了一个BluetoothStateException,给出“Busy”。我找到的解决方案是在 deviceSearch 和 serviceSearch 之间引入延迟。
The problem was in the search, the device threw a BluetoothStateException giving "Busy". The solution I have found is introducing a delay between deviceSearch and serviceSearch.