Différences entre versions de « RB-ARD-YUN-Bridge-Func-get »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 1 : Ligne 1 :
 
{{Arduino Yun-NAV}}
 
{{Arduino Yun-NAV}}
  
<h4>put()</h4>
+
<h4>get()</h4>
  
 
== Description ==
 
== Description ==
The ''put()'' function allows you to store data on the Linux processor using a Key/Value structure. The Key field is like a label and you can associate a value to it. The key name must be unique in order to identify the correct value. On the Linux side there is a data store where all the keys and the values are saved.
+
'''get()''' allows you to read a key/value item previously saved on the Linux processor. You can request for a value stored in the datastore by passing get() the Key you want to search for, the support buffer, and its size. The Key is similar to a label, used to identify an associated value. The key name must be unique in order to identify the correct value.
  
The datastore is saved in the RAM of the AR9331, you will lose the datastore when you restart the bridge software on the Linux side (through power cycling, resetting the Linux processor, or uploading a sketch through WiFi or Ethernet). You will not lose the datastore if you reset the ATMega32u4 processor.
+
The datastore is saved in RAM, you will lose the datastore when you restart the bridge software on the Linux side (through power cycling, resetting the Linux processor, or uploading a sketch through WiFi or Ethernet). You will not lose the datastore if you reset the ATMega32u4 processor.  
  
 
== Syntaxe ==
 
== Syntaxe ==
  
  bridge.put(key, value)
+
  bridge.get(key, buffer, buffer_length)  
  
 
== Paramètres ==
 
== Paramètres ==
* '''key''': char or string, the key name you want to assign to identify the value.
+
* '''key''': The name of the key associated with the value you are requesting.
* '''value''': char or string, the value you want to store.
+
* '''buffer''': The support buffer used to save the value returned from the searched Key. A string terminator is added after the last byte that compose the value filed has been read.
 +
* '''buffer_length''': the length of the buffer passed to the function.  
  
 
== Résultat ==
 
== Résultat ==
  
aucun
+
The function returns the length of the read byte of the requested value.
  
 
== Exemple ==
 
== Exemple ==

Version du 4 décembre 2013 à 11:41


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.

get()

Description

get() allows you to read a key/value item previously saved on the Linux processor. You can request for a value stored in the datastore by passing get() the Key you want to search for, the support buffer, and its size. The Key is similar to a label, used to identify an associated value. The key name must be unique in order to identify the correct value.

The datastore is saved in RAM, you will lose the datastore when you restart the bridge software on the Linux side (through power cycling, resetting the Linux processor, or uploading a sketch through WiFi or Ethernet). You will not lose the datastore if you reset the ATMega32u4 processor.

Syntaxe

bridge.get(key, buffer, buffer_length) 

Paramètres

  • key: The name of the key associated with the value you are requesting.
  • buffer: The support buffer used to save the value returned from the searched Key. A string terminator is added after the last byte that compose the value filed has been read.
  • buffer_length: the length of the buffer passed to the function.

Résultat

The function returns the length of the read byte of the requested value.

Exemple

aucun

Voir aussi


Source: Arduino Yun, Guide to the Arduino Yún. Crédit: Arduino.cc, licence Creative Common Attribution ShareAlike.

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.