필터 지우기
필터 지우기

How to use Bluetooth Low Energy in a compiled application ?

조회 수: 4 (최근 30일)
Hugo Bourcier
Hugo Bourcier 2021년 12월 9일
편집: Ayush 2024년 5월 21일
I am trying to compile a Matlab Application using BLE communication into a standalone app. The application is compiled properly, without any errors, and can be launched, but each time I try to scan BLE devices using the function blelist, the application crashes.
I used the diary function to get the error message, and it says that " Bluetooth permission is not enabled for MATLAB. Allow MATLAB or Terminal to use Bluetooth from the Security & Privacy settings ". Of course, I allowed both Matlab and Terminal to use Bluetooth, but the errors still occurs and the application continues to crash.
I don't know if I missed an application to add into the Bluetooth permissions, like an executable of Matlab Runtime ?
I work on macOs, if it can help.
Thanks for your help !

답변 (1개)

Ayush
Ayush 2024년 5월 21일
편집: Ayush 2024년 5월 21일
Hello Hugo,
To resolve the issue of your MATLAB compiled application crashing whenever you are trying to scan the Bluetooth Low Energy (BLE) devices, you can consider the following workarounds:
1. Since the standalone application runs in MATLAB Runtime which requires additional Bluetooth permissions that MacOS would not have allowed automatically, and you must ensure that MATLAB Runtime is specifically allowed in the list.
2. You can try modifying the Info.plist file for Bluetooth permissions, by modifying the permission keys i.e. NSBluetoothPeripheralUsageDescription and NSBluetoothAlwaysUsageDescription providing reasons for access.
3. Ensure that the application’s deployment target is supported by MacOS to avoid any system specific permission constraints.
4. You can try testing on another machine to identify if the issue is machine-specific or a broader issue. Thereafter, you can try contacting MathWorks support for specific solutions for BLE communication in compiled MATLAB application on MacOS. Please refer to the link below to visit the support website:
For more information on BLE communication and its troubleshooting techniques you can refer to the following documentations:
Hope it helps!

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by