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

writeCharacteristic causing FC #134

Open
storm1er opened this issue Feb 4, 2017 · 0 comments
Open

writeCharacteristic causing FC #134

storm1er opened this issue Feb 4, 2017 · 0 comments

Comments

@storm1er
Copy link

storm1er commented Feb 4, 2017

Hi

I'm trying to send time throung bluetooth to my rpi.
but i can't get evothings.ble.writeCharacteristic to wrok for unknown reason :/

app.js :

		ui.append('Time is being updated ...');
		device.writeCharacteristic(
			app.SYSTEMINFORMATIONSERVICE,
			characteristic_uuid,
			new Uint8Array([1]),
			function(){
				ui.append('DONE', true);
			},
				function(error){
				ui.append('ERROR', true);
				ui.text('Warning : '+error);
			}
		);

The app crash just after displaying "Time is being updated ..."

logcat :

02-05 11:03:54.416 20011 20011 D BluetoothGatt: readCharacteristic() - uuid: ffffffff-ffff-ffff-ffff-fffffffffff1
02-05 11:03:54.577  1049  1049 E WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 65 num clients 9
02-05 11:03:54.578  1049  1049 E WifiTrafficPoller:  packet count Tx=94854 Rx=127944

02-05 11:03:54.670  2185  2206 I bt_btif_gatt: set_read_value unformat.len = 42 
02-05 11:03:54.671 20011 20878 D BluetoothGatt: onCharacteristicRead() - Device=B8:27:EB:6C:4F:9C UUID=ffffffff-ffff-ffff-ffff-fffffffffff1 Status=0 srvcType=0 srvcInstId=0 charInstId=0
02-05 11:03:54.694 20011 20011 E AndroidRuntime: FATAL EXCEPTION: main
02-05 11:03:54.694 20011 20011 E AndroidRuntime: Process: com.evothings.evothingsviewer, PID: 20011
02-05 11:03:54.694 20011 20011 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.bluetooth.BluetoothGattCharacteristic.setWriteType(int)' on a null object reference
02-05 11:03:54.694 20011 20011 E AndroidRuntime: 	at com.evothings.BLE$12.run(BLE.java:988)
02-05 11:03:54.694 20011 20011 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:815)
02-05 11:03:54.694 20011 20011 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:104)
02-05 11:03:54.694 20011 20011 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:207)
02-05 11:03:54.694 20011 20011 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:5728)
02-05 11:03:54.694 20011 20011 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
02-05 11:03:54.694 20011 20011 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
02-05 11:03:54.694 20011 20011 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)

And on serveur side, everything is fine except that OnWriteRequest isn't called. So android app is crashing before sending information.

Giving some visibility with StackOverflow http://stackoverflow.com/questions/42051102/evothings-ble-write-causing-fc

@storm1er storm1er changed the title writeCharacteristic problem writeCharacteristic make app crach Feb 5, 2017
@storm1er storm1er changed the title writeCharacteristic make app crach writeCharacteristic make app crash Feb 5, 2017
@storm1er storm1er changed the title writeCharacteristic make app crash writeCharacteristic causing FC Feb 5, 2017
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

No branches or pull requests

1 participant