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

Linked NDK build and various cosmetic changes #1

Merged
merged 1 commit into from
Mar 27, 2021

Conversation

bitblaster
Copy link
Contributor

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.

Copy link
Contributor Author

@bitblaster bitblaster left a 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) {
Copy link
Contributor Author

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))
Copy link
Contributor Author

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)
Copy link
Contributor Author

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

Copy link
Owner

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,
Copy link
Contributor Author

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

Copy link
Owner

@feelfreelinux feelfreelinux left a 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)
Copy link
Owner

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.

@feelfreelinux
Copy link
Owner

CI fail unrelated.

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

Successfully merging this pull request may close these issues.

2 participants