bluetooth - Android BLE sending message using synchronized method -
i need send message custom device via ble.
i able send message below 20 bytes. used just:
public boolean writecharacteristic(byte[] value){ if (mbluetoothgatt == null) { log.e(tag, "lost connection"); return false; } bluetoothgattservice service = mbluetoothgatt.getservice(uuid_service_generic_attribute); if (service == null) { log.e(tag, "service not found!"); return false; } bluetoothgattcharacteristic charac = service.getcharacteristic(uuid_write); if (charac == null) { log.e(tag, "char not found!"); return false; } charac.setvalue(value); boolean status = mbluetoothgatt.writecharacteristic(charac); return status; }
but need send longer message in "as short time possible". found: android: sending data >20 bytes ble
but need use synchronized method , oncharacteristicwrite (this should fastest way).
i found: http://blog.stylingandroid.com/bluetooth-le-part-6/, not clear me.
do have easy example how send message via ble using synchronized methods?