FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV Mobile 2024
→
BTActivate(True)
BTActivate(True)
Débuté par Werner, 10 jan. 2020 22:50 - 5 réponses
Connectez-vous…
Werner
#1
Membre enregistré
10 messages
Posté le 10 janvier 2020 - 22:50
Hello,
I want check bluetooth-connection with this code:
IF
BTStatus
(
) =
btDisabled
THEN
n
Bluetooth
=
BTActivate
(
True
)
SWITCH
n
Bluetooth
CASE
btActivationInProgress
:
Info
(
"Bluetooth is being enabled on the device."
)
CASE
btDeactivationInProgress
:
Info
(
"Bluetooth is being disabled on the device."
)
CASE
btDisabled
:
Info
(
"Bluetooth is disabled on the device."
)
CASE
btError
:
Info
(
"The activation status of Bluetooth was not retrieved."
)
END
END
if BT is deactivated, with BTActivate(True) it will be activate, but the function returns btDisabled.
--
Thanks,
Werner
Signaler
0
0
Werner
#2
Membre enregistré
10 messages
Posté le 13 janvier 2020 - 14:09
Nobody has an idea?
--
Thanks,
Werner
Signaler
0
0
erbl
#3
Membre enregistré
201 messages
Popularité : +6 (10 votes)
Posté le 13 janvier 2020 - 14:25
Hi
Why do you use switch on nBluetooth ??
You should use SWITCH BTStatus() instead
(However, sorry if I made mistakes , I'm French ^_^)
Signaler
0
0
Werner
#4
Membre enregistré
10 messages
Posté le 13 janvier 2020 - 15:21
Hello erbl,
what is wrong with my Code? nBluetooth should have the return value from BTActivate(TRUE). With switch on nBluetooth I only Show a message.
The result of BTActivate should be:
Activation status of Bluetooth after the modification
--
Thanks,
Werner
Signaler
0
0
erbl
#5
Membre enregistré
201 messages
Popularité : +6 (10 votes)
Posté le 13 janvier 2020 - 15:35
OK Sorry
BTActive returns btDisabled but it should return btEnabled that's it ?
What returns BTSTatus ?
We don't see all the code, nBluetooth is actualy an Integer ? For now I don't understand why it doesn't work
Signaler
0
0
Werner
#6
Membre enregistré
10 messages
Posté le 13 janvier 2020 - 17:01
Here more code;
n
Bluetooth
is int
IF
BTStatus
(
) =
btDisabled
THEN
n
Bluetooth
=
BTActivate
(
True
)
SWITCH
n
Bluetooth
CASE
btActivationInProgress
:
Info
(
"Bluetooth wird gerade aktiviert."
)
CASE
btDeactivationInProgress
:
Info
(
"Bluetooth wird gerade deaktiviert."
)
CASE
btDisabled
:
Info
(
"Bluetooth ist deaktiviert."
)
CASE
btError
:
Info
(
"Der Bluetooth-Status konnte nicht ermittelt werden."
)
END
END
IF
BTStatus
(
) =
btEnabled
THEN
why doesn't the indentation work here? I have copied the code directly from Windev Mobile Editor...
BTStatus() returns FALSE but after that Bluetooth is on. I think, activating Bluetooth takes some time? That could be the reason, why BTActivate(True) returns FALSE...
--
Thanks,
Werner
Signaler
0
0
→ Revenir à WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte