I want to connect an android device over bluetooth with matlab for exchanging data between matlab and my own android app. But I can't connect via 'Instrument Control'-Toolbox with my android devices. Why?
First I scaned for all available devices and then tried to connect (with the 'connect'-button) with android.
I have this bluetooth device powered by an arduino which I can connect via COM port in a serial monitor such as putty. However I cannot do this in matlab. However I cannot do this in matlab. I set this up as a normal com port as follows. I verified the SPP connection using a BT terminal loopback (Shorted TX-RX on HC-05, used 'Bluetooth Serial Terminal' windows app, echoed correctly any text I transmitted) Next I initialized BT in Matlab and successfully opened a port.
I searched and it says:
Instrument Control Toolbox supports the Bluetooth Serial Port Profile (SPP) supported profiles only SPP support
So I read the technical spez. from my devices and I can't find that they support the needed SPP bluetooth profile.
Samsung Galaxy S Advance: Bluetooth Profiles: GAP, SSP, SDAP, HSP, HFP, A2DP, SAP, OPP, PBAT, MAP, AVRCP, HID tech spez. galaxy s
HTC One M7: Common profiles: HSP [headset], HFP [hands-free], A2DP [stereo audio], AVRCP [media control], HID [peripherals] tech spez. HTC One M7
But in the android documentation it says:
The most common type of Bluetooth socket is RFCOMM, which is the type supported by the Android APIs. RFCOMM is a connection-oriented, streaming transport over Bluetooth. It is also known as the Serial Port Profile (SPP). support SPP profile in android
So I think android itself support SPP, but not my used devices? Is there no way to connect one of these phones via bluetooth with matlab? Which android devices are working?
maryBlaamaryBlaa
1 Answer
Solution
Here 'activate bluetooth spp in android' it says:
On the Android phone you will probably need to run an application that initiates the service over SPP.
You need to listen for incoming connection requests, therefor you should use this function:
Here you can find some examples:
Code example
My fault was to think I can connect matlab and android without an own app, just with the android 'bluetooth' connection part in the settings.
Community♦
Parallel Connection
maryBlaamaryBlaa
What Is A Serial Connection
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Bluetooth Serial Connection Matlab Central System
Not the answer you're looking for? Browse other questions tagged androidmatlabsocketsbluetoothserial-port or ask your own question.