Trying using socket.io instead of websocket, because some device incompatibility
This commit is contained in:
@@ -60,7 +60,7 @@ public class PanTiltController {
|
||||
byte[] command = new byte[]{0, cameraid, 0, 0, 0, 0, 0};
|
||||
command[6] = Checksum(command); // add checksum
|
||||
command[0] = (byte) 0xFF; // add synchronization byte
|
||||
serialPort.writeBytes(command, command.length);
|
||||
if (serialPort!=null && serialPort.isOpen()) serialPort.writeBytes(command, command.length);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ public class PanTiltController {
|
||||
byte[] command = new byte[]{0, cameraid, 0, 4, speed, 0, 0};
|
||||
command[6] = Checksum(command); // add checksum
|
||||
command[0] = (byte) 0xFF; // add synchronization byte
|
||||
serialPort.writeBytes(command, command.length);
|
||||
if (serialPort!=null && serialPort.isOpen()) serialPort.writeBytes(command, command.length);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,7 +88,7 @@ public class PanTiltController {
|
||||
byte[] command = new byte[]{0, cameraid, 0, 2, speed, 0, 0};
|
||||
command[6] = Checksum(command); // add checksum
|
||||
command[0] = (byte) 0xFF; // add synchronization byte
|
||||
serialPort.writeBytes(command, command.length);
|
||||
if (serialPort!=null && serialPort.isOpen()) serialPort.writeBytes(command, command.length);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -102,7 +102,7 @@ public class PanTiltController {
|
||||
byte[] command = new byte[]{0, cameraid, 0, 8, speed, 0, 0};
|
||||
command[6] = Checksum(command); // add checksum
|
||||
command[0] = (byte) 0xFF; // add synchronization byte
|
||||
serialPort.writeBytes(command, command.length);
|
||||
if (serialPort!=null && serialPort.isOpen()) serialPort.writeBytes(command, command.length);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,7 +116,7 @@ public class PanTiltController {
|
||||
byte[] command = new byte[]{0, cameraid, 0, 16, speed, 0, 0};
|
||||
command[6] = Checksum(command); // add checksum
|
||||
command[0] = (byte) 0xFF; // add synchronization byte
|
||||
serialPort.writeBytes(command, command.length);
|
||||
if (serialPort!=null && serialPort.isOpen()) serialPort.writeBytes(command, command.length);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user