Disconnect from ble device in app designer

5 visualizaciones (últimos 30 días)
Niklas Maximilian Busse
Niklas Maximilian Busse el 4 de Jul. de 2022
Comentada: Niklas Maximilian Busse el 8 de Jul. de 2022
Hi everyone,
I am trying to disconnect from a ble device in app desginer, but somehow "clear app.ble" or "clear ble" does not work. I am still connected after that. Does anybody know how to disconnect properly?
  4 comentarios
Geoff Hayes
Geoff Hayes el 8 de Jul. de 2022
properties (Access = private)
Device ble % Description
? Are you defining two properties, one called Device and the other ble? I see the code
clear app.Device
but you indicate that it doesn't work. Is that because when you try to re-connect, you get an error saying "already connected" (or something similar)? Have you tried just setting
app.Device = [];
which I've seen in the forum but I'm not sure if that will work as expected.
I was able to connect to a device (from the command line) and the clear seemed to work (in that I could then re-connect to the same device). I didn't try from within an app though.
Niklas Maximilian Busse
Niklas Maximilian Busse el 8 de Jul. de 2022
Thanks for your replies, I think I found a solution which is similar to your proposal. in the declaration of the property, I dont define the data type
properties (Access = private)
Device
so I can set it to "" when I want to disconnect:
function onDeviceDisconnect(app)
app.Device = "";

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Code Execution en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by