]> sigrok.org Git - libsigrok.git/commitdiff
scpi: Add enum scpi_transport_layer.
authorFrank Stettner <redacted>
Thu, 11 Apr 2019 11:03:11 +0000 (13:03 +0200)
committerUwe Hermann <redacted>
Wed, 17 Apr 2019 15:44:51 +0000 (17:44 +0200)
src/scpi.h
src/scpi/scpi_libgpib.c
src/scpi/scpi_serial.c
src/scpi/scpi_tcp.c
src/scpi/scpi_usbtmc_libusb.c
src/scpi/scpi_visa.c
src/scpi/scpi_vxi.c

index 162c7a3657ec649f08d923b927605de37bd5317d..5d0459ffd88aad283363b71f29bdc218d384ebfc 100644 (file)
@@ -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;
@@ -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,
index 4519a4e70e2da78589c35c779e12287432f28595..26fcadac9df66626b4c7e04ef43f55670ceef442 100644 (file)
@@ -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,
index 255416743cfda05e37b370b5da3efee1ddcd945a..96fb70d60658883e0473349a66155239a86fe2c6 100644 (file)
@@ -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,
index 6477c064dcd92aa57eeec5e00d49558a16033b9e..29e7a4394aa8a54c1c69871f5362151ea6ff66db 100644 (file)
@@ -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,
@@ -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,
index 6b0334440e94e9ce993ca534f1b4c58d16abd804..d09b35ffb42b165bd12880e123cf0aba42221f00 100644 (file)
@@ -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,
index a05b58d04a7859d827881a63bcdd689d81555e16..c4f5553a275debbf2e2227773b2c31ea44cf2e37 100644 (file)
@@ -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,
index 234219c60f511f0be1673da5fa0568a670de0165..774b8b52ca2f43db2e0d2bc807820ed9bdf049b0 100644 (file)
@@ -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,