-
Notifications
You must be signed in to change notification settings - Fork 354
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
Changing Connection Priority on Android #134
Comments
Should not be optInteger not optString |
I'm not too familiar with patch files. Can it be turned into a pull request? |
I'll let you know when my fork is tested and I can confirm that this patch works. |
Thanks, it seems low risk for existing users, so it should be good after your testing. |
It will require that users increase their android-minSdkVersion to at least 21. |
I was wondering if it would make sense to break out the functions that are specific to each platform into their own javascript object, and then write wrapper handlers that try and make the best decision based on the platform. So you would have bluetoothle.android.requestConnectionPriority(...) |
I added a check so that if the user is not using API 21 or greater the code simply returns. Although now I have a problem with API 21 where I cannot write to characteristics... Oh boy. |
Looks like API 21 on Android is causing a lot of regressions in the plugin, also Phonegap doesn't officially support it Wondering if the new Bluetooth LE stuff has something to do with it, |
Oh, I wasn't aware of all the new Bluetooth functionality. My app seems to work fine on API 21, but I'm not writing any characteristics. Eventually I'll probably need to completely rewrite it for API 21 and then allow the user to decide which "code path" to use. But I'm not sure if that's easily possible with the cordova plugin system... I'm not sure if I see the value in making separate handlers for each platform... If the function doesn't apply, it can be ignored or send a method not supported error back. |
I figured out the problem, it was my end and Android not handling a message queue well. My own messaging queue tried to double up a message. My code seems to work, though I am not able to claim any changes to performance yet. |
Even on API 21, you mean? |
Yes on API 21, I need to run my benchmarking on it and haven't had time today. I'll hopefully get an idea soon. I am right now debugging some unrelated bugs that have occured do to the switch to API 21, apparently the Webkit stuff handles cookies and authentication a little differently and this is a bigger issue for me. |
This has been added to the master branch. I made a few changes with error handling. |
Working on a patch to allow the BluetoothLE plugin to change the Connection Request priority. Apparently you can improve the throughput by request a high priority.
I have created a patch file for the master branch.
http://pastebin.com/mcXbaqpH
Haven't tested this but it's based on some code I was doing for a native android app. This wouldn't be applicable to iOS but it could be useful for Android.
The text was updated successfully, but these errors were encountered: