You are not logged in.
Pages: 1
Hi admin,
Thank you for reply. But, cc debugger is required to customize BLE113 firmware right?
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!
Pages: 1