Modifications

Sauter à la navigation Sauter à la recherche
300 octets ajoutés ,  4 décembre 2013 à 11:41
aucun résumé de modification
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 ==
29 917

modifications

Menu de navigation