transform/scale: Support SR_DF_ANALOG2.

This commit is contained in:
Martin Ling 2015-09-09 23:49:01 +01:00 committed by Uwe Hermann
parent 2d237f3ce8
commit b1aa4f34bc
1 changed files with 6 additions and 0 deletions

View File

@ -50,6 +50,7 @@ static int receive(const struct sr_transform *t,
{ {
struct context *ctx; struct context *ctx;
const struct sr_datafeed_analog *analog; const struct sr_datafeed_analog *analog;
const struct sr_datafeed_analog2 *analog2;
struct sr_channel *ch; struct sr_channel *ch;
GSList *l; GSList *l;
float *fdata; float *fdata;
@ -75,6 +76,11 @@ static int receive(const struct sr_transform *t,
} }
} }
break; break;
case SR_DF_ANALOG2:
analog2 = packet_in->payload;
analog2->encoding->scale.p *= ctx->factor.p;
analog2->encoding->scale.q *= ctx->factor.q;
break;
default: default:
sr_spew("Unsupported packet type %d, ignoring.", packet_in->type); sr_spew("Unsupported packet type %d, ignoring.", packet_in->type);
break; break;