Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect bytes are send when using _arduinoConnector.writeBytes #27

Open
GoogleCodeExporter opened this issue Mar 30, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Incorrect bytes are send when using _arduinoConnector.writeBytes and they seems 
to be random each time I run the application

What steps will reproduce the problem?
Use _arduinoConnector.writeBytes and pass byteArray ec.

var b:ByteArray = new ByteArray();
b.writeInt(1);
_arduinoConnector.writeBytes(b);


What is the expected output? What do you see instead?
Correct byte should be send to com port

What version of the product are you using? On what operating system?
1.5

Please provide any additional information below.
1. I am using Advanced Serial Data Logger to check what bytes where send to com 
port.
2. Obly bypass I found is to send bytes one by one using writeByte

Original issue reported on code.google.com by [email protected] on 1 Oct 2013 at 9:44

@GoogleCodeExporter
Copy link
Author

Generally it seems that there is something wrong with biteArray writing and 
reading
http://code.google.com/p/as3-arduino-connector/issues/detail?id=25

but hopefully for now we can use loop

Read - temporary fix for read readBytesAsByteArray()
var byteArray:ByteArray = new ByteArray();

            while(_arduinoConnector.bytesAvailable)
            {
                byteArray.writeByte(_arduinoConnector.readByte());
            }

Write - temporary fix for writeBytes ()
var sent:Boolean = true;
            for (var i:uint = 0; i < byteArray.length; i++) 
            {
                var byteSent:Boolean = _arduinoConnector.writeByte(byteArray[i]);
                sent = sent && byteSent;
            }

            trace('sent status: ' + sent);

Original comment by [email protected] on 1 Oct 2013 at 10:18

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant