Index: gpsd.c
===================================================================
--- gpsd.c	(Revision 6479)
+++ gpsd.c	(Arbeitskopie)
@@ -1696,7 +1696,6 @@
 		else {
 		    char serialmode[3];
 		    const struct gps_type_t *dt = channel->device->device_type;
-
 		    /* interpret defaults */
 		    if (devconf.baudrate == DEVDEFAULT_BPS)
 			devconf.baudrate = (uint)gpsd_get_speed(&channel->device->ttyset);
@@ -1708,18 +1707,21 @@
 			devconf.cycle=channel->device->gpsdata.dev.cycle;
 
 		    /* now that channel is selected, apply changes */
-		    if (devconf.driver_mode != channel->device->gpsdata.dev.driver_mode)
+		    if (devconf.driver_mode != channel->device->gpsdata.dev.driver_mode
+				&& devconf.driver_mode != DEVDEFAULT_NATIVE
+				&& dt->mode_switcher != NULL)
 			dt->mode_switcher(channel->device, devconf.driver_mode);
-		    serialmode[0] = devconf.parity;
+		    
+			serialmode[0] = devconf.parity;
 		    serialmode[1] = '0' + devconf.stopbits;
 		    serialmode[2] = '\0';
 		    set_serial(channel->device, 
 			       (speed_t)devconf.baudrate, serialmode);
-		    if (dt->rate_switcher != NULL 
-			&& isnan(devconf.cycle)!=0 
+			if (dt->rate_switcher != NULL 
+			&& isnan(devconf.cycle)==0
 			&& devconf.cycle >= dt->min_cycle)
-		    if (dt->rate_switcher(channel->device, devconf.cycle))
-			channel->device->gpsdata.dev.cycle = devconf.cycle;
+				if (dt->rate_switcher(channel->device, devconf.cycle))
+					channel->device->gpsdata.dev.cycle = devconf.cycle;
 		}
 	    }
 	    /*@+branchstate@*/
Index: drivers.c
===================================================================
--- drivers.c	(Revision 6479)
+++ drivers.c	(Arbeitskopie)
@@ -993,6 +993,18 @@
 	(void)nmea_send(session,"$PMTK313,1"); /* SBAS enable */
     }
 }
+static void mtk3301_rate_switcher(struct gps_device_t *session, double rate)
+{
+	unsigned int milliseconds = 1000 * rate;
+	if(rate > 1)
+		milliseconds=1000;
+	else if(rate < 0.2)
+		milliseconds=200;
+	
+	char buf[78];
+	snprintf(buf, 78, "$PMTK300,%u,0,0,0,0", milliseconds);
+	(void)nmea_send(session,buf); /* Fix interval */
+}
 #endif /* ALLOW_RECONFIGURE */
 
 const struct gps_type_t mtk3301 = {
@@ -1008,8 +1020,8 @@
 #ifdef ALLOW_RECONFIGURE
     .speed_switcher = NULL,		/* no speed switcher */
     .mode_switcher  = NULL,		/* no mode switcher */
-    .rate_switcher  = NULL,		/* no sample-rate switcher */
-    .min_cycle      = 1,		/* not relevant, no rate switch */
+    .rate_switcher  = mtk3301_rate_switcher,		/* sample rate switcher */
+    .min_cycle      = 0.2,		/* max 5Hz */
 #endif /* ALLOW_RECONFIGURE */
 #ifdef ALLOW_CONTROLSEND
     .control_send   = nmea_write,	/* how to send control strings */
Index: gpsctl.c
===================================================================
--- gpsctl.c	(Revision 6479)
+++ gpsctl.c	(Arbeitskopie)
@@ -112,7 +112,7 @@
 #endif /* ALLOW_RECONFIGURE */
 
 #define USAGE	"usage: gpsctl [-l] [-b | -n | -r] [-D n] [-s speed] [-c rate] [-T timeout] [-V] [-t devtype] [-x control] [-e] <device>\n"
-    while ((option = getopt(argc, argv, "befhlnrs:t:x:D:T:V")) != -1) {
+    while ((option = getopt(argc, argv, "bc:efhlnrs:t:x:D:T:V")) != -1) {
 	switch (option) {
 	case 'b':		/* switch to vendor binary mode */
 	    to_binary = true;
@@ -336,7 +336,7 @@
 	    char stopbits = '1';
 	    if (strchr(speed, ':') == NULL)
 		(void)gps_query(gpsdata,
-				"?DEVICE={\"device\":%s,\"bps\":%s}\r\n", 
+				"?DEVICE={\"path\":\"%s\",\"bps\":%s}\r\n", 
 				device, speed);
 	    else {
 		char *modespec = strchr(speed, ':');
@@ -361,7 +361,7 @@
 		}
 		if (status == 0)
 		    (void)gps_query(gpsdata, 
-				    "?DEVICE={\"device\":%s,\"bps\":%s,\"serialmode\":\"8%c%c\"}\r\n", 
+				    "?DEVICE={\"path\":\"%s\",\"bps\":%s,\"serialmode\":\"8%c%c\"}\r\n", 
 				    device, speed, parity, stopbits);
 	    }
 	    if (atoi(speed) != (int)gpsdata->dev.baudrate) {
@@ -376,7 +376,7 @@
 	}
 	if (rate != NULL) {
 	    (void)gps_query(gpsdata, 
-			    "?DEVICE={\"device\":%s,\"cycle\":%s}\n", 
+			    "?DEVICE={\"path\":\"%s\",\"cycle\":%s}\n", 
 			    device, rate);
 	}
 #endif /* ALLOW_RECONFIGURE */

