BLE on tinyB java characteristic has no notify - java

i`m trying to connect simple device(AB Shutter3) to java application on PC, but get no notification till connect. For test try
BluetoothDevice currentDev = (BluetoothDevice) container.getDevice();
currentDev.setTrusted(true);
if(!currentDev.getConnected()) {
currentDev.connect();
}
logger.info(currentDev.getName());
then get ALL services, descriptors and try to enable notifications like:
public void findServiceAndCharacteristic(BlueToothDeviceContainer container, String serviceUid){
for (BluetoothGattService service : container.getGattServices()) {
if(service.getUUID().equals(CUSTOM_SHUTTER_SERVICE_2.value) ||
service.getUUID().equals(CUSTOM_SHUTTER_SERVICE.value) ||
service.getUUID().equals(GENERAL_DEVICE_INFORMATION.value)){
List<BluetoothGattCharacteristic> characteristics = service.getCharacteristics();
for(BluetoothGattCharacteristic ch : characteristics){
logger.info(ch.getUUID());
try {
List<BluetoothGattDescriptor> descrs = ch.getDescriptors();
for(BluetoothGattDescriptor ds : descrs){
ds.enableValueNotifications(new BluetoothNotification<byte[]>() {
#Override
public void run(byte[] bytes) {
logger.info(ds.getUUID() + "getted");
logger.info("BUTTON WAS PUSHED!!!");
}
});
}
} catch (BluetoothException ex){
logger.warn(ch.getUUID() + " does not work.");
}
try{
BluetoothNotification btnm = new BluetoothNotification<byte[]>() {
#Override
public void run(byte[] bytes) {
logger.info(ch.getUUID() + "getted CH");
logger.info("BUTTON WAS PUSHED!!!");
}
};
ch.enableValueNotifications(btnm);
} catch (BluetoothException ex){
logger.warn(ch.getUUID() + " does not work.");
}
}
but run method does not work. What am i doing wrong, does anybody knows?

Problem was not at library. Problem at HID characteristic. It was not found on device, so there was no notifications from it.

Related

Moving to next activity once my QR Code has been scanned

I have limited Android Experience and had a very basic doubt. My scenario is as follows:
I currently have 2 applications, one being a QR Code Scanner and another which displays a QR Code. These will be running on multiple devices. The communication steps which take place are as follows:
Prior Setup:
There is a firebase database containing strings for QR Codes to be generated.
Device 2 reads the Code off the Firebase Database and displays it on the Screen (2nd App).
Device Communication:
Device 1 has the Scanner App and Device 2 has the QR Code displayed on Screen.
Device 1 now scans the QR Code from the Device 2 and verifies through some logic whether QR Code is valid or not.
If QR Code is valid, then the following takes place:
Device 1 calculates a new QR Code and places it on the Firebase Database.
The Device 2 should now move from displaying the QR Code to another activity which has the logic to Scan QR Codes of other Devices and verifies if they are correct.
Device 3 onwards must display a new QR Code which is on the Firebase Database which can now be scanned by Devices 1 and 2.
Note: The QR Code Updates on UI must keep happening until there is some sort of indication which makes the Device move to the QR Code Scanning stage.
Things which are working:
The 2 activities of the application (QR Code Display and QR Code Scanning) working independently.
QR Code Updates on UI whenever Firebase Database updated.
Things which are not working:
Moving from QR Code Display to Scanning once the QR Code is deemed valid.
Things I have tried:
Creating a Server Socket Implementation on the QR Code Display Application which is running as a Service called by my Main Activity. Client Socket Implementation (placed as a Service) is on the QR Code Scanner, which will send data to the Listening Server Socket once the QR Code is deemed valid. (Issue is that neither data is sent nor received).
Creating a Server Socket Implementation on the QR Code Display Application which is running as a Service called by my Main Activity. Client Socket Implementation (placed on UI Thread) is on the QR Code Scanner, which will send data to the Listening Server Socket once the QR Code is deemed valid.(Issue is that neither data is sent nor received)
I am very confused as to whether my approach is correct. Is there a better way to do it? Code for my service is as follows:
Device 2 - QR Code Display App:
Service
public class MyService extends Service {
private static final String TAG = "MyService";
private T_Client client;
#Override
public void onDestroy() {
Log.v(TAG, "onDestroy");
if (client != null) {
try {
client.stopClient();
} catch (Exception e) {
Log.e(TAG, "Error on close: " + e);
}
}
super.onDestroy();
Toast.makeText(this, "Service stopped", Toast.LENGTH_LONG).show();
}
#Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.v(TAG, "onStartCommand");
client = new T_Client();
client.start();
Toast.makeText(this, "Service started", Toast.LENGTH_LONG).show();
return START_STICKY;
}
#Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
return null;
}
}
Display Server Implementation (Called T_Client)
public class T_Client extends Thread {
private static final String TAG = "T_Client";
private Socket sock = null;
private boolean running = false;
private ObjectInputStream in;
private ObjectOutputStream out;
private Object objIn;
public void send(String _msg) {
if (out != null) {
try {
out.writeObject(_msg);
out.flush();
Log.i("Send Method", "Outgoing : " + _msg.toString());
} catch (IOException ex) {
Log.e("Send Method", ex.toString());
}
}
}
public void stopClient() {
Log.v(TAG,"stopClient method run");
running = false;
}
#Override
public void run() {
running = true;
try {
ServerSocket sock1 = new ServerSocket(9999);
try {
Log.i(TAG, "C: Connected.");
while (running) {
sock = sock1.accept();
out = new ObjectOutputStream(sock.getOutputStream());
in = new ObjectInputStream(sock.getInputStream());
objIn = in.readObject();
Log.i("Object Read Class", objIn.getClass().toString());
Log.i("Object Read", objIn.toString());
/* Currently commented because startActivity not recognised
if (objIn != null) {
Intent dialogIntent = new Intent();
dialogIntent.setClass(this, MainActivity.class);
dialogIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(dialogIntent);
}
Atleast the data should get read here
*/
System.out.println("Object Read Class" + objIn.getClass().toString());
System.out.println("Object Read" + objIn.toString());
}
Log.e("RESPONSE FROM SERVER", "S: Received Message: '" + objIn + "'");
} catch (Exception e) {
Log.e(TAG, "S: Error", e);
} finally {
out.close();
in.close();
sock.close();
Log.i(TAG, "Closing socket: " + sock);
}
} catch (Exception e) {
Log.e(TAG, "C: Error", e);
}
}
}
Intent intent=new Intent(getContext().getApplicationContext(),MyService.class);
getContext().startService(intent);
Scanner Application: (Written in Kotlin)
Scanner Client Implementation (Called T_Server)
internal class T_Server : Thread() {
private var sock: Socket? = null
private var running = false
private var out: ObjectOutputStream? = null
private val objIn: Any? = null
var blockchain_kotlin_copy = SecondActivity().blockchain_kotlin_copy
fun send(_msg: String) {
if (out != null) {
try {
out!!.writeObject(_msg)
out!!.flush()
Log.i("Send Method", "Outgoing : $_msg")
} catch (ex: IOException) {
Log.e("Send Method", ex.toString())
}
}
}
fun stopClient() {
Log.v(TAG, "stopClient method run")
running = false
}
override fun run() {
running = true
try {
val sock1 = ServerSocket(9999)
try {
Log.i(TAG, "C: Connected.")
while (running) {
sock = sock1.accept()
try {
out = ObjectOutputStream(sock!!.getOutputStream())
out!!.writeObject(blockchain_kotlin_copy)
out!!.flush()
out!!.reset()
Log.i("Send Method", "Outgoing : $blockchain_kotlin_copy")
println("Out is being sent")
println("$blockchain_kotlin_copy")
} catch (ex: IOException) {
Log.e("Send Method", ex.toString())
}
}
} catch (e: Exception) {
Log.e(TAG, "S: Error", e)
} finally {
out!!.close()
sock!!.close()
Log.i(TAG, "Closing socket: " + sock!!)
}
} catch (e: Exception) {
Log.e(TAG, "C: Error", e)
}
}
companion object {
private val TAG = "T_Server"
}
}
Service
public class MyService extends Service {
private static final String TAG = "MyService";
private T_Server client;
#Override
public void onDestroy() {
Log.v(TAG, "onDestroy");
if (client != null) {
try {
client.stopClient();
} catch (Exception e) {
Log.e(TAG, "Error on close: " + e);
}
}
super.onDestroy();
Toast.makeText(this, "Service stopped", Toast.LENGTH_LONG).show();
}
#Override
public int onStartCommand(Intent intent, int flags, int startId) {
Log.v(TAG, "onStartCommand");
client = new T_Server();
client.start();
Toast.makeText(this, "Service started", Toast.LENGTH_LONG).show();
return START_STICKY;
}
#Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
return null;
}
}
Main Activity
val intent = Intent(this, MyService::class.java)
this.startService(intent)
It sounds like you might be interested in Firebase Device-to-Device notification. You might do as follows
Device X displays QR code
Some Device Y reads the QR code from Device X and if(verified) sendNotificationToDevice(X)
Device X moves to Scanner activity to read from some other Device Z.
Besides the link above, there are a number of YouTube tutorials and Medium blog posts on how to implement Device-to-Device notification.

Threads Error Memcached cloud Heroku Java

Background
We are developing a Java service in Heroku with 1 dyno, which is using Memcached cloud.
Issue
Meanwhile we were developing and testing it, It was working fine. However, when we decided to test it in a real environment, It started to return the following error:
java.lang.OutOfMemoryError: unable to create new native thread
java.lang.Thread.start0(Native Method)
java.lang.Thread.start(Thread.java:717)
net.spy.memcached.MemcachedConnection.<init>(MemcachedConnection.java:306) net.spy.memcached.DefaultConnectionFactory.createConnection(DefaultConnectionFactory.java:209)
net.spy.memcached.MemcachedClient.<init>(MemcachedClient.java:209)
Memcached.<init>(Memcached.java:34)
Main.lambda$main$1(Main.java:101)
spark.SparkBase$1.handle(SparkBase.java:311)
spark.webserver.MatcherFilter.doFilter(MatcherFilter.java:159)
spark.webserver.JettyHandler.doHandle(JettyHandler.java:60)
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:179)
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
org.eclipse.jetty.server.Server.handle(Server.java:451)
org.eclipse.jetty.server.HttpChannel.run(HttpChannel.java:252)
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:266)
org.eclipse.jetty.io.AbstractConnection$ReadCallback.run(AbstractConnection.java:240)
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:596)
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:527)
java.lang.Thread.run(Thread.java:748)
We didn't have so much clients to arrive at 256 process or threads (limit of 1 dyno)
Workaround
We don't know it yet
Code
<!--Main-->
//...
try {
memcached = new Memcached ();
}
catch (Exception e) {
memcached = null;
}
//...
<!--Memcached-->
public class Memcached {
private MemcachedClient memcachedClient;
private boolean connected;
public Memcached () throws Exception {
setConnected(true);
try {
AuthDescriptor ad = new AuthDescriptor(new String[] { "PLAIN" },
new PlainCallbackHandler(System.getenv("MEMCACHEDCLOUD_USERNAME"),
System.getenv("MEMCACHEDCLOUD_PASSWORD")
)
);
setMemcachedClient(new MemcachedClient(
new ConnectionFactoryBuilder()
.setDaemon(true)
.setFailureMode(FailureMode.Retry)
.setProtocol(ConnectionFactoryBuilder.Protocol.BINARY) //this is the line 34
.setAuthDescriptor(ad).build(),
AddrUtil.getAddresses(System.getenv("MEMCACHEDCLOUD_SERVERS"))
));
} catch (Exception ex) {
// the Memcached client could not be initialized
setConnected(false);
throw new Exception ("{\"ErrorCode\":20,\"Portal\":\"Memcached\",\"ResponseCode\":\"\",\"Message\":\""
+ ex.getMessage() + "\"}");
}
}
public String get (String service, String fromCurrency, String toCurrency) {
if (!isConnected()) {
return null;
}
try {
return (String) getMemcachedClient().get(service + ";" + fromCurrency + ";" + toCurrency);
}
catch (Exception e) {
return null;
}
}
public boolean set (String service, String fromCurrency, String toCurrency, String value) {
if (!isConnected()) {
return false;
}
try {
double hour = Double.parseDouble(System.getenv("TIME_CACHE_HOUR"));
getMemcachedClient().set(service + ";" + fromCurrency + ";" + toCurrency, (int)(60 * 60 * hour), value);
return true;
}catch (Exception e) {
return false;
}
}
public boolean isConnected () {
return this.connected;
}
private void setConnected (boolean connected) {
this.connected = connected;
}
private MemcachedClient getMemcachedClient () {
return this.memcachedClient;
}
private void setMemcachedClient (MemcachedClient memcachedClient) {
this.memcachedClient = memcachedClient;
}
Anyone knows how can we fix this error?
EDIT: I have read the post Java: Unable to create new native thread, but It isn't our problem. We checked the attributes that they said there, but we have good values. However, I could see that everytime that memcached is initialized, It create a new thread, but that thread isn't deleted when the service stop. There's the problem.

"Connection refused" Autobahn Android to Java EE Endpoint

I have a Java EE Endpoint set up on a Payara server to which I attempt to connect an Android client using Autobahn WebSockets. I have the following setup:
My WebSocket Endpoint on the server:
public class CommunicationSocket extends Endpoint {
#Override
public void onOpen(Session aSession, EndpointConfig aConfig) {
aSession.addMessageHandler(new MessageHandler.Whole<byte[]>() {
#Override
public void onMessage(byte[] aMessage) {
// Do something fun
}
});
}
}
I register the WebSocket as such:
public class RegisterSocket implements ServerApplicationConfig {
#Override
public Set<ServerEndpointConfig> getEndpointConfigs(
Set<Class<? extends Endpoint>> aEndpointClasses) {
Set<ServerEndpointConfig> result = new HashSet<>();
for (Class endpointClass : aEndpointClasses) {
if (endpointClass.equals(CommunicationSocket.class)) {
ServerEndpointConfig sec
= ServerEndpointConfig.Builder.create(endpointClass,
"/WebSocket").build();
result.add(sec);
}
}
return result;
}
#Override
public Set<Class<?>> getAnnotatedEndpointClasses(
Set<Class<?>> aScanned) {
return Collections.emptySet();
}
}
The WebSocket can now be reached att ws://localhost:46588/Server/WebSocket. I've confirmed that it works with the following javascript in chrome:
function WebSocketTest() {
if ("WebSocket" in window) {
ws = new WebSocket("ws://localhost:46588/Server/WebSocket");
ws.onopen = function() {
ws.send("Message to send");
alert("Message is sent...");
};
ws.onmessage = function (evt) {
var received_msg = evt.data;
alert("Message is received... \n" + received_msg);
};
} else {
// The browser doesn't support WebSocket
alert("WebSocket NOT supported by your Browser!");
}
}
However when I try to connect with my android client using autobahn, the socket closes without being able to establish a connection with the message "Connection refused". I use the following code in onCreate to connect (mSocket is a field of the activity class):
WebSocketHandler messageHandler = new WebSocketHandler() {
#Override
public void onOpen() {
System.out.println("Connected...");
}
#Override
public void onClose(int code, String reason) {
System.out.println("Socket closing: " + reason);
mSocket = null;
}
#Override
public void onTextMessage(String payload) {
System.out.println("Received: " + payload);
}
#Override
public void onBinaryMessage(byte[] payload) {
System.out.println("Message received: " + payload);
}
};
mSocket = new WebSocketConnection();
try {
String address = "ws://localhost:46588/Server/WebSocket";
mSocket.connect(address, messageHandler);
} catch (WebSocketException e) {
System.out.println("Could not connect to WebSocket: "
+ e.getMessage());
mSocket = null;
}
I have internet permissions i my manifest as so:
<uses-permission android:name="android.permission.INTERNET">
</uses-permission>
Is there anything in my code or approach that is wrong? Is it possible to log/catch the event of connecting (handshake or what not) in order to shed light onto why the connection is refused?
And as I got ready to post the question I googled one last time: lo and behold, localhost is not the localhost of the machine running the emulator (I guess it's the localhost of the emulated device). So use:
10.0.2.2:[port]
instead of
localhost:[port]
and it will be fine on the emulator (don't forget to change if running on an actual device)

How can i find my pc local ip address on my wireless network and pass the ip to my android device?

To find the ip address of the pc i'm using with c#
In the constructor:
localipadd = GetLocalIPAddress();
And the GetLocalIPAdress method:
public static string GetLocalIPAddress()
{
var host = Dns.GetHostEntry(Dns.GetHostName());
foreach (var ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
return ip.ToString();
}
}
throw new Exception("Local IP Address Not Found!");
}
For example i'm getting the ip 10.0.01
Now the problem is how can i transfer this ip address string to my android device ?
The reason i need to do it is that on the c# i'm running a web server:
In the constructor:
var ws = new WebServer(
request => Task.Run(() => SendResponseAsync(request)),
"http://+:8098/");
ws.Run();
And the WebServer class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Threading;
namespace Automatic_Record
{
class WebServer
{
private readonly HttpListener _listener = new HttpListener();
private readonly Func<HttpListenerRequest, Task<string>> _responderMethod;
public WebServer(string[] prefixes, Func<HttpListenerRequest, Task<string>> method)
{
if (!HttpListener.IsSupported)
throw new NotSupportedException(
"Needs Windows XP SP2, Server 2003 or later.");
// URI prefixes are required, for example
// "http://localhost:8080/index/".
if (prefixes == null || prefixes.Length == 0)
throw new ArgumentException("prefixes");
// A responder method is required
if (method == null)
throw new ArgumentException("method");
foreach (string s in prefixes)
_listener.Prefixes.Add(s);
_responderMethod = method;
_listener.Start();
}
public WebServer(Func<HttpListenerRequest, Task<string>> method, params string[] prefixes)
: this(prefixes, method) { }
public void Run()
{
ThreadPool.QueueUserWorkItem((o) =>
{
Console.WriteLine("Webserver running...");
try
{
while (_listener.IsListening)
{
ThreadPool.QueueUserWorkItem(async (c) =>
{
var ctx = c as HttpListenerContext;
try
{
string rstr = await _responderMethod(ctx.Request);
System.Diagnostics.Trace.Write(ctx.Request.QueryString);
//ctx.Request.QueryString
byte[] buf = Encoding.UTF8.GetBytes(rstr);
ctx.Response.ContentLength64 = buf.Length;
ctx.Response.OutputStream.Write(buf, 0, buf.Length);
System.Data.SqlClient.SqlConnectionStringBuilder builder = new System.Data.SqlClient.SqlConnectionStringBuilder();
}
catch { } // suppress any exceptions
finally
{
// always close the stream
ctx.Response.OutputStream.Close();
}
}, _listener.GetContext());
}
}
catch { } // suppress any exceptions
});
}
public void Stop()
{
_listener.Stop();
_listener.Close();
}
}
}
And on my android device using android studio i did a client that connect to the pc web server. Today what i'm doing is finding on my own the pc ip address and assign it to the android studio.
In the MainActivity:
private String[] ipaddresses = new String[]{
"http://10.0.0.1:8098/?cmd=nothing",
"http://192.168.1.5:8098/?cmd=nothing"};
And then a button listen method with button click Listener:
public void addListenerOnButton()
{
btnClick = (Button) findViewById(R.id.checkipbutton);
btnClick.setOnClickListener(new OnClickListener()
{
byte[] response = null;
#Override
public void onClick(View arg0)
{
text = (TextView) findViewById(R.id.textView2);
Thread t = new Thread(new Runnable()
{
#Override
public void run()
{
for (int i = 0; i < ipaddresses.length; i++)
{
counter = i;
try
{
response = Get(ipaddresses[i]);
} catch (Exception e)
{
String err = e.toString();
}
if (response != null)
{
try
{
final String a = new String(response, "UTF-8");
text.post(new Runnable()
{
#Override
public void run()
{
text.setText(a + " On \n" + ipaddresses[counter]);
status1.setText("Connected");
String successconnected = null;
successconnected = "Successfully connected";
textforthespeacch = successconnected;
MainActivity.this.initTTS();
}
});
iptouse = ipaddresses[i].substring(0, ipaddresses[i].lastIndexOf("=") + 1);
connectedtoipsuccess = true;
connectedSuccess = true;
Logger.getLogger("MainActivity(inside thread)").info(a);
} catch (UnsupportedEncodingException e)
{
e.printStackTrace();
Logger.getLogger("MainActivity(inside thread)").info("encoding exception");
}
Logger.getLogger("MainActivity(inside thread)").info("test1");
break;
}
else
{
}
}
counter = 0;
if (response == null)
{
text.post(new Runnable()
{
#Override
public void run()
{
text.setText("Connection Failed");
status1.setText("Connection Failed");
String successconnected = null;
successconnected = "connection failed";
textforthespeacch = successconnected;
MainActivity.this.initTTS();
}
});
}
}
});
t.start();
}
});
}
So this is how it work today:
I went to my living room and there i added to my router my pc static ip.
Then i went to my pc room i have another router with another network and i added there the pc static ip too.
And then added both ip's to the android studio code and then i'm looping over the array to see the one that connected and then i know this is the right ip to use.
The problem is that i can't ask the user/s to assign to the router a static ip and then fill the android studio with the array.....
What i need to do is somehow to assign the pc ip automatic to the android studio(to my android device) so it will be able to use it.
So i know using the c# to find my pc ip but how do i pass it to the android device and use it ?
I could scan make a scan on the android studio something that will scan all the ips from 0 to 255 and then to try to identify the one that is the pc but this might take a very long time.
Another option maybe could be sending the ip i found on my pc using the c# via gmail and get it with the android studio from the gmail and add it to the array ? Is that logic ?

jssc serialPort.readBytes(1) doesn't work (the same) on all COM-ports

I've got this weird problem that my software doesn't read the byte it sent when using the real COM5 or COM6, but when using a RS232 tot USB cable (which came up in Windows as COM12) it did work. Connected to the COM-port are two wires that will tell whether the door of the device is opened or not.
How can it be that the following code works on COM12 (a virtual COM-port), but not on COM5 and COM6 (real COM-ports) and when using putty and entering characters when the door is closed all three show the entered characters. It's the same behavior for all 3 ports with putty, but the software only works when it's connected to the vrtual COM-port that's made up by the Serial2USB cable ...
The problem occurs at a computer with 32-bit version of Windows 7 Embedded.
public void continuouslyCheckConnection() {
new Thread() {
public void run() {
while(true) {
if (hasStarted) {
sendByte();
int newStatus = readWithPossibleDelay(100);
logger.debug("new doorreader status: " + newStatus);
if (latestStatus != newStatus) {
latestStatus = newStatus;
if (newStatus == 0)
mainController.getScreensController().doorOpened();
}
}
try {
Thread.sleep(100);
} catch(InterruptedException ie) {
logger.error("DoorReader; InterruptedException in continuouslyCheckConnection: " + ie.getMessage());
}
}
}
}.start();
}
public void sendByte() {
try {
serialPort.writeByte((byte)0x01);
} catch(SerialPortException spe) {
logger.error("DoorReader; SerialPortException in sendByte: " + spe.getMessage());
}
}
private synchronized int readWithPossibleDelay(int delay) {
Callable<Integer> readTask = new Callable<Integer>() {
#Override
public Integer call() throws Exception {
byte[] byteArray = serialPort.readBytes(1);
int readInt = byteArray[0];
return readInt;
}
};
Future<Integer> future = executor.submit(readTask);
try {
return future.get(delay, TimeUnit.MILLISECONDS);
} catch (ExecutionException ee) {
logger.error("DoorReader; ExecutionException in readWithPossibleDelay: " + ee.getMessage());
} catch (InterruptedException ie) {
logger.error("DoorReader; InterruptedException in readWithPossibleDelay: " + ie.getMessage());
} catch (TimeoutException te) {
// ignore, this returns 0 which is okay
}
return 0;
}
I';ve also found somewhere that explicitly setting
serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
might help, but it didnt change anything

Categories

Resources