From 371661a51fd962dc23dcd2f761b1a8f1def3191a Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Tue, 22 Mar 2016 18:46:18 +0100 Subject: Fix pcitool getting RAW data and returning STANDARD --- pcitool/cli.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pcitool/cli.c b/pcitool/cli.c index 1fc2abb..b267c5b 100644 --- a/pcitool/cli.c +++ b/pcitool/cli.c @@ -1798,14 +1798,8 @@ int GrabCallback(pcilib_event_id_t event_id, const pcilib_event_info_t *info, vo ctx->incomplete_count++; return PCILIB_STREAMING_CONTINUE; } - - switch (ctx->format) { - case FORMAT_DEFAULT: - data = pcilib_get_data(handle, event_id, PCILIB_EVENT_DATA, &size); - break; - default: - data = pcilib_get_data(handle, event_id, PCILIB_EVENT_RAW_DATA, &size); - } + + data = pcilib_get_data(handle, event_id, ctx->data, &size); if (!data) { int err = (int)size; @@ -2176,11 +2170,17 @@ int TriggerAndGrab(pcilib_t *handle, GRAB_MODE grab_mode, const char *evname, co if (data == PCILIB_EVENT_DATA_TYPE_INVALID) Error("Can't find data type (%s)", data_type); } else { - data = PCILIB_EVENT_DATA; + switch (format) { + case FORMAT_DEFAULT: + data = PCILIB_EVENT_DATA; + break; + default: + data = PCILIB_EVENT_RAW_DATA; + } } - + memset(&ctx, 0, sizeof(GRABContext)); - + ctx.handle = handle; ctx.event = event; ctx.data = data; -- cgit v1.2.1