Answer the question
In order to leave comments, you need to log in
How to send data to mac address BLE Android?
There is a ListView with found devices.
boxesListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Box selectedBox = (Box) adapterView.getItemAtPosition(i);
BluetoothDevice device = adapter.getRemoteDevice(selectedBox.getMacAddress());
device.connectGatt(BoxesActivity.this, false, new BluetoothGattCallback() {
});
}
});
Answer the question
In order to leave comments, you need to log in
data is sent to the low-energy device by
writing to the desired characteristic.
Thus, knowing only the poppy address is not enough.
So far you only have two lines (address and text).
Bluetooth devices are still classic and combined (dual).
It's easier with the classics, there you can open a channel to "00001101-0000-1000-8000-00805F9B34FB"
But with plaques, the main headache is the lack of standardization where to write.
If it's stupid in everything that has a record attribute, then you can run into a device flashing.
Therefore, you can only write there with what you figured out. Those. Before writing, it would be good to check if you have slipped a compatible device.
https://github.com/weliem/blessed-android
mess around with this library
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question