|
@@ -111,6 +111,7 @@ struct videohub_commands videohub_commands[NUM_COMMANDS] = {
|
111
|
111
|
.port_id1 = "serial",
|
112
|
112
|
.port_id2 = "serial",
|
113
|
113
|
.opt_prefix = "se",
|
|
114
|
+ .allow_disconnect = true,
|
114
|
115
|
},
|
115
|
116
|
[CMD_SERIAL_PORT_STATUS] = { .cmd = CMD_SERIAL_PORT_STATUS , .type = PARSE_STATUS,
|
116
|
117
|
.ports1 = OFS(serial),
|
|
@@ -228,8 +229,7 @@ bool parse_command(struct videohub_data *d, char *cmd) {
|
228
|
229
|
case PARSE_ROUTE:
|
229
|
230
|
dest_port_num = strtoul(port_data, NULL, 10);
|
230
|
231
|
if (dest_port_num == NO_PORT) {
|
231
|
|
- // Only serial port routing can be disabled with -1
|
232
|
|
- if (v->cmd == CMD_SERIAL_PORT_ROUTING) {
|
|
232
|
+ if (v->allow_disconnect) {
|
233
|
233
|
s_port->port[port_num].routed_to = dest_port_num;
|
234
|
234
|
continue;
|
235
|
235
|
} else {
|
|
@@ -444,7 +444,7 @@ void show_cmd(struct videohub_data *d, struct vcmd_entry *e) {
|
444
|
444
|
);
|
445
|
445
|
break;
|
446
|
446
|
}
|
447
|
|
- if (e->cmd->cmd == CMD_SERIAL_PORT_ROUTING) {
|
|
447
|
+ if (e->cmd->allow_disconnect) {
|
448
|
448
|
printf("%sconnect %s %d \"%s\" to %s %d \"%s\"\n",
|
449
|
449
|
prefix,
|
450
|
450
|
e->cmd->port_id1,
|