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

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
(Page créée avec « {{Arduino Yun-NAV}} <h4>begin()</h4> == Description == Classe Bridge, librairie/bibliothèque d'[[Arduino Yun-L... »)
 
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}}

Version du 4 décembre 2013 à 11:48


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.

transfer()

Description

transfer() is used by other functions that communicate between the ATMega32u4 microcontroller and the Linux processor.

Method to transfer a frame. This methods implement a protocol that feature error correction and response from the Linux processor

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

transfer(buff1, len1, buff2, len2, buff3, len3, rxbuff, rxlen); 

Fonctions dérivées:

derived functions:
transfer(buff1, len1);
transfer(buff1, len1, rxBuff, rxLen);
transfer(buff1, len1, buff2, len2, rxBuff, rxLen); 

Paramètres

  • 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

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.


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.