Skip to content

Commit

Permalink
scpi: Add enum scpi_transport_layer.
Browse files Browse the repository at this point in the history
  • Loading branch information
knarfS authored and uwehermann committed Apr 17, 2019
1 parent 7e66bf0 commit 87aa1e6
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/scpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ enum {
SCPI_CMD_GET_DIG_CHAN_NAME,
};

enum scpi_transport_layer {
SCPI_TRANSPORT_LIBGPIB,
SCPI_TRANSPORT_SERIAL,
SCPI_TRANSPORT_RAW_TCP,
SCPI_TRANSPORT_RIGOL_TCP,
SCPI_TRANSPORT_USBTMC,
SCPI_TRANSPORT_VISA,
SCPI_TRANSPORT_VXI,
};

struct scpi_command {
int command;
const char *string;
Expand All @@ -80,6 +90,7 @@ struct sr_scpi_hw_info {
struct sr_scpi_dev_inst {
const char *name;
const char *prefix;
enum scpi_transport_layer transport;
int priv_size;
GSList *(*scan)(struct drv_context *drvc);
int (*dev_inst_new)(void *priv, struct drv_context *drvc,
Expand Down
1 change: 1 addition & 0 deletions src/scpi/scpi_libgpib.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ SR_PRIV int sr_scpi_gpib_spoll(struct sr_scpi_dev_inst *scpi, char *buf)
SR_PRIV const struct sr_scpi_dev_inst scpi_libgpib_dev = {
.name = "GPIB",
.prefix = "libgpib",
.transport = SCPI_TRANSPORT_LIBGPIB,
.priv_size = sizeof(struct scpi_gpib),
.dev_inst_new = scpi_gpib_dev_inst_new,
.open = scpi_gpib_open,
Expand Down
1 change: 1 addition & 0 deletions src/scpi/scpi_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ static void scpi_serial_free(void *priv)
SR_PRIV const struct sr_scpi_dev_inst scpi_serial_dev = {
.name = "serial",
.prefix = "",
.transport = SCPI_TRANSPORT_SERIAL,
.priv_size = sizeof(struct scpi_serial),
.scan = scpi_serial_scan,
.dev_inst_new = scpi_serial_dev_inst_new,
Expand Down
2 changes: 2 additions & 0 deletions src/scpi/scpi_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ static void scpi_tcp_free(void *priv)
SR_PRIV const struct sr_scpi_dev_inst scpi_tcp_raw_dev = {
.name = "RAW TCP",
.prefix = "tcp-raw",
.transport = SCPI_TRANSPORT_RAW_TCP,
.priv_size = sizeof(struct scpi_tcp),
.dev_inst_new = scpi_tcp_dev_inst_new,
.open = scpi_tcp_open,
Expand All @@ -292,6 +293,7 @@ SR_PRIV const struct sr_scpi_dev_inst scpi_tcp_raw_dev = {
SR_PRIV const struct sr_scpi_dev_inst scpi_tcp_rigol_dev = {
.name = "RIGOL TCP",
.prefix = "tcp-rigol",
.transport = SCPI_TRANSPORT_RIGOL_TCP,
.priv_size = sizeof(struct scpi_tcp),
.dev_inst_new = scpi_tcp_dev_inst_new,
.open = scpi_tcp_open,
Expand Down
1 change: 1 addition & 0 deletions src/scpi/scpi_usbtmc_libusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,7 @@ static void scpi_usbtmc_libusb_free(void *priv)
SR_PRIV const struct sr_scpi_dev_inst scpi_usbtmc_libusb_dev = {
.name = "USBTMC",
.prefix = "usbtmc",
.transport = SCPI_TRANSPORT_USBTMC,
.priv_size = sizeof(struct scpi_usbtmc_libusb),
.scan = scpi_usbtmc_libusb_scan,
.dev_inst_new = scpi_usbtmc_libusb_dev_inst_new,
Expand Down
1 change: 1 addition & 0 deletions src/scpi/scpi_visa.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ static void scpi_visa_free(void *priv)
SR_PRIV const struct sr_scpi_dev_inst scpi_visa_dev = {
.name = "VISA",
.prefix = "visa",
.transport = SCPI_TRANSPORT_VISA,
.priv_size = sizeof(struct scpi_visa),
.dev_inst_new = scpi_visa_dev_inst_new,
.open = scpi_visa_open,
Expand Down
1 change: 1 addition & 0 deletions src/scpi/scpi_vxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ static void scpi_vxi_free(void *priv)
SR_PRIV const struct sr_scpi_dev_inst scpi_vxi_dev = {
.name = "VXI",
.prefix = "vxi",
.transport = SCPI_TRANSPORT_VXI,
.priv_size = sizeof(struct scpi_vxi),
.dev_inst_new = scpi_vxi_dev_inst_new,
.open = scpi_vxi_open,
Expand Down

0 comments on commit 87aa1e6

Please sign in to comment.