* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <config.h>
#include "protocol.h"
#define USB_VENDOR_ID 0x0403
/* Channels are numbered 1-9. */
static const char *channel_names[] = {
"1", "2", "3", "4", "5", "6", "7", "8", "9",
- NULL,
};
/* Note: The IKALOGIC ScanaPLUS always samples at 100MHz. */
(void)options;
- drvc = di->priv;
+ drvc = di->context;
devices = NULL;
sdi->driver = di;
sdi->priv = devc;
- for (i = 0; channel_names[i]; i++)
- sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE,
- channel_names[i]);
+ for (i = 0; i < ARRAY_SIZE(channel_names); i++)
+ sr_channel_new(sdi, i, SR_CHANNEL_LOGIC, TRUE, channel_names[i]);
devices = g_slist_append(devices, sdi);
drvc->instances = g_slist_append(drvc->instances, sdi);
static GSList *dev_list(const struct sr_dev_driver *di)
{
- return ((struct drv_context *)(di->priv))->instances;
+ return ((struct drv_context *)(di->context))->instances;
}
static int dev_open(struct sr_dev_inst *sdi)
std_session_send_df_header(sdi, LOG_PREFIX);
/* Hook up a dummy handler to receive data from the device. */
- sr_session_source_add(sdi->session, -1, G_IO_IN, 0, scanaplus_receive_data, (void *)sdi);
+ sr_session_source_add(sdi->session, -1, 0, 0, scanaplus_receive_data, (void *)sdi);
return SR_OK;
}
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
- struct sr_datafeed_packet packet;
-
(void)cb_data;
sr_dbg("Stopping acquisition.");
sr_session_source_remove(sdi->session, -1);
-
- /* Send end packet to the session bus. */
- sr_dbg("Sending SR_DF_END.");
- packet.type = SR_DF_END;
- sr_session_send(sdi, &packet);
+ std_session_send_df_end(sdi, LOG_PREFIX);
return SR_OK;
}
.dev_close = dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
- .priv = NULL,
+ .context = NULL,
};