﻿Index: setup.c
===================================================================
--- setup.c	(revision 4325)
+++ setup.c	(working copy)
@@ -2010,6 +2010,9 @@
 	} else if (network_connecting_to_squeezenetwork_beta()) {
 		msg = S_CONNECTING_SQUEEZENETWORK_BETA;
 //		DEBUG_PRINTF("*** Info: Connecting to SN beta");
+	} else if (!network_server_compatible()) {
+		msg = S_PROBLEM_INCOMPATIBLE_SERVER;
+//		DEBUG_PRINTF("*** Incompatible server");
 	} else if( sending_wol == 1) {
 		if( blank_countdown > 2) {
 			sending_wol = 0;
Index: net/network.h
===================================================================
--- net/network.h	(revision 4325)
+++ net/network.h	(working copy)
@@ -9,6 +9,7 @@
 #define SLIMSERVER_SERVER (0)
 #define SQUEEZENETWORK_SERVER (1)
 #define SQUEEZENETWORK_BETA_SERVER (2)
+#define INCOMPATIBLE_SERVER (3)
 
 #define WIRELESS_ALL_ENCRYPTION  0xffff
 #define WIRELESS_NO_ENCRYPTION  0x0001
@@ -39,6 +40,7 @@
 void network_set_server_address(u32_t server);
 bool_t network_connecting_to_squeezenetwork(void);
 bool_t network_connecting_to_squeezenetwork_beta(void);
+bool_t network_server_compatible(void);
 
 void network_slimserver_start_scan(void);
 void network_slimserver_pause_scan(void);
Index: net/slimproto.c
===================================================================
--- net/slimproto.c	(revision 4325)
+++ net/slimproto.c	(working copy)
@@ -100,6 +100,9 @@
 }
 
 void slimproto_connect(void) {
+	if (!network_server_compatible()) {
+		return;
+	}
 
 	// make sure we're initialized, safe to do more than once
 	slimproto_init();
Index: net/network.c
===================================================================
--- net/network.c	(revision 4325)
+++ net/network.c	(working copy)
@@ -9,7 +9,7 @@
 
 THIS_FILE("network.c");
 
-#define RUNTIME_DEBUG 0
+#define RUNTIME_DEBUG 1
 
 #include "squeeze.h"
 #include "app.h"
@@ -378,13 +378,23 @@
 	}
 #endif
 
-	if (	(src_port != SLIMPROTO_PORT) ||		// only accept 18 bytes from slimproto port
-		(netbuf_get_remaining(nb) != 18)
-		)
+	if (src_port != SLIMPROTO_PORT) 
+ 		return;
+		
+	if (netbuf_get_remaining(nb) == 20) {
+		opcode = netbuf_fwd_read_u8(nb);	// get opcode
+
+		u16_t serverVersion = netbuf_fwd_read_u16(nb);	
+		if (serverVersion < MINIMUM_SERVER_VERSION) {
+			src_addr = INCOMPATIBLE_SERVER;
+		}
+	} else if (netbuf_get_remaining(nb) != 18) {
+		// only accept 18 bytes from slimproto port
 		return;
+	} else {
+		opcode = netbuf_fwd_read_u8(nb);	// get opcode
+	}
 
-	opcode = netbuf_fwd_read_u8(nb);	// get opcode
-
 	DEBUG_PRINTF("Received UDP packed with opcode %c", opcode);	
 
 	if (opcode != 'D')				// only accept discovery response pkt
@@ -651,6 +661,13 @@
 #endif
 }
 
+bool_t network_server_compatible(void) {
+	if( ( config_get_server_address() == 0) && ( config_get_slimserver_address() == INCOMPATIBLE_SERVER)) {
+		return false;
+	}
+	return true;
+}
+
 // don't forget to call runtime_config_store()
 // after calling network_set_server_address() to persist your setting
 void network_set_server_address(u32_t server) {
Index: app.strings
===================================================================
--- app.strings	(revision 4325)
+++ app.strings	(working copy)
@@ -779,6 +779,9 @@
 	NO	Får ikke til å kople til DHCP-server.\nVenstre for å gå tilbake, midtknapp for å prøve igjen.
 	SV	Det går inte att ansluta till DHCP-servern.\nVänster för att gå tillbaka, tryck på mittenknappen för att försöka igen.
 
+S_PROBLEM_INCOMPATIBLE_SERVER
+	EN	SqueezeCenter needs to\nbe upgraded.
+
 S_PROBLEM_NO_SLIMSERVER_FOUND
 	DA	SqueezeCenter blev ikke fundet
 	DE	SqueezeCenter nicht gefunden
Index: version.h
===================================================================
--- version.h	(revision 4326)
+++ version.h	(working copy)
@@ -4,5 +4,6 @@
 #define FIRMWARE_VERSION        "11"
 #define DISCOVERY_SOFTWARE_ID 	11
 #define DISCOVERY_HARDWARE_ID   0x0A
+#define MINIMUM_SERVER_VERSION (720)
 
 #endif
Index: version.h
===================================================================
--- version.h	(revision 4330)
+++ version.h	(working copy)
@@ -4,5 +4,6 @@
 #define FIRMWARE_VERSION        "50"
 #define DISCOVERY_SOFTWARE_ID   50
 #define DISCOVERY_HARDWARE_ID   0x05
+#define MINIMUM_SERVER_VERSION (0)
 
 #endif
Index: version.h
===================================================================
--- version.h	(revision 4330)
+++ version.h	(working copy)
@@ -4,5 +4,6 @@
 #define FIRMWARE_VERSION        "40"
 #define DISCOVERY_SOFTWARE_ID   40
 #define DISCOVERY_HARDWARE_ID   0x07
+#define MINIMUM_SERVER_VERSION (0)
 
 #endif
Index: version.h
===================================================================
--- version.h	(revision 4330)
+++ version.h	(working copy)
@@ -4,5 +4,6 @@
 #define FIRMWARE_VERSION        "105"
 #define DISCOVERY_SOFTWARE_ID 	105
 #define DISCOVERY_HARDWARE_ID   0x04
+#define MINIMUM_SERVER_VERSION (0)
 
 #endif
