Bluetooth Serial Port Matlab

Serial port capabilities, supported interfaces, andsupported platforms.

The serial port interface standard, signals and pinassignments, the serial data format, and finding serial port informationfor your platform.

The last step in this guide is to connect the UNO to Matlab via the Bluetooth serial link. Matlab has a very large rage of built in functions that control the serial communication (see appendix for more information on the functions). In Matlab create a serial com link object with the desired com port and baud rate.

These examples help you get started with the serialport interface.

Create a MATLAB® object that represents the serialI/O device. You can configure property values during object creation.

Establish a connection between MATLAB and theserial I/O device.

Bluetooth Serial Port Matlab

You can set values for baud rate, serial data format,parity checking, and other serial properties.

You can write data to the device and read data fromthe device. The data can be text or binary.

You can enhance the power and flexibility of yourserial port communication by using events. An event occurs after acondition is met and might result in one or more callbacks.

You can use control pins to signal the presence ofconnected devices and control the flow of data.

Recording information to disk provides a permanentrecord of your serial port session, and is an easy way to debug yourapplication. While the serial port object is connected to the device,you can record information, such as number of values, data, and eventinformation, to a disk file.

You can save and load serial port objects.

Serial

After the serial communication is complete, you shoulddisconnect the serial port object from the device and remove the objectfrom memory and the workspace.

You can use serial port properties for reading andwriting data, configuring the communication, performing callbacks,and other tasks. The properties are described here in detail.

Active4 years, 2 months ago

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 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 Young 2 (SM-G 130HN):
    Bluetooth®-Profile: HSP, OPP, SAP, A2DP, PBAP, HFP, AVRCP, DI, HID, HOGP, PAN, MAP
    tech spez. galaxy young
  • 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?

Bluetooth Serial Port Matlab Software

maryBlaamaryBlaa

1 Answer

Solution Cecchetti money banking financial markets 2nd edition.

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:

Serial

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.

Matlab

Bluetooth Serial Port Driver

Community
maryBlaamaryBlaa
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Not the answer you're looking for? Browse other questions tagged androidmatlabsocketsbluetoothserial-port or ask your own question.