LE Credit Based Flow Control Mode是一种使用credit在LE L2CAP channel进行流控的方式
一个设备可以接收的credit的数量是在连接时就确定的,当credit数量大于0的情况下可以发送LE-frames,每发送一个LE-frame,则credit数量减一,对方设备可能随时发送一个Flow
Control Credit packet返回credit的数量,当收到Flow Control Credit packet时,需要将这个返回的credit数量加上剩下的,L2CAP channel上的credit可能会超过LE Credit Based Connection Request或者Response packet中设定的初始值,但是只要不超过65535就没有问题。接收端收到credit packet后,credit总数超过65535应该断开连接,如果在credit为0时还收到LE-frame也应该断开连接,如果收到一个LE Flow Control Credit packet其中的credit字段为0应该忽略,同样一个设备发送LE Flow Control Credit packets时不能设置credit字段为0.
收到connection request时,如果两个设备还未authentication,则应该拒绝连接,result为“Connection refused - insufficient authentication”;
收到connection request时,如果两个设备还未authorization,则应该拒绝连接,result为“Connection refused - insufficient authorization”
收到connection request时,encryption key size太短,则应该拒绝连接,result为“Connection refused – insufficient encryption key size”
注意:当encryption未使能时,result为“Connection refused – insufficient authentication”并不表明需要MITM protection