RB-ARD-YUN-Bridge-Func-transfer

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche


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.