我尝试通过以下方式创建服务:
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,但反之不行,我不知道是什么问题,我认为安全问题...
有任何想法吗?
谢谢!