Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Lexter11745yIf you can develop, develop than. If you can't, put the senior word before your degree and command others who actualy can.
-
nibor48775y
-
hitko31485yCould you show some code where you're reading raw bytes from hardware device? I'm quite curious as every solution I'm aware of uses third-party libraries in C / C++ / ... to support that.
-
@hitko https://sourceforge.net/p/...
If you dont wanna read the code, its just gnu.io._ and a stream/bufferedreader -
hitko31485y@tekashi That uses jSerialComm, which is written in C and compiled for each platform. It just has Java bindings, and that's exactly the "can't do it in Java" I believe @johnmelodyme's senior meant.
-
@hitko if you really want to, you can just read the file unix dumps serial data into
-
hitko31485y@tekashi Yeah, that would work to display HEX data from a device and possibly send some bits to it. Problem is it's by design practically impossible to do anything more with it without system calls, and unless a language provides bindings for those calls (which Java & other higher-level languages don't, except for a handful of basic operations), then you need a native library.
Can you interact with serial devices in Java? Yes. Can you do it in pure Java, so it can be platform-agnostic? No, since it's not a part of Java runtime, but you can achieve the most basic access on a limited number of systems.
Senior argue with me that Java can’t do serial programming, I prove to him by read the hardware protocol in HEX , and convert to ASCII using Java. He said the F word to me , I was like “他是什麼意思啊?”
rant