ficat / easyble Goto Github PK
View Code? Open in Web Editor NEWAndroid BLE framework
License: Apache License 2.0
Android BLE framework
License: Apache License 2.0
hello @Ficat
i am calling this function in notify call back to read the data that come from my BLE device
@Override
public void onCharacteristicChanged(byte[] data, BleDevice device) {
readValue = new String(data);
System.out.println(data.length);
}
and i get length of data is 20 and my ble device send data of 50 to 60 character string.
how can i increase the size of the data to read all value that come from my BLE device?
I call write Characteristics with static value after the device is connected like that :
if (characteristicInfo.writable) {
writeCharacteristic = characteristicInfo;
String str = "c100";
if (TextUtils.isEmpty(str)) {
Toast.makeText(getActivity(), getResources().getString(R.string.tips_write_operation), Toast.LENGTH_SHORT).show();
return;
}
BleManager.getInstance().write(device, e.getKey().uuid, writeCharacteristic.uuid, ByteUtils.hexStr2Bytes(str), writeCallback);
}
private BleWriteCallback writeCallback = new BleWriteCallback() {
@Override
public void onWriteSuccess(byte[] data, BleDevice device) {
Logger.e("write success:" + ByteUtils.bytes2HexStr(data));
}
@Override
public void onFailure(int failCode, String info, BleDevice device) {
Logger.e("write fail:" + info);
Logger.e("write failCode:" + failCode);
}
};
and I get onFailure :
write fail:write fail because of unknown reason
write failCode:201
@Ficat can you please help me to solve this ?
i want to set a static service UUID in scan option like this:
private UUID uuid = UUID.fromString(serviceUUID);
BleManager.ScanOptions scanOptions = BleManager.ScanOptions .newInstance() .scanPeriod(4000) .scanDeviceName(null) .scanServiceUuids(uuid);
but it's throw error:
Required type: UUID[]
Provided: UUID
@Ficat how to set array for this ?
I upgrade my api version target sdk version is 32 and i am getting null onLeScan() in device
BleManager.toggleBluetooth(true); is also not working for this version
how can I fix these issues please help !
Hi, im trying to send notification with the write method of your sample, the problem is that the method dont send the complete message, i tried write to batch but didnt work. Can you help me pls?
Read characteristics always return 201 code that is characteristics not readable.
Ble device disconnects automatically after connection
When coming back to the home screen from the Bluetooth screen I get “bluetoothGatt: close()” and the BLE device disconnects.
What can I do to solve this problem?
print this log please check "connect fail:connect fail, status = 133"
Automatically connect to paired bluetooth device when in range
hi. whe a device is selected is it possible to save it to shared preferences so when the app is opened again it will try to connect with out scanning?
ive tried saving the device and then assign it to device but get app crash.
thank you
Hello @Ficat, is there a way to write descriptor by use this framework? Or it has been implemented by framework itself.
How can i create a BluetoothSocket after i connected a BLE device and use
bluetoothSocket.connect();
outputStream = bluetoothSocket.getOutputStream();
It not detect BLE device without paired. I checked twice. I scan BLE device its not detect but once i paired it manually through phone setting and then rescan it through app and it detect. so without paired its not detect?
I need it to prevent casual attackers (i.e. your typical neighbours). It is strong enough for that.
writing custom code to the ble device, can you please add a field where we can add service uuid and character uuid and write hex code to the device?
or just advice me how to use manager to send text to ble using service_uuid and character_uuid
thank you!
read data when sent from module to mobile without click button
I checked multiple connect & send message.
But i didn't checked read data.
HM-10 <-> APP <-> HM-10
if i send to message in app to HM-10(BLE Module) It was checked it.
if i send to message in hm-10(using to terminal) to APP, but it was not wokring.
How to received data from hm-10 to app?
writable
seems to be the proper spelling of the word, so I think we should at least support that as an alias to writeable
.Hi,
can this library allow User to Notify Multiple Characteristic parallelly?
Regards
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.