- All drivers that talk to serial ports now require libserialport.
- If libserialport is not found, those drivers will not be built.
- librevisa >= 0.0.20130812 (optional, only used by some drivers).
- * Dropped build dependecies:
+ * Dropped build dependencies:
- libasound2 is no longer required (only the removed alsa driver used it).
- libudev is no longer required (only the removed link-mso19 driver used it).
* Serial port handling code:
- Temporarily disable the driver on Windows (needs portability fixes).
- Fix an endianness issue in the protocol handling (bug #135).
- Fix a sampling issue when (samples % 4) != 0 (bug #200).
- - Fix an issue occuring when all channels were disabled (bugs #316, #347).
+ - Fix an issue occurring when all channels were disabled (bugs #316, #347).
- Add an option to turn test patterns off again (bug #293).
* rigol-ds:
- Rename the 'rigol-ds1xx2' driver to 'rigol-ds'.
- Report max. possible number of samples (bugs #197, #258, #263).
* Output modules:
- Skip analog channels in logic-only output formats.
- - Remove the obolete output module API, add wrapper calls for the new one.
+ - Remove the obsolete output module API, add wrapper calls for the new one.
- Stop using the obsolete output API (bugs #288, #47, #48).
- Properly receive and handle samplerate metadata (bug #46).
* input/vcd: Abort with an error upon > 64 channels (bug #194).
- Change various function/macro names related to the probe->channel rename.
- Change various functions due to the new channel group feature.
- All enums in the public API now have names (e.g. 'enum sr_mqflag').
- - The lib no longer defineѕ names with _t suffix (POSIX reserved).
+ - The lib no longer defines names with _t suffix (POSIX reserved).
- New API calls:
- sr_session_dev_list()
- sr_session_save_init()
- zeroplus-logic-cube
-Specifiying serial port parameters
-----------------------------------
+Specifying serial port parameters
+---------------------------------
Every serial device's driver has default serial port parameters like baud
rate, number of data bits, stop bits and handshake status. If a device requires
SR_UNIT_METER_SECOND,
/** Pressure in hectopascal */
SR_UNIT_HECTOPASCAL,
- /** Relative humidity assuming air temperature of 293 kelvin (%rF). */
+ /** Relative humidity assuming air temperature of 293 Kelvin (%rF). */
SR_UNIT_HUMIDITY_293K,
/** Plane angle in 1/360th of a full circle. */
SR_UNIT_DEGREE,
*
* @param buf Buffer containing the 14-byte protocol packet. Must not be NULL.
* @param floatval Pointer to a float variable. That variable will contain the
- * result value upon parsing success. Mut not be NULL.
+ * result value upon parsing success. Must not be NULL.
* @param analog Pointer to a struct sr_datafeed_analog. The struct will be
* filled with data according to the protocol packet.
* Must not be NULL.
}
/*
- * The libusbx darwin backend is broken: it can report a kernel driver being
+ * The libusb Darwin backend is broken: it can report a kernel driver being
* active, but detaching it always returns an error.
*/
#if !defined(__APPLE__)
} else if (!strcmp(mstr, "MV")) {
if (devc->mode_tempaux) {
devc->cur_mq = SR_MQ_TEMPERATURE;
- /* No way to detect whether Fahrenheit or Celcius
- * is used, so we'll just default to Celcius. */
+ /* No way to detect whether Fahrenheit or Celsius
+ * is used, so we'll just default to Celsius. */
devc->cur_unit = SR_UNIT_CELSIUS;
devc->cur_mqflags = 0;
devc->cur_divider = 0;
/* Prepare firmware. */
ret = sigma_fw_2_bitbang(firmware, &buf, &buf_size);
if (ret != SR_OK) {
- sr_err("An error occured while reading the firmware: %s",
+ sr_err("An error occurred while reading the firmware: %s",
firmware);
return ret;
}
- /* Upload firmare. */
+ /* Upload firmware. */
sr_info("Uploading firmware file '%s'.", firmware);
sigma_write(buf, buf_size, devc);
trigger_event);
}
- /* Find in which cluster the trigger occured. */
+ /* Find in which cluster the trigger occurred. */
trigger_cluster = trigger_event / EVENTS_PER_CLUSTER;
}
memset(lut, 0, sizeof(struct triggerlut));
- /* Contant for simple triggers. */
+ /* Constant for simple triggers. */
lut->m4 = 0xa000;
/* Value/mask trigger support. */
uint16_t m0d[4], m1d[4], m2d[4];
uint16_t m3, m3s, m4;
- /* Paramters should be sent as a single register write. */
+ /* Parameters should be sent as a single register write. */
struct {
uint8_t selc : 2;
uint8_t selpresc : 6;
case TOKEN_MEAS_RANGE_OK:
case TOKEN_MEAS_RANGE_OVER:
case TOKEN_MEAS_RANGE_UNDER:
- /* Not useful, or not expressable in sigrok. */
+ /* Not useful, or not expressible in sigrok. */
break;
}
} while ((devc->done > now) && (bytes_read == 0));
}
- /* Check if block read was successful or a timeout occured. */
+ /* Check if block read was successful or a timeout occurred. */
if (bytes_read != BS) {
sr_err("Trigger timed out. Bytes read: %d.", bytes_read);
(void) reset_device(devc); /* Ignore errors. */
/* Make sure the number of samples we put out is an integer
* multiple of our period size */
/* FIXME we actually need only one period. A ringbuffer would be
- * usefull here.*/
+ * useful here. */
while (num_samples % ANALOG_SAMPLES_PER_PERIOD != 0)
num_samples--;
/**
* Decode range/sign/acdc byte special chars, Metrahit 18.
*
- * @param[in] rs Rance/sign byte.
+ * @param[in] rs Range/sign byte.
*/
static void decode_rs_18(uint8_t rs, struct dev_context *devc)
{
/* Operational state */
gboolean settings_ok; /**< Settings msg received yet. */
int msg_type; /**< Message type (MSGID_INF, ...). */
- int msg_len; /**< Message lengh (valid when msg, curr. type known).*/
+ int msg_len; /**< Message length (valid when msg, curr. type known).*/
int mq; /**< Measured quantity */
int unit; /**< Measured unit */
uint64_t mqflags; /**< Measured quantity flags */
devc->temp_unit = devc->config[0x2e] | (devc->config[0x2f] << 8);
if (devc->temp_unit != 0 && devc->temp_unit != 1) {
sr_dbg("invalid temperature unit %d", devc->temp_unit);
- /* Default to Celcius, we're all adults here. */
+ /* Default to Celsius, we're all adults here. */
devc->temp_unit = 0;
} else
sr_dbg("temperature unit is %s", devc->temp_unit
- ? "Fahrenheit" : "Celcius");
+ ? "Fahrenheit" : "Celsius");
break;
case LOG_CO:
devc->sample_size = 2;
}
/* Some of these fail, but it needs doing -- some sort of mode
- * setup for the SILabs F32x. */
+ * setup for the SiLabs F32x. */
libusb_control_transfer(dev_hdl, LIBUSB_REQUEST_TYPE_VENDOR,
0x00, 0xffff, 0x00, NULL, 0, 50);
libusb_control_transfer(dev_hdl, LIBUSB_REQUEST_TYPE_VENDOR,
if (!(rh = g_try_malloc(sizeof(float) * samples)))
break;
for (i = 0, j = 0; i < samples; i++) {
- /* Both Celcius and Fahrenheit stored at base -40. */
+ /* Both Celsius and Fahrenheit stored at base -40. */
if (devc->temp_unit == 0)
- /* Celcius is stored in half-degree increments. */
+ /* Celsius is stored in half-degree increments. */
temp[j] = buf[i * 2] / 2 - 40;
else
temp[j] = buf[i * 2] - 40;
static const uint32_t devopts[] = {
/* Device class */
SR_CONF_POWER_SUPPLY,
- /* Aquisition modes. */
+ /* Acquisition modes. */
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
/** Private, per-device-instance driver context. */
struct dev_context {
- const struct hcs_model *model; /**< Model informaion. */
+ const struct hcs_model *model; /**< Model information. */
uint64_t limit_samples;
uint64_t limit_msec;
static const uint32_t devopts[] = {
/* Device class */
SR_CONF_POWER_SUPPLY,
- /* Aquisition modes. */
+ /* Acquisition modes. */
SR_CONF_CONTINUOUS,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
g_strstrip(buf);
verstr = buf + 4;
}
- else /* Bug in device FW 1.17: Quering version string fails while output is active.
+ else /* Bug in device FW 1.17: Querying version string fails while output is active.
Therefore just print an error message, but do not exit with error. */
sr_err("Failed to query for hardware version: %d %s", errno, strerror(errno));
const struct lps_modelspec* model;
/* Acquisition status */
- gboolean acq_running; /**< Aquisition is running. */
+ gboolean acq_running; /**< Acquisition is running. */
uint64_t limit_samples; /**< Target number of samples */
uint64_t limit_msec; /**< Target sampling time */
acquisition_req acq_req; /**< Current request. */
sr_warn("Low battery, measurement quality degraded!");
}
/* 0x08: SCALED */
- /* 0x04: RATE (=lower resolution, allows higher rata rate up to 10/s. */
+ /* 0x04: RATE (=lower resolution, allows higher data rate up to 10/s. */
/* 0x02: Current clamp */
if (flags & 0x01) { /* dB */
/*
/* what is this for? */
break;
case 0x03:
- /* Maximum sample rate (hz) */
+ /* Maximum sample rate (Hz) */
devc->max_samplerate = tmp_int;
break;
case 0x04:
/* what is this for? */
break;
case 0x03:
- /* Maximum sample rate (hz) */
+ /* Maximum sample rate (Hz) */
devc->max_samplerate = tmp_int;
break;
case 0x04:
}
}
-/* Decode an incoming capture status reponse and act on it as appropriate.
+/* Decode an incoming capture status response and act on it as appropriate.
* Note that this function changes the device state.
*/
static void process_capture_status(const struct sr_dev_inst *sdi)
/** The samplerate selected by the user. */
uint64_t samplerate;
- /** The maximimum sampling duration, in milliseconds. */
+ /** The maximum sampling duration, in milliseconds. */
uint64_t limit_msec;
- /** The maximimum number of samples to acquire. */
+ /** The maximum number of samples to acquire. */
uint64_t limit_samples;
/** Channels to use. */
g_slist_free(analog.channels);
}
-static void teleinfo_handle_mesurement(struct sr_dev_inst *sdi,
- const char *label, const char *data,
- char *optarif)
+static void teleinfo_handle_measurement(struct sr_dev_inst *sdi,
+ const char *label, const char *data, char *optarif)
{
struct dev_context *devc;
int v = atoi(data);
return FALSE;
if (!teleinfo_control_check(label, data, control))
return FALSE;
- teleinfo_handle_mesurement(sdi, label, data, optarif);
+ teleinfo_handle_measurement(sdi, label, data, optarif);
return TRUE;
}
void *session_cb_data; /**< Opaque pointer passed in by the frontend. */
/* Operational state */
- enum optarif optarif; /**< The device mode (which mesures are reported) */
+ enum optarif optarif; /**< The device mode (which measures are reported) */
uint64_t num_samples; /**< The number of already received samples. */
int64_t start_time; /**< The time at which sampling started. */
return SR_ERR;
/*
- * The libusbx 1.0.9 darwin backend is broken: it can report a kernel
+ * The libusb 1.0.9 Darwin backend is broken: it can report a kernel
* driver being active, but detaching it always returns an error.
*/
#if !defined(__APPLE__)
devc->current_channel = devc->current_channel->next;
if (dlm_channel_data_request(sdi) != SR_OK) {
- sr_err("Failed to request aquisition data.");
+ sr_err("Failed to request acquisition data.");
goto fail;
}
int (*init) (struct sr_output *o, GHashTable *options);
/**
- * This function is passed a copy of every packed in the data feed.
+ * This function is passed a copy of every packet in the data feed.
* Any output generated by the output module in response to the
* packet should be returned in a newly allocated GString
* <code>out</code>, which will be freed by the caller.
* Extract the serial device and options from the options linked list.
*
* @param options List of options passed from the command line.
- * @param serial_device Pointer where to store the exctracted serial device.
+ * @param serial_device Pointer where to store the extracted serial device.
* @param serial_options Pointer where to store the optional extracted serial
* options.
*
* of file descriptor or timeout status.
*
* @retval SR_OK Success.
- * @retval SR_ERR Error occured.
+ * @retval SR_ERR Error occurred.
*/
static int sr_session_iteration(struct sr_session *session, gboolean block)
{