xpg / gizwitsble Goto Github PK
View Code? Open in Web Editor NEWAndroid BLE SDK
License: Apache License 2.0
Android BLE SDK
License: Apache License 2.0
It is a great project!
But I got a problem when I try it.
I can not send a message to the bluetooth device connected.
Can you help me?
It would be super helpful if you could update the README to include how to get started. Basic usage and some documentation would help a lot rather than letting people try reverse engineer the sample app.
android 5.1 connection fail
在类BleService的processNextRequest()方法中,会在得到ret为true时startTimeoutThread(),但是在startTimeoutThread()之前就有可能执行clearTimeoutThread(),此时mRequestTimeout为null。
Just i connect the ble4.0 with my telephone(MI3 OS:6.0.1),I can't connected;
And the logcat shows that
"
D/BluetoothGatt(14678): onClientConnectionState() - status=133 clientIf=5 device=xx:xx:xx:xx:xx:xx
D/blelib(14678): onConnectionStateChange xx:xx:xx:xx:xxxx: status 133 newState 0
"
I thougth it‘s the same with the another issues,just about the “status=133”
The Gatt may be wrong with my telephone opera system, because I use the BLE Connection of System successfully.
(PS. I can't received the Broadcast by the action "BluetoothDevice.ACTION_FOUND" , Thanks for your guide, I use your lib to scan the BL successfully)
Now I have to use old api of BLE Connection.
Finally I think the "status=133" may be bug in some telephone.
A problem trouble me now, I can not send a broadcast to other Androids' device in ble, I find no method provided by Google SDK, can you help me?
When disconnecting from a device you invoke gatt.disconnect()
and immediately after gatt.close()
. What this does is that it doesn't allow the bluetooth stack to send in time an onConnectionStateChange
message to the GattCallback.
If you remove the gatt.close() command from the AndroidBle disconnect method and append it to the if (newState == BluetoothProfile.STATE_DISCONNECTED)
path in onConnectionStateChange
all goes well.
Often, before I modified the code, I would receive from time to time some NullPointerException from the onConnectionStateChange
implementation. After the change the code runs ok.
If often and quickly call to connect(+send command)/disconnet methods we can get status = 113 in onConnectionStateChange callback(it's so bad). And library has another problems with similar tests . All advise send ble commands in mainThread . This solution can help . What do you think about it ?
I just want to use one characteristic to write command ,and receive the notification(response of from other characteristic. Or is there any way to log the event just like the lightblue app on ios platform?
Is there any way to speed up the request queue when communicating with multiple devices? I'm sending data to 3 devices. Right now, it takes around 300ms to complete.
用户反馈过来的,还有看日志里,明明是三星系统,为啥初始化时还是AndroidBle
SDK_INT=21
MODE=SM-G900V
appVersion=SM-G900V->5.0->v3.5.0->c92 ->BLE:true
App_Type=Remote
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
at android.os.Parcel.readException(Parcel.java:1546)
at android.os.Parcel.readException(Parcel.java:1493)
at android.bluetooth.IBluetoothGatt$Stub$Proxy.unregisterClient(IBluetoothGatt.java:905)
at android.bluetooth.BluetoothGatt.unregisterApp(BluetoothGatt.java:714)
at android.bluetooth.BluetoothGatt.close(BluetoothGatt.java:653)
at com.xtremeprog.sdk.ble.AndroidBle.disconnect(AndroidBle.java:247)
at com.xtremeprog.sdk.ble.BleService$1.run(BleService.java:202)
at java.lang.Thread.run(Thread.java:818)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.