Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

TINIm400 module and timed reading

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi,
I'm creating this thread in order to get some details about the applications i'm currently coding.

I have to create a system based on TINI module which acqauires datas from a satellite sensor, gets it y serial comm, to the TINI, which sends it over Ethernet to a computer.
At the moment, I can read by RS232, send over Ethernet. So overally it works fine. However I still have to follow some requirements :
-I have to read and send every seconds.
-Any datas that has not changed since the previous one must not be sent.
-Managing threads.

here is the code :



I commented the code as much as I can unfortunatly it's in french.

I meet the following problems , I don't see how to time this operation, I thought it was thanks to the setEnableReceiveTimeOut function but it doesn't seem so.

I have to give a clear defintion of my thread management, is the volatile attribute I used for this running variable correct?


Le thanks

regards
 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Le thanks ... that's cute.

Anyway, do you really need multiple threads for something that should only happen once a second? If not, you could probably use java.lang.Timer to handle the scheduling. If you really need multiple thread, then java.util.concurrent.ScheduledThreadPoolExecutor is probably more appropriate. I've never had to that class myself though.

In any case, it doesn't seem that the actual I/O is causing you any trouble. If you want, I can move this over to our Threads forum, where you might get some better feedback on the concurrency issues.
 
Sofiene Hammad
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi and thanks for your answer, I will try to use those 2 libraries you just gave me, however I'm not sure if my TINI board can handle those. Yes I maybe forgot to mention that the application must be uploaded on the card. So this is the JVM embedded on the card that runs everything.
About the thread management, I will move it into the right section asap.
Regards
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Sofiene, please don't recreate threads in different forums. We will move this thread for you.
 
Sofiene Hammad
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Sorry for that ^_^
I'm kind of in a hurry these days, expiration date comes faster than what I was expecting.
 
    Bookmark Topic Watch Topic
  • New Topic