You are not logged in.
Hi Guvalif,
I'm trying to send sensor's data to my android app via BLE, but is it possible?
In PLEN's firmware:
void loop()
{
if (PLEN2::System::BLESerial().available())
{
PLEN2::System::BLESerial().write("From Plen");
}
}
And in android, i tried to read value of BLE_SHIELD_RX (BLE_SHIELD_TX return error)
if (isConnected) {
BluetoothGattService bluetoothGattService = gatt.getService(UUID.fromString(GATTAttributes.BLE_SHIELD_SERVICE));
if (bluetoothGattService == null) {
Log.e(TAG, "Can't get a BluetoothGattService");
return false;
}
BluetoothGattCharacteristic characteristic = bluetoothGattService.getCharacteristic(UUID.fromString(GATTAttributes.BLE_SHIELD_RX));
if (characteristic == null) {
Log.e(TAG, "Can't get a BluetoothGattCharacteristic");
return false;
}
gatt.readCharacteristic(characteristic); //return true
}
but in onCharacteristicRead, result is an array of 0. So i tried:
if (isConnected) {
BluetoothGattService bluetoothGattService = gatt.getService(UUID.fromString(GATTAttributes.BLE_SHIELD_SERVICE));
if (bluetoothGattService == null) {
Log.e(TAG, "Can't get a BluetoothGattService");
return false;
}
BluetoothGattCharacteristic characteristic = bluetoothGattService.getCharacteristic(UUID.fromString(GATTAttributes.BLE_SHIELD_RX));
if (characteristic == null) {
Log.e(TAG, "Can't get a BluetoothGattCharacteristic");
return false;
}
gatt.setCharacteristicNotification(characteristic, true);
BluetoothGattDescriptor descriptor = characteristic.getDescriptor(UUID.fromString(GATTAttributes.CLIENT_CHARACTERISTIC_CONFIG));
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
gatt.writeDescriptor(descriptor); //return true and onWriteDescriptor is called
}
but onCharacteristicChanged not called.
Am i miss something? Thank you!
Last edited by tk35 (2016-12-05 01:25:25)
Offline
Hi tk35,
Unfortunately, current firmware on PLEN2's head-board doesn't have a function that communicates to any other devices.
The firmware is also open-sourced. Please try to customize it if you want to do that :)
Offline
Hi admin,
Thank you for reply. But, cc debugger is required to customize BLE113 firmware right?
Offline
Offline