I've managed to write a Python program for my Raspberry Pi that interacts with BLE via D-Bus and can register GATT services and store data in chatacteristics that external devices can read. However, my goal is to send images from my Raspberry Pi (peripheral) to an Android/iOS device (central). I've started searching for information on how to do that and discovered that there is a pretty low limit on how much data can be stored in a GATT characteristic (answers range from 20 to 512 kB). Because of this limit, the larger data must be split into chunks and transferred using a rather complicated algorythm involving GATT notifcations. That made me wonder if I'm on the right path. It looks like an overhead to implement such a complicated algorythm to send an image via Bluetooth and the low data size limit makes me think that BLE isn't meant for this. Maybe I should just use classic Bluetooth with sockets? Or maybe someone can point me to an example of an application which sends image via BLE, because I couldn't find anything useful on the internet. I mainly chose to use BLE because I want to write the Android/iOS application using React Native and it only supports BLE client. Does iOS even support Bluetooth classic?
Asked
Active
Viewed 416 times
1
-
You can use L2CAP channel to send an arbitrary amount of data. – Emil Jan 09 '21 at 09:14
-
@Emil I know, but I thought that I could implement it using BLE as it's more modern and is supported in React Native. But I didn't realise it is still that complex with pretty much no high level libraries. Or do you want to say that there's a way to use L2CAP in BLE? – Salivan Jan 09 '21 at 09:36
-
Yes, you can use https://developer.android.com/reference/android/bluetooth/BluetoothDevice#createL2capChannel(int) with BLE. – Emil Jan 09 '21 at 12:16