TI中文支持网
TI专业的中文技术问题搜集分享网站

减少service发现的耗时

Hi all
    BLE在已配对设备中再次重新连接时,service的发现过程是否还是必须走一遍的?
     如果还要走一遍,那么有办法优化发现service的耗时呢?
Viki Shi:

如果需要节省时间,建议绑定两边的设备:

Pairing

Pairing is the exchange of security features. This includes things like i/o capabilities, requirement for man-in-the-middle protection, etc. The client side begins this exchange. The client essentially says ‘hey, i’d like it if you had these features’. The server replies, ‘yeah, well, this is what I can do’. Once this exchange is made, the security that will be used has been determed. For example, if a server supports just noInput/noOutput for i/o capabilities, the Just Works pairing mechanism is going to be used.

Once the pairing feature exchange is complete, a temporary security key is exchanged and the connection is encrypted, but only using the temporary key. In this encrypted connection, long term keys are exchanged. These keys are things like the (long term) encryption key to encrypt a connection, and also things like a digital signature key. The exact keys exchanged are determined by the security features of each device.

Bonding

This really just means that after the pairing features exchange and the connection has been encrypted (these two together are called ‘pairing’), and keys have been exchanged, the devices STORE and USE those keys the next time they connect. Keys can be exchanged using the bonding procedure, but that does not mean they are bonded if the keys are not stored and used the next time.

If a device is bonded with another device, like a heart rate monitor and a smartphone, they can encrypt the connection without exchanging any sensitive security information. When the smartphone connects to the heart rate monitor, it can just issue a ‘turn on encryption’ request, and both sides will use the keys already stored, so nobody snooping can see a key exchange and therefore decode the messages being sent, as is done when pairing.

user5869846:

回复 Viki Shi:

HiViki Shi
两边都绑定就可以减少发现服务的时间吗? 两边都绑定的意思是主从机都发起配对吗?

Viki Shi:

回复 user5869846:

一方发起并绑定就可以了,绑定是相互的。

赞(0)
未经允许不得转载:TI中文支持网 » 减少service发现的耗时
分享到: 更多 (0)