Reference   Language | Libraries | Comparison | Changes

Bridge : Bridge Class



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.


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

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


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.


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.

See Also

Back to Bridge Library page Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.