]> sigrok.org Git - libsigrok.git/commitdiff
Use std_serial_dev_open().
authorBert Vermeulen <redacted>
Sat, 7 Dec 2013 20:36:27 +0000 (21:36 +0100)
committerBert Vermeulen <redacted>
Sat, 7 Dec 2013 20:54:08 +0000 (21:54 +0100)
hardware/agilent-dmm/api.c
hardware/brymen-dmm/api.c
hardware/center-3xx/api.c
hardware/fluke-dmm/api.c
hardware/gmc-mh-1x-2x/api.c
hardware/mic-985xx/api.c
hardware/norma-dmm/api.c
hardware/openbench-logic-sniffer/api.c
hardware/serial-dmm/api.c
hardware/teleinfo/api.c
hardware/tondaj-sl-814/api.c

index a58e57c32e2a983d30653ae1761975c5d51b4bf1..cc2a4be84f58463084c35a252e15772ae4bb6d1e 100644 (file)
@@ -169,19 +169,6 @@ static GSList *dev_list(void)
        return ((struct drv_context *)(di->priv))->instances;
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial;
-
-       serial = sdi->conn;
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int cleanup(void)
 {
        return dev_clear();
@@ -290,7 +277,7 @@ SR_PRIV struct sr_dev_driver agdmm_driver_info = {
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
-       .dev_open = dev_open,
+       .dev_open = std_serial_dev_open,
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
index c9f9ba753df50b740d06fe6d7d32415beb5500c6..4b43e3d7f015d2b7675cb5b317e6db6b96619476 100644 (file)
@@ -149,19 +149,6 @@ static GSList *dev_list(void)
        return ((struct drv_context *)(di->priv))->instances;
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial;
-
-       serial = sdi->conn;
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int cleanup(void)
 {
        return dev_clear();
@@ -272,7 +259,7 @@ SR_PRIV struct sr_dev_driver brymen_bm857_driver_info = {
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
-       .dev_open = dev_open,
+       .dev_open = std_serial_dev_open,
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
index aa1e4a7bae5be997260d867bea6ff246b14e1fd8..b85273e51d2942ebde8aa034112a46d4fae77ed4 100644 (file)
@@ -155,19 +155,6 @@ static GSList *dev_list(int idx)
        return ((struct drv_context *)(center_devs[idx].di->priv))->instances;
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial;
-
-       serial = sdi->conn;
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int cleanup(int idx)
 {
        return dev_clear(idx);
@@ -291,7 +278,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \
        .config_get = NULL, \
        .config_set = config_set, \
        .config_list = config_list, \
-       .dev_open = dev_open, \
+       .dev_open = std_serial_dev_open, \
        .dev_close = std_serial_dev_close, \
        .dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \
        .dev_acquisition_stop = dev_acquisition_stop, \
index 52c340806b4d11dc81eba1d49bf291e357ecefe1..0cb0c11557c201c94740f324bc13ebfb9b0ae5fc 100644 (file)
@@ -202,19 +202,6 @@ static GSList *dev_list(void)
        return ((struct drv_context *)(di->priv))->instances;
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial;
-
-       serial = sdi->conn;
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int cleanup(void)
 {
        return dev_clear();
@@ -330,7 +317,7 @@ SR_PRIV struct sr_dev_driver flukedmm_driver_info = {
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
-       .dev_open = dev_open,
+       .dev_open = std_serial_dev_open,
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
index 922f9fee98c4ccb82e3d4b28438f14129fa17bc9..2938c36a4aada210c019b27e530b6cf6d729185e 100644 (file)
@@ -221,17 +221,6 @@ static int dev_clear_1x_2x_rs232(void)
        return std_dev_clear(&gmc_mh_1x_2x_rs232_driver_info, NULL);
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial = sdi->conn;
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int dev_close(struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
@@ -389,7 +378,7 @@ SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info = {
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
-       .dev_open = dev_open,
+       .dev_open = std_serial_dev_open,
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acq_start_1x_2x_rs232,
        .dev_acquisition_stop = dev_acq_stop,
index cdbf70dff2c765db5ab2fd3967e63b4de4dd2ff7..641ca33016bd3904cede5da09fdeaa6031faa0b6 100644 (file)
@@ -157,19 +157,6 @@ static GSList *dev_list(int idx)
        return ((struct drv_context *)(mic_devs[idx].di->priv))->instances;
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial;
-
-       serial = sdi->conn;
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int cleanup(int idx)
 {
        return dev_clear(idx);
@@ -293,7 +280,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \
        .config_get = NULL, \
        .config_set = config_set, \
        .config_list = config_list, \
-       .dev_open = dev_open, \
+       .dev_open = std_serial_dev_open, \
        .dev_close = std_serial_dev_close, \
        .dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \
        .dev_acquisition_stop = dev_acquisition_stop, \
index 397694cabfa059eb7d8e299e961223b937ec256e..27a4db5e5d846ec579c9cbd3622cfaf83204ce19 100644 (file)
@@ -168,19 +168,6 @@ static int dev_clear(void)
        return std_dev_clear(di, NULL);
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial;
-
-       serial = sdi->conn;
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int dev_close(struct sr_dev_inst *sdi)
 {
        struct dev_context *devc;
@@ -318,7 +305,7 @@ SR_PRIV struct sr_dev_driver norma_dmm_driver_info = {
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
-       .dev_open = dev_open,
+       .dev_open = std_serial_dev_open,
        .dev_close = dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
index c189bed32715800b1ac6b2e947ca38668db42411..8df4a8cd178739871894394287778f115ff3bcb1 100644 (file)
@@ -210,19 +210,6 @@ static GSList *dev_list(void)
        return ((struct drv_context *)(di->priv))->instances;
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial;
-
-       serial = sdi->conn;
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int cleanup(void)
 {
        return dev_clear();
@@ -551,7 +538,7 @@ SR_PRIV struct sr_dev_driver ols_driver_info = {
        .config_get = config_get,
        .config_set = config_set,
        .config_list = config_list,
-       .dev_open = dev_open,
+       .dev_open = std_serial_dev_open,
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
index 4af043a4c309876922dec8df35deb5da84f9919e..a3123b080916063760bc6bb3466ddfdc8c7f3f88 100644 (file)
@@ -380,19 +380,6 @@ static GSList *dev_list(int dmm)
        return ((struct drv_context *)(dmms[dmm].di->priv))->instances;
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial;
-
-       serial = sdi->conn;
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int cleanup(int dmm)
 {
        return dev_clear(dmm);
@@ -529,7 +516,7 @@ SR_PRIV struct sr_dev_driver ID##_driver_info = { \
        .config_get = NULL, \
        .config_set = config_set, \
        .config_list = config_list, \
-       .dev_open = dev_open, \
+       .dev_open = std_serial_dev_open, \
        .dev_close = std_serial_dev_close, \
        .dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \
        .dev_acquisition_stop = dev_acquisition_stop, \
index 49a3f5ce34fbece1c453e59b726559e5d06e5a79..7728a314e94f016f6da16923392e503c464b8d3c 100644 (file)
@@ -174,18 +174,6 @@ static int dev_clear(void)
        return std_dev_clear(di, NULL);
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial = sdi->conn;
-
-       if (serial_open(serial, SERIAL_RDONLY | SERIAL_NONBLOCK) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int cleanup(void)
 {
        return dev_clear();
@@ -293,7 +281,7 @@ SR_PRIV struct sr_dev_driver teleinfo_driver_info = {
        .dev_clear = dev_clear,
        .config_set = config_set,
        .config_list = config_list,
-       .dev_open = dev_open,
+       .dev_open = std_serial_dev_open,
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,
index f99582381e7ad079c842a77d57f50b7a95d37183..2ed95402fd966f26ad7ba191dafa04b5a7ae5b51 100644 (file)
@@ -128,19 +128,6 @@ static GSList *dev_list(void)
        return ((struct drv_context *)(di->priv))->instances;
 }
 
-static int dev_open(struct sr_dev_inst *sdi)
-{
-       struct sr_serial_dev_inst *serial;
-
-       serial = sdi->conn;
-       if (serial_open(serial, SERIAL_RDWR | SERIAL_NONBLOCK) != SR_OK)
-               return SR_ERR;
-
-       sdi->status = SR_ST_ACTIVE;
-
-       return SR_OK;
-}
-
 static int cleanup(void)
 {
        return dev_clear();
@@ -234,7 +221,7 @@ SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info = {
        .config_get = NULL,
        .config_set = config_set,
        .config_list = config_list,
-       .dev_open = dev_open,
+       .dev_open = std_serial_dev_open,
        .dev_close = std_serial_dev_close,
        .dev_acquisition_start = dev_acquisition_start,
        .dev_acquisition_stop = dev_acquisition_stop,