Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Geschrieben

Hi !

 

I want to use IPConnection to Enumerate each device connected to a Host (localhost for example) without user waiting (System.out.readline). How i can did that ? There isn't function to check that :/

 

Regards.

ealary

Geschrieben

Enumerating a stack configuration does not require user interaction. What is your issue with System.out.readXXX ?

Geschrieben
  • Autor

My issue is that i want wait to enumerate all device in an Host (Can have many host) before doing any processing.

 

The issue with System.out.read is to past this statement, an user should interact.

Without System.out.read, ipcon are disconnected and we aren't certain had enumerated devices...

 

(Sorry for my English)

Geschrieben

After re-reading what you wrote a few times (yes, I'm afraid your English is poor), I think I understand what you mean.

 

I'm afraid the core issue is how to coordinate multiple threads. The enumeration callbacks are called on a different thread than your own application thread. The callbacks are performed by a thread that is started by the Tinkerforge framework.

 

There are two approaches to solve the problem:

a) the hack: include a hard-coded delay of a few seconds

b) the proper way: use proper thread synchronization (e.g. using wait/notify, or any of the higher level concurrency mechanisms in java.util.concurrency).

 

The hack will probably be OK, and is just a matter of calling Thread.delay().

 

HTH

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.