Home/Support/Support Forum/Using XBee Java Library from multiple threads

Using XBee Java Library from multiple threads

0 votes
I'm using XBee Java Library. Can commands to remote devices (like setDIOValue) be sent over serial port from multiple threads?
If not what are the recommended ways to achieve this?

Thanks,
Prakash
asked Oct 11, 2015 in DigiMesh Proprietary Mesh Networking by prakashkrishna New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

+1 vote
If you write your code correctly and have one thread for the COM port, then you could send and receive commands on different threads direct to that com port.
answered Oct 15, 2015 by mvut Veteran of the Digi Community (11,240 points)
Thanks for your response!
The COM Port is handled by the XBee Java Library internally. We've multiple APIs that can be accessed from the application. Channeling all the API calls in a single thread is not an easy task I believe. Would it be better if the library itself synchronizes all COM Port writes? Just thinking...
Not that I am aware of.
...