Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增requestConnectionPriority接口 #158

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

g19980115
Copy link

requestConnectionPriority(int priority)
参数:

Constants.PRIORITY_BALANCED = 0;//默认的值
Constants.PRIORITY_HIGH = 1;//连接快的值,当需要跟设备进行大的数据传输时设置该值
Constants.PRIORITY_LOW_POWER = 2;//低功耗的值

该接口是5.0以上的API,连接成功后,大数据传输前,调用此接口Constants.PRIORITY_HIGH 可以有更快的传输速度。

真机实测
(自己加了延迟10ms发送一包。在小米手机上实测,设置Constants.PRIORITY_HIGH该值后,不加延迟一顿猛发容易丢包,所以最好加上10毫秒的延迟)

魅族16sPro测试,调用或者不调用,速度都很快,20k图片BLE设备端接收完成都是20秒左右。
小米8SE测试,发送20k的图片,BLE设备端完全接收从1分多钟降到了20秒左右。

所以此接口还是有效的,具体效果看手机厂商底层的连接间隔。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants