Matlab 2019b BLE communication with a peripheral

조회 수: 2 (최근 30일)
Zuolu Wang
Zuolu Wang 2020년 2월 14일
댓글: Joris Lambrecht 2021년 2월 5일
Matlab 2019b has integrated the function to connect Bluetooth Low Energy (BLE) devices. So I tried to read sensor data from TI’s CC2650 Sensortag. I have managed to find the device, establish connection and read the sensor data. I notice the characteristic can bind with a callback function through the property DataAvailableFcn. This could be a handy way to automatically read data published from the sensors. I have managed to bind the callback function and it can read the sensor data automatically.
The problem comes when I tried to read sensortag with a high sampling rate, for example 10Hz. It looks the read function can only read either the oldest or the latest data and it can only respond the notification once. This causes a delay in reading the data in the buffer.
Any suggestions to solve this problem? Thanks.
  댓글 수: 2
Balrog
Balrog 2020년 7월 15일
Interestingly, I too notice that the notification function doesn't respond continuously - Sometimes once or twice. I am not sure what's the issue though
Joris Lambrecht
Joris Lambrecht 2021년 2월 5일
I had a problem using the DataAvailableFcn until I realized I had called subscribe multiple times to the same charachteristic. The DataAvailableFcn got called for each subscription and I would get multiple copies of the same data. Calling unsubscribe didn't solve the problem, once I had subscribed more than once, so I cleared the object created with ble() and started over. Not sure if this is relevant to your situation, but it confused me for a while.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Bluetooth Low Energy Communication에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by