]> sigrok.org Git - libsigrok.git/commitdiff
gmc-mh-1x-2x: Support for interface SI232-II with driver gmc-mh-2x-bd232.
authorMatthias Heidbrink <redacted>
Sun, 9 Feb 2014 17:13:49 +0000 (18:13 +0100)
committerUwe Hermann <redacted>
Tue, 11 Feb 2014 17:05:25 +0000 (18:05 +0100)
README.devices
hardware/gmc-mh-1x-2x/api.c
hardware/gmc-mh-1x-2x/protocol.c

index 3591fe9c9722dbeda9608e1c2b22ee21b9e6369c..136db62c52e77294073a7a877c1301856bd8be7a 100644 (file)
@@ -10,7 +10,7 @@ Firmware
 --------
 
 Some devices supported by libsigrok need a firmware to be uploaded every time
 --------
 
 Some devices supported by libsigrok need a firmware to be uploaded every time
-the device is connected to the PC (usually via USB), before it can be used. 
+the device is connected to the PC (usually via USB), before it can be used.
 
 The default location where libsigrok expects the firmware files is:
 
 
 The default location where libsigrok expects the firmware files is:
 
@@ -288,10 +288,16 @@ a short list for convenience:
    interface panel on top.
  - Digitek DT4000ZC: Briefly press the "RS232" button.
  - Gossen Metrawatt Metrahit 1x/2x devices, driver gmc-mh-1x-2x-rs232:
    interface panel on top.
  - Digitek DT4000ZC: Briefly press the "RS232" button.
  - Gossen Metrawatt Metrahit 1x/2x devices, driver gmc-mh-1x-2x-rs232:
-   Power on the device with the "DATA" button pressed. Additionally Metrahit
-   2x devices must be configured for the respective interface type.
+   - Power on the device with the "DATA" button pressed.
+   - Metrahit 2x devices must be configured for the respective interface type.
  - Gossen Metrawatt Metrahit 2x devices, driver gmc-mh-2x-bd232:
  - Gossen Metrawatt Metrahit 2x devices, driver gmc-mh-2x-bd232:
-   The device must be configured for the respective interface type.
+   - 'BD232' interface:
+      The multimeter must be configured for the respective interface type.
+   - 'SI232-II' interface ("PC Mode"):
+      The multimeter must be configured for interface type 'BD232' (all),
+      'SI232 online' (28-29S) or 'SI232 store' (22-26x). The interface must
+      be configured to the same baud rate as the host (default 9600).
+      Multimeter and interface must be configured to the same address.
  - Norma DM950: If the interface doesn't work (e.g. USB-RS232 converter), power
    on the device with "FUNC" pressed (to power the interface from the DMM).
  - PCE PCE-DM32: Briefly press the "RS232" button.
  - Norma DM950: If the interface doesn't work (e.g. USB-RS232 converter), power
    on the device with "FUNC" pressed (to power the interface from the DMM).
  - PCE PCE-DM32: Briefly press the "RS232" button.
index 4084bf6518315ea3a7960cff93982388161b1bd9..8c413e600017812dd9e58f872d810ae1a7af9eab 100644 (file)
@@ -436,13 +436,13 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
                      const struct sr_probe_group *probe_group)
 {
        int ret;
                      const struct sr_probe_group *probe_group)
 {
        int ret;
+       struct dev_context *devc;
 
        (void)sdi;
        (void)data;
        (void)probe_group;
 
        ret = SR_OK;
 
        (void)sdi;
        (void)data;
        (void)probe_group;
 
        ret = SR_OK;
-       struct dev_context *devc;
 
        (void)probe_group;
 
 
        (void)probe_group;
 
@@ -621,7 +621,7 @@ SR_PRIV struct sr_dev_driver gmc_mh_1x_2x_rs232_driver_info = {
 
 SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info = {
        .name = "gmc-mh-2x-bd232",
 
 SR_PRIV struct sr_dev_driver gmc_mh_2x_bd232_driver_info = {
        .name = "gmc-mh-2x-bd232",
-       .longname = "Gossen Metrawatt Metrahit 2x, 'BD232' interface",
+       .longname = "Gossen Metrawatt Metrahit 2x, 'BD232'/'SI232-II' interface",
        .api_version = 1,
        .init = init_2x_bd232,
        .cleanup = cleanup_2x_bd232,
        .api_version = 1,
        .init = init_2x_bd232,
        .cleanup = cleanup_2x_bd232,
index b0163dbd1e0bf2eeac67e2e8e868665fc2b12796..ceb138e965c0936467e10f8f9390a3abaeff4f61 100644 (file)
@@ -1320,11 +1320,15 @@ int req_stat14(const struct sr_dev_inst *sdi, gboolean power_on)
 
        if (power_on) {
                sr_info("Write some data and wait 3s to turn on powered off device...");
 
        if (power_on) {
                sr_info("Write some data and wait 3s to turn on powered off device...");
-               if ((serial_write(serial, msg, sizeof(msg)) == -1) ||
-                               (serial_write(serial, msg, sizeof(msg)) == -1) ||
-                               (serial_write(serial, msg, sizeof(msg)) == -1))
+               if (serial_write(serial, msg, sizeof(msg)) < 0)
                        return SR_ERR;
                        return SR_ERR;
-               g_usleep(3*1000*1000);
+               g_usleep(1*1000*1000);
+               if (serial_write(serial, msg, sizeof(msg)) < 0)
+                       return SR_ERR;
+               g_usleep(1*1000*1000);
+               if (serial_write(serial, msg, sizeof(msg)) < 0)
+                       return SR_ERR;
+               g_usleep(1*1000*1000);
                serial_flush(serial);
        }
 
                serial_flush(serial);
        }