struct alsa *alsa;
int err;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
alsa = sdi->priv;
struct sr_device_instance *sdi;
struct alsa *alsa;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return;
alsa = sdi->priv;
if (!alsa)
{
struct sr_device_instance *sdi;
- if (!(sdi = get_sr_device_instance(device_instances, 0)))
+ if (!(sdi = sr_get_device_instance(device_instances, 0)))
return;
free(sdi->priv);
struct alsa *alsa;
void *info = NULL;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return NULL;
alsa = sdi->priv;
struct sr_device_instance *sdi;
struct alsa *alsa;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
alsa = sdi->priv;
int count;
int err;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
alsa = sdi->priv;
struct sigma *sigma;
int ret;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
sigma = sdi->priv;
struct sr_device_instance *sdi;
struct sigma *sigma;
- if ((sdi = get_sr_device_instance(device_instances, device_index)))
+ if ((sdi = sr_get_device_instance(device_instances, device_index)))
{
sigma = sdi->priv;
if (sdi->status == ST_ACTIVE)
struct sigma *sigma;
void *info = NULL;
- if (!(sdi = get_sr_device_instance(device_instances, device_index))) {
+ if (!(sdi = sr_get_device_instance(device_instances, device_index))) {
fprintf(stderr, "It's NULL.\n");
return NULL;
}
{
struct sr_device_instance *sdi;
- sdi = get_sr_device_instance(device_instances, device_index);
+ sdi = sr_get_device_instance(device_instances, device_index);
if (sdi)
return sdi->status;
else
struct sigma *sigma;
int ret;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
sigma = sdi->priv;
session_device_id = session_device_id;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
sigma = sdi->priv;
struct sigma *sigma;
uint8_t modestatus;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return;
sigma = sdi->priv;
struct sr_device_instance *sdi;
void *info = NULL;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return NULL;
switch (device_info_id) {
struct mso *mso;
int ret = SR_ERR;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return ret;
mso = sdi->priv;
{
struct sr_device_instance *sdi;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return;
if (sdi->serial->fd != -1) {
struct mso *mso;
void *info = NULL;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return NULL;
mso = sdi->priv;
{
struct sr_device_instance *sdi;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return ST_NOT_FOUND;
return sdi->status;
{
struct sr_device_instance *sdi;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
switch (capability) {
struct datafeed_header header;
int ret = SR_ERR;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return ret;
mso = sdi->priv;
{
struct sr_device_instance *sdi;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
sdi->serial->fd = serial_open(sdi->serial->port, O_RDWR);
{
struct sr_device_instance *sdi;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return;
if (sdi->serial->fd != -1) {
struct sr_device_instance *sdi;
void *info;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return NULL;
info = NULL;
{
struct sr_device_instance *sdi;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return ST_NOT_FOUND;
return sdi->status;
int ret;
uint64_t *tmp_u64;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
if (sdi->status != ST_ACTIVE)
uint16_t readcount, delaycount;
uint8_t changrp_mask;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
if (sdi->status != ST_ACTIVE)
struct libusb_device_descriptor des;
int err, skip, i;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return NULL;
libusb_get_device_list(usb_context, &devlist);
{
struct sr_device_instance *sdi;
- if ((sdi = get_sr_device_instance(device_instances, device_index)))
+ if ((sdi = sr_get_device_instance(device_instances, device_index)))
close_device(sdi);
}
struct sr_device_instance *sdi;
void *info = NULL;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return NULL;
switch (device_info_id) {
{
struct sr_device_instance *sdi;
- sdi = get_sr_device_instance(device_instances, device_index);
+ sdi = sr_get_device_instance(device_instances, device_index);
if (sdi)
return sdi->status;
else
int ret;
uint64_t *tmp_u64;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
if (capability == HWCAP_SAMPLERATE) {
int size, i;
unsigned char *buf;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
packet = g_malloc(sizeof(struct datafeed_packet));
struct libusb_device_descriptor des;
int err, i;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return NULL;
libusb_get_device_list(usb_context, &devlist);
{
struct sr_device_instance *sdi;
- if ((sdi = get_sr_device_instance(device_instances, device_index)))
+ if ((sdi = sr_get_device_instance(device_instances, device_index)))
close_device(sdi);
}
struct sr_device_instance *sdi;
void *info = NULL;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return NULL;
switch (device_info_id) {
{
struct sr_device_instance *sdi;
- sdi = get_sr_device_instance(device_instances, device_index);
+ sdi = sr_get_device_instance(device_instances, device_index);
if (sdi)
return sdi->status;
else
struct sr_device_instance *sdi;
uint64_t *tmp_u64;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
switch (capability) {
unsigned int packet_num;
unsigned char *buf;
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return SR_ERR;
/* push configured settings to device */
packet.type = DF_END;
session_bus(session_device_id, &packet);
- if (!(sdi = get_sr_device_instance(device_instances, device_index)))
+ if (!(sdi = sr_get_device_instance(device_instances, device_index)))
return; /* TODO: Cry? */
analyzer_reset(sdi->usb->devhdl);
return sdi;
}
-struct sr_device_instance *get_sr_device_instance(
- GSList *device_instances, int device_index)
+struct sr_device_instance *sr_get_device_instance(GSList *device_instances,
+ int device_index)
{
struct sr_device_instance *sdi;
GSList *l;
/* Generic device instances */
struct sr_device_instance *sr_device_instance_new(int index,
int status, const char *vendor, const char *model, const char *version);
-struct sr_device_instance *get_sr_device_instance(
- GSList *device_instances, int device_index);
+struct sr_device_instance *sr_get_device_instance(GSList *device_instances,
+ int device_index);
void sr_device_instance_free(struct sr_device_instance *sdi);
/* USB-specific instances */