diff rvinterf/lowlevel/clientcmd.c @ 871:a5c8f48003cd

rvinterf: client programs can now selectively stop receiving packets of a particular RVTMUX type
author Space Falcon <falcon@ivan.Harhan.ORG>
date Fri, 29 May 2015 06:29:38 +0000
parents 2682003dcba7
children 5f919af515f1
line wrap: on
line diff
--- a/rvinterf/lowlevel/clientcmd.c	Fri May 29 06:16:02 2015 +0000
+++ b/rvinterf/lowlevel/clientcmd.c	Fri May 29 06:29:38 2015 +0000
@@ -53,6 +53,19 @@
 		cli->int_proto[cli->rx_buf[1] - 0x12] = 1;
 		send_local_msg_to_client(cli, "+OK");
 		return;
+	case CLI2RVI_DROP_MUXPROTO:
+		if (cli->rx_msglen != 2) {
+			send_local_msg_to_client(cli, "-Bad command length");
+			return;
+		}
+		if (cli->rx_buf[1] < 0x12 || cli->rx_buf[1] > 0x1B) {
+			send_local_msg_to_client(cli,
+					"-Unsupported protocol MUX value");
+			return;
+		}
+		cli->int_proto[cli->rx_buf[1] - 0x12] = 0;
+		send_local_msg_to_client(cli, "+OK");
+		return;
 	case CLI2RVI_RESET_PACKET_RX:
 		cli->int_rvt_count = 0;
 		bzero(cli->int_proto, sizeof(cli->int_proto));