| 1339 | } |
| 1340 | |
| 1341 | void SigSession::feed_in_analog(const sr_datafeed_analog &o) |
| 1342 | { |
| 1343 | if (_capture_data->get_analog()->memory_failed()) |
| 1344 | { |
| 1345 | dsv_err("Unexpected analog packet"); |
| 1346 | return; // This analog packet was not expected. |
| 1347 | } |
| 1348 | |
| 1349 | if (_capture_data->get_analog()->last_ended()) |
| 1350 | { |
| 1351 | // reset scale of analog signal |
| 1352 | for (auto s : _signals) |
| 1353 | { |
| 1354 | if (s->signal_type() == SR_CHANNEL_ANALOG){ |
| 1355 | view::AnalogSignal *analogSig = (view::AnalogSignal*)s; |
| 1356 | analogSig->set_scale(analogSig->get_totalHeight()); |
| 1357 | } |
| 1358 | } |
| 1359 | |
| 1360 | // first payload |
| 1361 | _capture_data->get_analog()->first_payload(o, _device_agent.get_sample_limit(), _device_agent.get_channels()); |
| 1362 | } |
| 1363 | else |
| 1364 | { |
| 1365 | // Append to the existing data snapshot |
| 1366 | _capture_data->get_analog()->append_payload(o); |
| 1367 | } |
| 1368 | |
| 1369 | if (_capture_data->get_analog()->memory_failed()) |
| 1370 | { |
| 1371 | _error = Malloc_err; |
| 1372 | _callback->session_error(); |
| 1373 | return; |
| 1374 | } |
| 1375 | |
| 1376 | set_receive_data_len(o.num_samples); |
| 1377 | _data_updated = true; |
| 1378 | } |
| 1379 | |
| 1380 | void SigSession::data_feed_in(const struct sr_dev_inst *sdi, |
| 1381 | const struct sr_datafeed_packet *packet) |
nothing calls this directly
no test coverage detected