{
struct dev_context *devc;
struct sr_datafeed_packet packet;
- struct sr_datafeed_analog_old analog;
+ struct sr_datafeed_analog analog;
+ struct sr_analog_encoding encoding;
+ struct sr_analog_meaning meaning;
+ struct sr_analog_spec spec;
GString *dbg;
float fvalue;
int i;
break;
}
}
- memset(&analog, 0, sizeof(struct sr_datafeed_analog_old));
- analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
- analog.mqflags = devc->cur_mqflags;
- analog.unit = SR_UNIT_DECIBEL_SPL;
- analog.channels = sdi->channels;
+ sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+ analog.meaning->mq = SR_MQ_SOUND_PRESSURE_LEVEL;
+ analog.meaning->mqflags = devc->cur_mqflags;
+ analog.meaning->unit = SR_UNIT_DECIBEL_SPL;
+ analog.meaning->channels = sdi->channels;
analog.num_samples = 1;
analog.data = &devc->last_spl;
- packet.type = SR_DF_ANALOG_OLD;
+ packet.type = SR_DF_ANALOG;
packet.payload = &analog;
sr_session_send(sdi, &packet);
{
struct dev_context *devc;
struct sr_datafeed_packet packet;
- struct sr_datafeed_analog_old analog;
+ struct sr_datafeed_analog analog;
+ struct sr_analog_encoding encoding;
+ struct sr_analog_meaning meaning;
+ struct sr_analog_spec spec;
float fbuf[SAMPLES_PER_PACKET];
unsigned int i;
fbuf[i] += ((data[i * 2 + 1] & 0xf0) >> 4);
fbuf[i] += (data[i * 2 + 1] & 0x0f) / 10.0;
}
- memset(&analog, 0, sizeof(struct sr_datafeed_analog_old));
- analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
- analog.mqflags = devc->cur_mqflags;
- analog.unit = SR_UNIT_DECIBEL_SPL;
- analog.channels = sdi->channels;
+ sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+ analog.meaning->mq = SR_MQ_SOUND_PRESSURE_LEVEL;
+ analog.meaning->mqflags = devc->cur_mqflags;
+ analog.meaning->unit = SR_UNIT_DECIBEL_SPL;
+ analog.meaning->channels = sdi->channels;
analog.num_samples = num_samples;
analog.data = fbuf;
- packet.type = SR_DF_ANALOG_OLD;
+ packet.type = SR_DF_ANALOG;
packet.payload = &analog;
sr_session_send(sdi, &packet);