Hardware
- The Bluetooth device is powered by a chip called
atmega32
and uses abm78
Bluetooth chip. - The clock frequency of the MCU chip is
14.7456 MHz
. - The baud rate of Bluetooth device is
115200
. - The Bluetooth device transmits data in
BR/EDR mode
. - The Bluetooth device sends 8 signals sampled at
250Hz
in a packet. - The packet format is the
Cyton of OpenBCI
.
Software
- My app use
Rfcomm
to connect Bluetooth and receive data. - Importing data from the thread through
bluetoothSocket.getInputStream()
, the priority of the thread isThread.MAX_PRIORITY(10)
. And the priority of the process in which that thread operates isProcess.THREAD_PRIORITY_URGENT_AUDIO
. - My app draws a graph by obtaining an interval for each data reception.
- Since the signal is sampled at 250Hz, the average of the packet interval should be similar to
4ms
.
Problem
- But the average of the packet interval is
8ms
. - How can I speed up my Android Bluetooth reception?
What I want to know is how to increase the Bluetooth data reception speed in an Android app using Java. The data needs to be received every 4ms through the InputStream, but currently, my app is reading the data every 8ms. Considering that I cannot modify the BM78 module, how can I improve the reception speed in my Android app?