-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
AP_Scripting: add a simple serial dump script #28912
base: master
Are you sure you want to change the base?
Conversation
the existing example seems to do *way* too much work so has trouble capturing at higher baud rates.
cdd49b8
to
c949077
Compare
Ports have |
if c == nil then | ||
break | ||
end | ||
file:write(string.char()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file:write(string.char()) | |
file:write(string.char(c)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question.
How was this working with this problem in here?!
The data coming out looked valid to me (it's in my LD06 PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, that would imply a really interesting bug in the Lua interpreter. I couldn't find the PR you mentioned, but I assume you fixed it and forgot to update the code in Git.
Also read
returns -1 on error, not nil
.
And it's strange to open and close the file every loop. Probably better to simply flush it every n loops.
And c
should be local...
I'm guessing we're not running that.... |
We could potentially look to see if we have the readstring binding and use it if available, 'though. I'll need to remove "Simple" from the script name then.... |
the existing example seems to do way too much work so has trouble capturing at higher baud rates.