* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include <string.h>
-#include <errno.h>
#include "protocol.h"
/*
char channel[10];
devices = NULL;
- drvc = di->priv;
+ drvc = di->context;
drvc->instances = NULL;
conn = serialcomm = NULL;
memset(packet, 0, PACKET_SIZE);
if ((ret = serial_read_nonblocking(serial, packet, PACKET_SIZE)) < 0) {
sr_err("Unable to read while probing for hardware: %s",
- strerror(errno));
+ sr_strerror(ret));
return NULL;
}
if (ret != PACKET_SIZE || packet[0] != 0xaa || packet[1] != 0xaa) {
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 cleanup(const struct sr_dev_driver *di)
return std_serial_dev_close(sdi);
}
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi)
{
struct dev_context *devc;
struct sr_serial_dev_inst *serial;
uint8_t packet[PACKET_SIZE];
- (void)cb_data;
-
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
serial = sdi->conn;
serial_source_add(sdi->session, serial, G_IO_IN, 50,
atten_pps3xxx_receive_data, (void *)sdi);
- std_session_send_df_header(cb_data, LOG_PREFIX);
+ std_session_send_df_header(sdi, LOG_PREFIX);
/* Send a "channel" configuration packet now. */
memset(packet, 0, PACKET_SIZE);
return SR_OK;
}
-static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
+static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
struct dev_context *devc;
- (void)cb_data;
-
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
.dev_close = dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
- .priv = NULL,
+ .context = NULL,
};