- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have a question regarding PSOC4 BLE data transmission to Android App developed in Android Studio.
I configure analog pin in PSOC Creator to connect with an ADC converter and then transmit this value to Android App. For the initial single integer data, this works well, and I receive the data in the Android App and can plot very well.
The bandwidth is a bit low (~100Hz), so I increased the number of samples transmitted with each read request (increasing MTU to 512). The analog in integer becomes an array, and I run a loop to fill up the array before updating the data transmission. I have connected with Cypress CYSmart Dongle and I can see my data showing up on the console when I enable notifications.
After enabling notifications in Android, and trying to read the AnalogIn characteristic, the data is always displaying Null. I try different offsets, but doesnt change. I have read many forums on this, but I cannot seem to find the issue.
http://www.cypress.com/comment/340476
This is code in Android for enabling notifications to BLE. The CAPSENSE in project still works, and seems to provide some data, however the array only returns null.
public boolean setCharacteristicNotification(BluetoothGattCharacteristic characteristic,boolean enable,BluetoothGattDescriptor descriptor)
{
mBluetoothGatt.setCharacteristicNotification(characteristic, enable);
descriptor.setValue(enable ? BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE : new byte[]{0x00, 0x00});
return mBluetoothGatt.writeDescriptor(descriptor); }//descriptor write operation successfully started?
Thanks for any help you can provide.
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please find the attached project in which I'm able to send 509 bytes of data continuously when notification was enabled at client side.
The API CyBle_GattcExchangeMtuReq() is used by the GATT Client to send Maximum Transmitted Unit (GATT MTU) supported by the GATT Client. Default GATT MTU size as per Bluetooth 4.1 core specification is 23 bytes. If the GATT Client supports a size greater than the default, it has to invoke this function with the desired GATT MTU size. This function should only be initiated once during a connection.
Please note that for Some of the mobiles( with having Bluetooth version 4.0 or lower) will not send the MTU request to the peripheral devices. So these devices accepts the default MTU size of length 23 bytes only. Can you please check with mobile phones with having Bluetooth v4.1 or higher and also check with Android CySmart App.
Please let me know if this helps.
Thanks,
P Yugandhar.