static void hw_closedev(int device_index)
{
- device_index = device_index;
+ struct sigrok_device_instance *sdi;
- ftdi_usb_close(&ftdic);
+ if ((sdi = get_sigrok_device_instance(device_instances, device_index)))
+ {
+ if (sdi->status == ST_ACTIVE)
+ ftdi_usb_close(&ftdic);
+
+ sdi->status = ST_INACTIVE;
+ }
}
static void hw_cleanup(void)
while (sent < n) {
tosend = MIN(2048, n - sent);
- packet.type = DF_LOGIC16;
+ packet.type = DF_LOGIC;
packet.length = tosend * sizeof(uint16_t);
+ packet.unitsize = 2;
packet.payload = samples + sent;
session_bus(user_data, &packet);
&trigger);
if (tosend > 0) {
- packet.type = DF_LOGIC16;
+ packet.type = DF_LOGIC;
packet.length = tosend * sizeof(uint16_t);
+ packet.unitsize = 2;
packet.payload = samples;
session_bus(user_data, &packet);
/* Send rest of the chunk to sigrok. */
tosend = n - sent;
- packet.type = DF_LOGIC16;
+ packet.type = DF_LOGIC;
packet.length = tosend * sizeof(uint16_t);
+ packet.unitsize = 2;
packet.payload = samples + sent;
session_bus(user_data, &packet);
gettimeofday(&header.starttime, NULL);
header.samplerate = cur_samplerate;
header.protocol_id = PROTO_RAW;
- header.num_probes = num_probes;
+ header.num_logic_probes = num_probes;
+ header.num_analog_probes = 0;
session_bus(session_device_id, &packet);
/* Add capture source. */