- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I am configuring Bluetooth profile. BLE device has got data to transfer it to app.
But same time App is sending various commands and based on those command BLE device should send the data to app.
what type of profile is suitable for Bluetooth? Do I need to go for HCI interface or Profile is okay for the Implementation?
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use a Custom Profile and then create two characteristics, one for the app to send commands and other for the peripheral to send data. The first characteristic will have Write Property and other characteristic can be Read or Notify.
So when the App sends the commands, the peripheral will prepare the data accordingly and then notify the app when the data is ready. The app should then process the data. I would suggest doing it this way.
You could also make the app to just keep reading intead of waiting for the notify, but will consume more power.
Make use of AsyncTasks in Android SDK to send commands and process the data in the background instead of running it in the main thread.
Regards,
Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use a Custom Profile and then create two characteristics, one for the app to send commands and other for the peripheral to send data. The first characteristic will have Write Property and other characteristic can be Read or Notify.
So when the App sends the commands, the peripheral will prepare the data accordingly and then notify the app when the data is ready. The app should then process the data. I would suggest doing it this way.
You could also make the app to just keep reading intead of waiting for the notify, but will consume more power.
Make use of AsyncTasks in Android SDK to send commands and process the data in the background instead of running it in the main thread.
Regards,
Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any code example is available to refer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can find code examples here: PSoC-4-BLE/100_Projects_in_100_Days at master · cypresssemiconductorco/PSoC-4-BLE · GitHub
Regards,
Dheeraj