Modifications

Sauter à la navigation Sauter à la recherche
aucun résumé de modification
Ligne 1 : Ligne 1 :  
{{Arduino Yun-NAV}}
 
{{Arduino Yun-NAV}}
   −
<h4>begin()</h4>
+
<h4>transfer()</h4>
    
== Description ==
 
== Description ==
Classe [[Arduino Yun-Librairie#Bridge_-_classes_et_m.C3.A9thodes|Bridge]], librairie/bibliothèque  d'[[Arduino Yun-Librairie|Arduino Yùn]].
+
''transfer()'' is used by other functions that communicate between the ATMega32u4 microcontroller and the Linux processor.
   −
Starts Bridge, facilitating communication between the AVR and Linux processor. This should be called once in ''setup()''
+
Method to transfer a frame. This methods implement a protocol that feature error correction and response from the Linux processor
   −
''begin()'' is a blocking function. Once you call Bridge.begin(), nothing else will happen in your sketch until it has completed. This process takes approximately three seconds.  
+
The two sides of Bridge make use of a serial protocol to transfer a message to each other. A call to a ''Bridge.transfer()'', sends a message to the Linux side and waits for an answer. ''transfer()'' also checks for the integrity of the packet and rejects packet that contain errors.
 +
 
 +
The function implements a re-transmission mechanism if an acknowledgment is not sent from Linux within 100 ms, or if the packet is corrupt. The re-transmission is repeated until an answer is received from Linux.
 +
 
 +
''transfer()'' function returns the length of the buffer that contains the answer from Linux.  
    
== Syntaxe ==
 
== Syntaxe ==
   −
Bridge.begin()  
+
transfer(buff1, len1, buff2, len2, buff3, len3, rxbuff, rxlen);
 +
 
 +
Fonctions dérivées:
    +
<nowiki>derived functions:
 +
transfer(buff1, len1);
 +
transfer(buff1, len1, rxBuff, rxLen);
 +
transfer(buff1, len1, buff2, len2, rxBuff, rxLen); </nowiki>
 
== Paramètres ==
 
== Paramètres ==
   −
aucun
+
* '''buff_N''': is the buffer N array with the content of the message you want to send. The transfer function support up to 3 buffers to be concatenated.
 +
* '''len_N''': is the number of element contained in the buffer_N.
 +
* '''rxbuff''': is the support buffer that you pass as a parameter where the answer from the linux side will be stored.
 +
* '''rxLen''': is the length of the rxBuffer.
    
== Résultat ==
 
== Résultat ==
   −
aucun
+
The length of the buffer that contains the answer from Linux. In case the ''rxlen'' is shorter than the length of the answer, the function will return ''rxlen'' to indicate that the rx buffer is full.  
 
  −
== Exemple ==
  −
 
  −
aucun
  −
 
  −
== Voir aussi ==
  −
* [[RB-ARD-YUN-Class-Bridge|constructeur Bridge]]
  −
* [[RB-ARD-YUN-Process-Func-begin|Process.begin()]]
  −
* [[RB-ARD-YUN-Console-Func-begin|Console.begin()]]
  −
* [[RB-ARD-YUN-Bridge-Func-readMessage|Bridge.readMessage()]] [http://arduino.cc/en/Reference/YunReadMessage src]
  −
* [[RB-ARD-YUN-Bridge-Func-writeMessage|Bridge.writeMessage()]] [http://arduino.cc/en/Reference/YunWriteMessage src]
  −
* [[RB-ARD-YUN-Bridge-Func-messageAvailable|Bridge.messageAvailable()]] [http://arduino.cc/en/Reference/YunMessageAvailable src]
  −
 
      
{{Arduino Yun-TRAILER}}
 
{{Arduino Yun-TRAILER}}
29 837

modifications

Menu de navigation