我想我误解了私有服务的概念。我有一个使用苹果CoreBluetooth的程序,似乎一切都很好地发现了服务:
Found Characteristic 'Appearence' for service 'Generic Access Profile'
Found Characteristic 'Peripheral Preferred Connection Parameters' for service 'Generic Access Profile'
Found Characteristic 'Serial Number String' for service 'Device Information'
Found Characteristic 'Hardware Revision String' for service 'Device Information'
Found Characteristic 'Firmware Revision String' for service 'Device Information'
Found Characteristic 'Software Revision String' for service 'Device Information'
Found Characteristic 'Manufacturer Name String' for service 'Device Information'
Found Characteristic 'Model Number String' for service 'Device Information'
Found Characteristic 'Battery Level' for service 'Battery'
接下来我在RN4020中设置了私有服务和特征,这样当我在终端中输入LS时就可以看到它们:
123456789012345678901234567890FF
12345678901234567890123456789011,000B,02,01
12345678901234567890123456789011,000C,10,02
12345678901234567890123456789022,000E,02,02
然后我启动广告、重新启动...但是我无法在我的应用程序中看到这项服务(?)。这是因为它们是私有的吗?那么我该如何使它公开呢? 当我输入LS时,我不应该也能在终端上看到所有这些服务(电池、设备信息和通用访问配置文件)吗?
谢谢!