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

Problem with . open() running only once. #42

Open
ghoumatn opened this issue Feb 2, 2023 · 2 comments
Open

Problem with . open() running only once. #42

ghoumatn opened this issue Feb 2, 2023 · 2 comments

Comments

@ghoumatn
Copy link

ghoumatn commented Feb 2, 2023

Hi,
I encounter this annoying result: the open method executed just once.
The resulting part of the code "Do actions" would only be performed once because mPhysicaloid no longer wants to open.

mPhysicaloid = new Physicaloid(mContext);
if (!mPhysicaloid.isOpened()) { /* if not opened */
    if(mPhysicaloid.open()){
       /* open connection */
    }
}
if (mPhysicaloid.isOpened()) {
    /* Do actions */
}
@xxxajk
Copy link

xxxajk commented Feb 3, 2023

Close the connection when done, and before you open, check if it's open first, and if it is, close it and reopen it.

@xxxajk
Copy link

xxxajk commented Feb 3, 2023

Also my github has a lot of these issues fixed, plus enhancements.
it's here: https://github.com/xxxajk/PhysicaloidLibrary

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

No branches or pull requests

2 participants