-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
Linked NDK build and various cosmetic changes #1
Conversation
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.
Just some explanations on some modification I made in the pull request
|
||
if (getEnvStat != JNI_EDETACHED) { |
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.
This is not necessary, DetachCurrentThread guarantees no-op if there's nothing to detach (as attach does)
@@ -195,79 +190,53 @@ static void* ptyThread(void* irrelevant) | |||
{ | |||
// buf[nread] = '\0'; | |||
|
|||
if (CHECK_BIT(*buf, TIOCPKT_DATA)) |
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.
Here *buf must be compared directly with the defined constants, they are not bit masks
tcgetattr(master, &tio); | ||
__android_log_print(ANDROID_LOG_VERBOSE, "TAG", "Baudrate: %d\n", cfgetospeed(&tio)); | ||
if (tio.c_cflag & CS8) |
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.
These CS* bit masks actually must be filtered with CSIZE before comparison
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.
Actually most of those calls do nothing right now. I should probably do a larger refactor here. The idea was to get parity, stop bits, and bit size parameters from here and pass them through JNI, but for now I'm just passing the raw values of termios inside the SerialData
object.
@@ -1,8 +0,0 @@ | |||
## This file must *NOT* be checked into Version Control Systems, |
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 deleted this file since this should not be at all in the VCS, since it contains local machine settings
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.
Thanks a lot for this contribution :)
tcgetattr(master, &tio); | ||
__android_log_print(ANDROID_LOG_VERBOSE, "TAG", "Baudrate: %d\n", cfgetospeed(&tio)); | ||
if (tio.c_cflag & CS8) |
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.
Actually most of those calls do nothing right now. I should probably do a larger refactor here. The idea was to get parity, stop bits, and bit size parameters from here and pass them through JNI, but for now I'm just passing the raw values of termios inside the SerialData
object.
CI fail unrelated. |
I added the NDK build dependency to gradle to automate the c++ compilation.
I made also a bunch of cosmetic c++ changes to vsp-pty.cpp.