aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerhard Sittig <gerhard.sittig@gmx.net>2017-01-07 21:15:00 +0100
committerGerhard Sittig <gerhard.sittig@gmx.net>2017-01-07 21:36:52 +0100
commitd1ad8b10bc9a928cb7b636bcf206ea59736a8658 (patch)
treef4ef69b42f0b62a72021b989369d5635874a0d17
parentd5a61aaf2d634c4558bda225e64e720104a0203f (diff)
Revert "hameg-hmo: Support BE format for SCPI sample downloads"
Undo the change which queries the scope's endianess and has the floats converted after reception. An alternative implementation will perform better.
-rw-r--r--src/hardware/hameg-hmo/protocol.c20
-rw-r--r--src/hardware/hameg-hmo/protocol.h3
-rw-r--r--src/scpi.h1
3 files changed, 1 insertions, 23 deletions
diff --git a/src/hardware/hameg-hmo/protocol.c b/src/hardware/hameg-hmo/protocol.c
index 99a30ac..528d7b0 100644
--- a/src/hardware/hameg-hmo/protocol.c
+++ b/src/hardware/hameg-hmo/protocol.c
@@ -48,7 +48,6 @@ static const char *hameg_scpi_dialect[] = {
[SCPI_CMD_GET_ANALOG_CHAN_STATE] = ":CHAN%d:STAT?",
[SCPI_CMD_SET_ANALOG_CHAN_STATE] = ":CHAN%d:STAT %d",
[SCPI_CMD_GET_PROBE_UNIT] = ":PROB%d:SET:ATT:UNIT?",
- [SCPI_CMD_GET_BYTE_ORDER] = ":FORM:BORD?",
};
static const uint32_t hmo_devopts[] = {
@@ -496,22 +495,6 @@ static int analog_channel_state_get(struct sr_scpi_dev_inst *scpi,
g_free(tmp_str);
}
- /*
- * Determine the byte order which will be used for data blocks.
- * A ":FORM:BORD?" request will yield either an "MSBF" or "LSBF"
- * response.
- */
- state->byteorder = '?';
- if (sr_scpi_get_string(scpi,
- (*config->scpi_dialect)[SCPI_CMD_GET_BYTE_ORDER],
- &tmp_str) != SR_OK)
- return SR_ERR;
- if (tmp_str[0] == 'M')
- state->byteorder = 'b';
- else if (tmp_str[0] == 'L')
- state->byteorder = 'l';
- g_free(tmp_str);
-
return SR_OK;
}
@@ -838,8 +821,7 @@ SR_PRIV int hmo_receive_data(int fd, int revents, void *cb_data)
encoding.unitsize = sizeof(float);
encoding.is_signed = TRUE;
encoding.is_float = TRUE;
- /* Assume LE format when unknown for backwards compat. */
- encoding.is_bigendian = (state->byteorder == 'b') ? TRUE : FALSE;
+ encoding.is_bigendian = FALSE;
/* TODO: Use proper 'digits' value for this device (and its modes). */
encoding.digits = 2;
encoding.is_digits_decimal = FALSE;
diff --git a/src/hardware/hameg-hmo/protocol.h b/src/hardware/hameg-hmo/protocol.h
index c42aa98..6219ed6 100644
--- a/src/hardware/hameg-hmo/protocol.h
+++ b/src/hardware/hameg-hmo/protocol.h
@@ -87,9 +87,6 @@ struct scope_state {
int trigger_source;
int trigger_slope;
uint64_t sample_rate;
-
- /** SCPI data block byte order. 'l'/'b' when known, '?' otherwise. */
- char byteorder;
};
/** Private, per-device-instance driver context. */
diff --git a/src/scpi.h b/src/scpi.h
index bafdbe6..e9e7084 100644
--- a/src/scpi.h
+++ b/src/scpi.h
@@ -63,7 +63,6 @@ enum {
SCPI_CMD_SET_PROBE_UNIT,
SCPI_CMD_GET_ANALOG_CHAN_NAME,
SCPI_CMD_GET_DIG_CHAN_NAME,
- SCPI_CMD_GET_BYTE_ORDER,
};
struct scpi_command {