| 1357 | } |
| 1358 | |
| 1359 | static int dev_acquisition_start(struct sr_dev_inst *sdi, void *cb_data) |
| 1360 | { |
| 1361 | (void)cb_data; |
| 1362 | |
| 1363 | struct session_vdev *vdev; |
| 1364 | struct sr_datafeed_packet packet; |
| 1365 | GSList *l; |
| 1366 | struct sr_channel *probe; |
| 1367 | |
| 1368 | assert(sdi); |
| 1369 | assert(sdi->priv); |
| 1370 | assert(sdi->path); |
| 1371 | |
| 1372 | if (sdi->dev_type != DEV_TYPE_FILELOG) |
| 1373 | { |
| 1374 | assert(0); |
| 1375 | } |
| 1376 | |
| 1377 | vdev = sdi->priv; |
| 1378 | vdev->enabled_probes = 0; |
| 1379 | packet.status = SR_PKT_OK; |
| 1380 | |
| 1381 | // reset status |
| 1382 | vdev->cur_block = 0; |
| 1383 | vdev->cur_channel = 0; |
| 1384 | |
| 1385 | if (vdev->archive != NULL) |
| 1386 | { |
| 1387 | sr_err("history archive is not closed."); |
| 1388 | } |
| 1389 | |
| 1390 | sr_dbg("Opening archive file %s", sdi->path); |
| 1391 | |
| 1392 | vdev->archive = unzOpen64(sdi->path); |
| 1393 | |
| 1394 | if (NULL == vdev->archive) |
| 1395 | { |
| 1396 | sr_err("Failed to open session file '%s': " |
| 1397 | "zip error", |
| 1398 | sdi->path); |
| 1399 | return SR_ERR; |
| 1400 | } |
| 1401 | |
| 1402 | if (vdev->version == 1) |
| 1403 | { |
| 1404 | if (unzLocateFile(vdev->archive, "data", 0) != UNZ_OK) |
| 1405 | { |
| 1406 | sr_err("can't locate zip inner file:\"%s\"", "data"); |
| 1407 | close_archive(vdev); |
| 1408 | return SR_ERR; |
| 1409 | } |
| 1410 | if (unzOpenCurrentFile(vdev->archive) != UNZ_OK) |
| 1411 | { |
| 1412 | sr_err("can't open zip inner file:\"%s\"", "data"); |
| 1413 | close_archive(vdev); |
| 1414 | return SR_ERR; |
| 1415 | } |
| 1416 | vdev->capfile = 1; |
nothing calls this directly
no test coverage detected