New request parameter used for reading out data (reset)

This commit is contained in:
2014-02-04 10:29:18 +01:00
parent dedb9b62fd
commit e1fe52473d
2 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ch.psi</groupId>
<artifactId>ch.psi.fda.fdaq</artifactId>
<version>1.0.8</version>
<version>1.0.9</version>
<dependencies>
<dependency>
@@ -69,6 +69,7 @@ public class FdaqService {
DataOutputStream out = null;
DataInputStream in = null;
boolean first = true;
while(running){
try {
@@ -79,12 +80,19 @@ public class FdaqService {
out = new DataOutputStream(echoSocket.getOutputStream());
in = new DataInputStream(echoSocket.getInputStream());
// st ruct fdaqbloc_in {int fnum;int nsample;};
ByteBuffer bytebuffer = ByteBuffer.allocate(2 * 4); // 2 times
// Integers
ByteBuffer bytebuffer = ByteBuffer.allocate(3 * 4); // 3 times Integer
bytebuffer.order(ByteOrder.LITTLE_ENDIAN);
bytebuffer.putInt(26);
bytebuffer.putInt(26); // Function number (index of pointer to function)
bytebuffer.putInt(numberOfElements);
// TODO
if(first){
bytebuffer.putInt(1); // Reset FIFO flag - The first time there need to be a 1 in int to reset the fifo buffer on the box
first=false;
}
else{
bytebuffer.putInt(0);
}
out.write(bytebuffer.array());
out.flush();