Browse Source

Add support for 'needs_update' device status.

Georgi Chorbadzhiyski 9 years ago
parent
commit
a6d9bdbbf6
2 changed files with 7 additions and 1 deletions
  1. 6
    1
      cmd.c
  2. 1
    0
      data.h

+ 6
- 1
cmd.c View File

@@ -219,8 +219,10 @@ bool parse_command(struct videohub_data *data, char *cmd) {
219 219
 			break;
220 220
 
221 221
 		case CMD_VIDEOHUB_DEVICE:
222
-			if ((p = parse_text(line, "Device present: ")))
222
+			if ((p = parse_text(line, "Device present: "))) {
223 223
 				data->device.dev_present = streq(p, "true");
224
+				data->device.needs_fw_update = streq(p, "needs_update");
225
+			}
224 226
 
225 227
 			if ((p = parse_text(line, "Model name: ")))
226 228
 				snprintf(data->device.model_name, sizeof(data->device.model_name), "%s", p);
@@ -289,6 +291,9 @@ bool parse_command(struct videohub_data *data, char *cmd) {
289 291
 	switch (v->cmd) {
290 292
 	case CMD_VIDEOHUB_DEVICE:
291 293
 		if (!data->device.dev_present) {
294
+			if (data->device.needs_fw_update) {
295
+				die("Device reports that it needs firmware update.");
296
+			}
292 297
 			die("Device reports that it's not present.");
293 298
 		}
294 299
 		if (data->device.num_video_inputs > ARRAY_SIZE(data->inputs)) {

+ 1
- 0
data.h View File

@@ -21,6 +21,7 @@
21 21
 
22 22
 struct device_desc {
23 23
 	bool			dev_present;
24
+	bool			needs_fw_update;
24 25
 	char			protocol_ver[16];
25 26
 	char			model_name[MAX_NAME_LEN];
26 27
 	char			unique_id[MAX_NAME_LEN];

Loading…
Cancel
Save