set_capture_state(Stopped);
}
-void SigSession::data_feed_in(const struct sr_dev_inst *sdi,
- const struct sr_datafeed_packet *packet)
+void SigSession::feed_in_meta_logic(const struct sr_dev_inst *sdi,
+ const sr_datafeed_meta_logic &meta_logic)
{
using view::LogicSignal;
- assert(sdi);
- assert(packet);
-
- switch (packet->type) {
- case SR_DF_HEADER:
- {
- lock_guard<mutex> lock(_signals_mutex);
- _signals.clear();
- break;
- }
-
- case SR_DF_META_LOGIC:
- {
- assert(packet->payload);
- const sr_datafeed_meta_logic &meta_logic =
- *(sr_datafeed_meta_logic*)packet->payload;
-
{
lock_guard<mutex> lock(_data_mutex);
- // Create an empty LogiData for coming data snapshots
+ // Create an empty LogicData for coming data snapshots
_logic_data.reset(new LogicData(meta_logic));
assert(_logic_data);
if (!_logic_data)
- break;
+ return;
}
{
lock_guard<mutex> lock(_signals_mutex);
// Add the signals
- for (int i = 0; i < meta_logic.num_probes; i++)
- {
+ for (int i = 0; i < meta_logic.num_probes; i++) {
const sr_probe *const probe =
(const sr_probe*)g_slist_nth_data(
sdi->probes, i);
- if (probe->enabled)
- {
+ if (probe->enabled) {
shared_ptr<LogicSignal> signal(
new LogicSignal(probe->name,
- _logic_data,
- probe->index));
+ _logic_data, probe->index));
_signals.push_back(signal);
}
}
signals_changed();
- break;
}
+}
+
+void SigSession::data_feed_in(const struct sr_dev_inst *sdi,
+ const struct sr_datafeed_packet *packet)
+{
+ assert(sdi);
+ assert(packet);
+
+ switch (packet->type) {
+ case SR_DF_HEADER:
+ {
+ lock_guard<mutex> lock(_signals_mutex);
+ _signals.clear();
+ break;
}
+ case SR_DF_META_LOGIC:
+ assert(packet->payload);
+ feed_in_meta_logic(sdi,
+ *(const sr_datafeed_meta_logic*)packet->payload);
+ break;
+
case SR_DF_LOGIC:
{
lock_guard<mutex> lock(_data_mutex);
void sample_thread_proc(struct sr_dev_inst *sdi,
uint64_t record_length, uint64_t sample_rate);
+ void feed_in_meta_logic(const struct sr_dev_inst *sdi,
+ const sr_datafeed_meta_logic &meta_logic);
+
void data_feed_in(const struct sr_dev_inst *sdi,
const struct sr_datafeed_packet *packet);