diff --git a/central-manager/boot b/central-manager/boot deleted file mode 100755 index 6733fa5..0000000 Binary files a/central-manager/boot and /dev/null differ diff --git a/central-manager/lib/local/handler.o b/central-manager/lib/local/handler.o deleted file mode 100644 index 362b022..0000000 Binary files a/central-manager/lib/local/handler.o and /dev/null differ diff --git a/central-manager/lib/local/middleware.c b/central-manager/lib/local/middleware.c index 51a7c2b..50663a5 100644 --- a/central-manager/lib/local/middleware.c +++ b/central-manager/lib/local/middleware.c @@ -156,7 +156,7 @@ int multicastTerminal(struct middleware_arg* arg){ /* 3. Si on a le port -> on le met dans la reponse */ }else{ strcpy(request.addr, SERV_HOST); - request.port = htons(comInfo.sin_port); + request.port = comInfo.sin_port; if( DEBUGMOD&SCK ) printf("{%s}{udp_com} socket opened on %s:%d\n", arg->entity, request.addr, request.port); } diff --git a/central-manager/lib/local/middleware.o b/central-manager/lib/local/middleware.o deleted file mode 100644 index d29b150..0000000 Binary files a/central-manager/lib/local/middleware.o and /dev/null differ diff --git a/central-manager/lib/network/tcp/server.o b/central-manager/lib/network/tcp/server.o deleted file mode 100644 index 303904d..0000000 Binary files a/central-manager/lib/network/tcp/server.o and /dev/null differ diff --git a/central-manager/lib/network/udp/server.o b/central-manager/lib/network/udp/server.o deleted file mode 100644 index 1eb002f..0000000 Binary files a/central-manager/lib/network/udp/server.o and /dev/null differ diff --git a/command-terminal/CommandTerminal/src/commandterminal/CommandTerminal.java b/command-terminal/CommandTerminal/src/commandterminal/CommandTerminal.java index 3aa8fcc..013377a 100644 --- a/command-terminal/CommandTerminal/src/commandterminal/CommandTerminal.java +++ b/command-terminal/CommandTerminal/src/commandterminal/CommandTerminal.java @@ -34,7 +34,7 @@ public class CommandTerminal { try { DatagramSocket socket = new DatagramSocket(); - ByteBuffer buf = ByteBuffer.allocate(19); + ByteBuffer buf = ByteBuffer.allocate(21); buf.clear(); buf.put((byte)(0x01|0x02)); @@ -47,24 +47,21 @@ public class CommandTerminal { if(buf.get() == 3){ System.out.println("--Connection request successful"); - byte address[] = new byte[9]; - buf = buf.get(address,0,9); + byte address[] = new byte[15]; + buf = buf.get(address,0,15); String addressString = new String(address); InetAddress sgcaAddress = InetAddress.getByName(addressString); - buf = buf.get(address,0,7); - short shortVal = buf.getShort(); - int port = shortVal >= 0 ? shortVal : 0x10000 + shortVal; + //emulate an unsigned short + char cast = buf.getChar(); + int port = (int) cast; System.out.println("----Address : "+sgcaAddress.getHostAddress()); System.out.println("----Port : "+port); } - } catch ( IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } - - }