B4J Question Question on use of astreams

Discussion in 'B4J Questions' started by HARRY, Mar 20, 2015.

  1. HARRY

    HARRY Active Member Licensed User

    Hi,

    An Arduino compter sends data to a Raspberry computer via USB; every 10 seconds a message with a length of 32 bytes. On the Raspberry I would like to use astreams in prefix mode.

    Therefore I make on the Arduino a message preceded with a 4 byte word (long) which contains as value the length of the message itself, so 32. Then 36 bytes are written.

    The Raspberry however does not recognize the length of the received message to be correct. It ends after several minutes with the error message that the message size is too large.

    Should this work or do I simplify too much?

    Harry
     
  2. HARRY

    HARRY Active Member Licensed User

    Hi,

    Problem solved. It was a matter of BigEndian, which should be false, but was set to true.

    Harry
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice