#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
-#ifndef _WIN32
+#ifdef _WIN32
+#include <windows.h>
+#else
#include <termios.h>
#endif
#include <string.h>
0,
};
-static struct samplerates samplerates = {
+static struct sr_samplerates samplerates = {
10,
MHZ(200),
1,
static int configure_probes(GSList *probes)
{
- struct probe *probe;
+ struct sr_probe *probe;
GSList *l;
int probe_bit, stage, i;
char *tc;
num_stages = 0;
for (l = probes; l; l = l->next) {
- probe = (struct probe *)l->data;
+ probe = (struct sr_probe *)l->data;
if (!probe->enabled)
continue;
free(serial_params);
g_slist_free(ports);
- cur_samplerate = samplerates.low;
+ cur_samplerate = KHZ(200);
return final_devcnt;
}
packet.length = trigger_at * 4;
packet.unitsize = 4;
packet.payload = raw_sample_buf;
- session_bus(user_data, &packet);
+ sr_session_bus(user_data, &packet);
}
packet.type = SR_DF_TRIGGER;
packet.length = 0;
- session_bus(user_data, &packet);
+ sr_session_bus(user_data, &packet);
packet.type = SR_DF_LOGIC;
packet.length = (limit_samples * 4) - (trigger_at * 4);
packet.unitsize = 4;
packet.payload = raw_sample_buf + trigger_at * 4;
- session_bus(user_data, &packet);
+ sr_session_bus(user_data, &packet);
} else {
packet.type = SR_DF_LOGIC;
packet.length = limit_samples * 4;
packet.unitsize = 4;
packet.payload = raw_sample_buf;
- session_bus(user_data, &packet);
+ sr_session_bus(user_data, &packet);
}
free(raw_sample_buf);
serial_close(fd);
packet.type = SR_DF_END;
packet.length = 0;
- session_bus(user_data, &packet);
+ sr_session_bus(user_data, &packet);
}
return TRUE;
header->protocol_id = SR_PROTO_RAW;
header->num_logic_probes = NUM_PROBES;
header->num_analog_probes = 0;
- session_bus(session_device_id, packet);
+ sr_session_bus(session_device_id, packet);
g_free(header);
g_free(packet);
packet.type = SR_DF_END;
packet.length = 0;
- session_bus(session_device_id, &packet);
+ sr_session_bus(session_device_id, &packet);
}
struct sr_device_plugin ols_plugin_info = {