public String version() throws BITalinoException {
        try {
            socket.write(7);
            ByteBuffer buffer = ByteBuffer.allocate(30);
            // read until '\n' arrives
            byte b = 0;
            while ((char) (b = (byte) socket.getInputStream().read()) != '\n')
                buffer.put(b);
            // return a minified array
            buffer.flip();
            return new String(buffer.array());
        } catch (Exception e) {
            throw new BITalinoException(BITalinoErrorTypes.LOST_COMMUNICATION);
        }
    }