Différences entre versions de « Bluefruit-LE-Shield-ATCommands »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 23 : Ligne 23 :
 
{{ambox|text=Les mentions de \r et \n représentent respectivement le retour à la ligne et passage à la ligne suivante. Ces caractère sont rarement affichés tels quels... mais il est important de savoir qu'il sont présents si vous faite dialoguer des machines ensembles. }}
 
{{ambox|text=Les mentions de \r et \n représentent respectivement le retour à la ligne et passage à la ligne suivante. Ces caractère sont rarement affichés tels quels... mais il est important de savoir qu'il sont présents si vous faite dialoguer des machines ensembles. }}
  
== Mode commande d'écriture '=xxx' ==
+
== le mode: écriture de commande '=xxx' ==
 
'Write' mode is used to assign specific value(s) to the command, such as changing the radio's transmit power level using the command we used above.
 
'Write' mode is used to assign specific value(s) to the command, such as changing the radio's transmit power level using the command we used above.
  

Version du 2 juin 2017 à 16:39


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

A propos des commandes AT

Le module Bluefruit LE utilise un ensemble de commandes type "AT" (Hayes) pour configurer le périphérique.

L'avantage des commandes de type "AT" c'est qu'elles sont faciles à utiliser dans une communication machine-à-machine, tout en restant assez facile à lire/interpréter pour les humains.

Le mode: commande de test '=?'

Le mode de 'Test' est utiliser pour vérifier si une commande donnée existe (ou pas) dans le système.

Certaines versions de firmware ou certaines configurations pourraient (ou ne pourraient pas) inclure une commande spécifique. Vous pouvez tester la présence de la commande en saisissant le nom de la commande et en y ajoutant "=?" (comme dans l'exemple suivant:

AT+BLESTARTADV=?

Le périphérique réponde "OK" si la commande est présente. Si la commande n'existe pas alors le périphérique répondra "ERROR".

AT+BLESTARTADV=?
OK\r\n
AT+MISSINGCMD=?
ERROR\r\n

le mode: écriture de commande '=xxx'

'Write' mode is used to assign specific value(s) to the command, such as changing the radio's transmit power level using the command we used above.

To write a value to the command, simple append an '=' sign to the command followed by any paramater(s) you wish to write (other than a lone '?' character which will be interpretted as tet mode):

AT+BLEPOWERLEVEL=-8

If the write was successful, you will generally get an "OK" response on a new line, as shown below:

AT+BLEPOWERLEVEL=-8
OK\r\n

If there was a problem with the command (such as an invalid parameter) you will get an 'ERROR' response on a new line, as shown below:

AT+BLEPOWERLEVEL=3
ERROR\r\n

Note: This particular error was generated because '3' is not a valid value for the AT+BLEPOWERLEVEL command. Entering '-4', '0' or '4' would succeed since these are all valid values for this command.

Mode d'exécution

'Execute' mode will cause the specific command to 'run', if possible, and will be used when the command name is entered with no additional parameters.

AT+FACTORYRESET

You might use execute mode to perform a factory reset, for example, by executing the AT+FACTORYRESET command as follows:

AT+FACTORYRESET
OK\r\n

NOTE: Many commands that are means to be read will perform the same action whether they are sent to the command parser in 'execute' or 'read' mode. For example, the following commands will produce identical results:

AT+BLEGETPOWERLEVEL
-4\r\n
OK\r\n
AT+BLEGETPOWERLEVEL?
-4\r\n
OK\r\n

If the command doesn't support execute mode, the response will normally be "ERROR" on a new line.

Mode commande de lecture '?'

'Read' mode is used to read the current value of a command.

Not every command supports read mode, but you generally use this to retrieve information like the current transmit power level for the radio by appending a '?' to the command, as shown below:

AT+BLEPOWERLEVEL?

If the command doesn't support read mode or if there was a problem with the request, you will normally get an "ERROR" response.

If the command read was successful, you will normally get the read results followed by "OK" on a new line, as shown below:

AT+BLEPOWERLEVEL?
-4\r\n
OK\r\n

Note: For simple commands, 'Read' mode and "Execute" mode behave identically.


Basé sur "Bluefruit LE Shield" d'Adafruit Industries, écrit par Kevin Townsend - Traduit en Français par shop.mchobby.be CC-BY-SA pour la traduction
Toute copie doit contenir ce crédit, lien vers cette page et la section "crédit de traduction".

Based on "Bluefruit LE Shield" from Adafruit Industries, written by Kevin Townsend - Translated to French by shop.mchobby.be CC-BY-SA for the translation
Copies must includes this credit, link to this page and the section "crédit de traduction" (translation credit).

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com