Browse Source

Add support for exclusive and non-exclusive locks.

Georgi Chorbadzhiyski 9 years ago
parent
commit
56ae756e57
5 changed files with 21 additions and 7 deletions
  1. 2
    0
      ChangeLog
  2. 2
    2
      README
  3. 15
    4
      cmd.c
  4. 1
    0
      data.h
  5. 1
    1
      videohubctrl.c

+ 2
- 0
ChangeLog View File

@@ -1,7 +1,9 @@
1 1
 |-----------------------------------------------------------------------|
2 2
 xxxx-xx-xx : Version 0.2 - dev
3 3
  * Fix port routing. Previously it was reversed and incorrect.
4
+ * Fix command parsing of multiple commands comming in one packet.
4 5
  * Add -m / --monitor parameter for live configuration monitoring.
6
+ * Add support for reporting exclusive and non-exclusive locks.
5 7
 
6 8
 2014-11-26 : Version 0.1
7 9
  * Initial vesion with support for showing Videohub configuration

+ 2
- 2
README View File

@@ -123,7 +123,7 @@ Serial ports: 0
123 123
 |  3 | L | Windows 1                   | Enc1 3                      |
124 124
 |  4 | L | Windows 1                   | Enc1 4                      |
125 125
 |  5 |   | Input 5                     | Output 5                    |
126
-|  6 |   | Input 6                     | Output 6                    |
126
+|  6 | + | Input 6                     | Output 6                    |
127 127
 |  7 |   | Input 7                     | Output 7                    |
128 128
 |  8 |   | Input 8                     | Output 8                    |
129 129
 |  9 | L | Windows 4 HD                | Enc2 1                      |
@@ -132,7 +132,7 @@ Serial ports: 0
132 132
 | 12 | L | DPlay2                      | Denc                        |
133 133
 | 13 | L | DPlay1                      | Output 13                   |
134 134
 | 14 |   | Input 14                    | Output 14                   |
135
-| 15 |   | Input 15                    | Output 15                   |
135
+| 15 | + | Input 15                    | Output 15                   |
136 136
 | 16 |   | Loopback                    | Loopback                    |
137 137
 ----------------------------------------------------------------------
138 138
 

+ 15
- 4
cmd.c View File

@@ -83,9 +83,9 @@ VIDEO OUTPUT LOCKS:
83 83
 10 U
84 84
 11 L
85 85
 12 L
86
-13 U
86
+13 O
87 87
 14 U
88
-15 U
88
+15 O
89 89
 
90 90
 VIDEO OUTPUT ROUTING:
91 91
 0 2
@@ -254,8 +254,19 @@ bool parse_command(struct videohub_data *data, char *cmd) {
254 254
 			break;
255 255
 
256 256
 		case CMD_VIDEO_OUTPUT_LOCKS:
257
-			if (valid_slot)
258
-				data->outputs[slot_pos].locked = slot_data[0] == 'L' ? true : false;
257
+			if (valid_slot) {
258
+				// L is exclusive lock     - can be set only via USB
259
+				// O is non-exclusive lock - can be set via network
260
+				if (slot_data[0] == 'L' || slot_data[0] == 'O') {
261
+					data->outputs[slot_pos].locked = true;
262
+					if (slot_data[0] == 'L')
263
+						data->outputs[slot_pos].locked_exclusive = true;
264
+					else
265
+						data->outputs[slot_pos].locked_exclusive = false;
266
+				} else {
267
+					data->outputs[slot_pos].locked = false;
268
+				}
269
+			}
259 270
 			break;
260 271
 
261 272
 		case CMD_VIDEO_OUTPUT_ROUTING:

+ 1
- 0
data.h View File

@@ -39,6 +39,7 @@ struct output_desc {
39 39
 	char			name[MAX_NAME_LEN];
40 40
 	unsigned int	routed_to;
41 41
 	bool			locked;
42
+	bool			locked_exclusive;
42 43
 };
43 44
 
44 45
 struct videohub_data {

+ 1
- 1
videohubctrl.c View File

@@ -143,7 +143,7 @@ static void print_device_settings(struct videohub_data *d) {
143 143
 	for(i = 0; i < d->device.num_video_inputs; i++) {
144 144
 		printf("| %2d | %c | %-27s | %-27s |\n",
145 145
 			i + 1,
146
-			d->outputs[i].locked ? 'L' : ' ',
146
+			d->outputs[i].locked ? (d->outputs[i].locked_exclusive ? 'L' : '+') : ' ',
147 147
 			d->inputs[d->outputs[i].routed_to].name,
148 148
 			d->outputs[i].name
149 149
 		);

Loading…
Cancel
Save