Commit Graph

2809 Commits

Author SHA1 Message Date
Martin Ling e050124095 motech-lps-30x: Mark serial read call as nonblocking.
This call was already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. It only reads one byte, and a zero result is handled
appropriately.
2014-09-24 23:30:31 +02:00
Martin Ling 51056d61ec mic-985xx: Remove SERIAL_NONBLOCK call.
All calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:31 +02:00
Martin Ling 3e2373247c mic-985xx: Make serial write call block.
This call is executed from an event handler and was previously nonblocking,
but has no partial write handling. It sends a short packet so should be OK
to block, most likely the output buffer will be empty anyway.
2014-09-24 23:30:31 +02:00
Martin Ling 98842e53eb mic-985xx: Mark serial read as nonblocking.
This call was already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. Partial reads are handled.
2014-09-24 23:30:31 +02:00
Martin Ling e13e354f89 gmc-mh-1x-2x: Remove SERIAL_NONBLOCK flag.
All calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:31 +02:00
Martin Ling 612db3c44b gmc-mh-1x-2x: Make serial write calls block.
These calls are executed from an event handler and were previously nonblocking,
but have no partial write handling. They send short packets so should be OK to
block, most likely the output buffer will be empty anyway.

Fix error handling for some: serial_write can return any negative error code.
2014-09-24 23:30:30 +02:00
Martin Ling e1960467ce gmc-mh-1x-2x: Make serial write call block, and fix error handling.
This call was previously nonblocking, but there is no handling of partial
writes. It is called from config_set where it is free to block.

Also fix error handling: serial_write can return any negative error code,
not just -1.
2014-09-24 23:30:30 +02:00
Martin Ling 4a0eda2b70 gmc-mh-1x-2x: Mark serial read calls as nonblocking.
These calls were already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. They only read one byte. A return value of zero is not
handled, but should not occur in theory due to the G_IO_IN check. It might be
good to add handling of a zero return anyway, since I'm not sure if this is
always accurate.
2014-09-24 23:30:30 +02:00
Martin Ling 0714a010cc gmc-mh-1x-2x: Mark serial read call as nonblocking.
This call was already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. It only reads one byte, and a zero result is handled
appropriately.
2014-09-24 23:30:30 +02:00
Martin Ling bb27c76513 fluke-dmm: Make serial write calls block, and fix error handling.
These calls are executed from an event handler and were previously nonblocking,
but have no partial write handling. They send short packets so should be OK to
block, most likely the output buffer will be empty anyway.

Also fix error handling for these calls, which seems to have been retained from
previous direct usage of write() to a serial port fd.
2014-09-24 23:30:30 +02:00
Martin Ling 50276118ca fluke-dmm: Make serial write calls block, and fix error handling.
These calls were previously nonblocking, but have no partial write handling.
They are made from scan and acquisition_start contexts where they are free
to block.

Remove the SERIAL_NONBLOCK at open, which only applied during scan, since all
calls in the scan are now explicitly blocking.

Also fix error handling for these calls, which appears to have been kept
from a previous direct usage of write() on a serial port fd.
2014-09-24 23:30:30 +02:00
Martin Ling 707fa85ad5 fluke-dmm: Mark serial read call as nonblocking.
This call was already nonblocking since the driver opens the port with the
SERIAL_NONBLOCK flag. Only one byte is read. The case of 0 being returned
is not handled, but the call is only made if G_IO_IN occurred so in theory,
there should be a byte available. It might be wise to add handling for a
return of 0 nonetheless, as I'm not sure if this is always accurate.
2014-09-24 23:30:23 +02:00
Martin Ling 55e32714f9 conrad-digi-35-cpu: Make serial write call block.
This call was previously nonblocking, but there is no partial write handling.
It is only called from config_set so it is free to block.
2014-09-24 23:30:01 +02:00
Martin Ling 0ac161bba0 conrad-digi-35-cpu: Remove SERIAL_NONBLOCK flag from open at scan time.
This open call is only made to check access, the port is closed immediately
afterwards. The flag therefore has no effect.
2014-09-24 23:30:01 +02:00
Martin Ling c9fc06d7f0 colead-slm: Mark serial read calls as nonblocking.
This is an odd one. These calls are made from a receive handler so should not
block, and appear to be setup correctly to handle partial reads or no data
available. However, the driver was not opening the port with SERIAL_NONBLOCK
so these calls would have been blocking. Make them nonblocking.
2014-09-24 23:30:01 +02:00
Martin Ling 258a23134d center-3xx: Remove SERIAL_NONBLOCK flag.
All serial calls in this driver are now explicitly (non)blocking.
2014-09-24 23:30:00 +02:00
Martin Ling c1da74fc0a center-3xx: Make serial write call block.
This call is executed from an event handler and was previously nonblocking,
but has no partial write handling. It sends a short packet so should be OK
to block, most likely the output buffer will be empty anyway.
2014-09-24 23:30:00 +02:00
Martin Ling 3582ce8a01 center-3xx: Mark serial read call as nonblocking.
This call was already nonblocking because the driver opens the port with the
SERIAL_NONBLOCK flag. Partial reads are handled.
2014-09-24 23:30:00 +02:00
Martin Ling d7b269da8f cem-dt-885x: Mark serial access as nonblocking, remove SERIAL_NONBLOCK flag.
These calls were already nonblocking since this driver opened the port with
the SERIAL_NONBLOCK flag. Having marked them as such, we can remove the flag.

Also remove an unnecessary reopen of the port to change its blocking status.
2014-09-24 23:30:00 +02:00
Martin Ling ca4266a02f brymen-dmm: Remove SERIAL_NONBLOCK flag.
All serial read/write calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:00 +02:00
Martin Ling 776313d997 brymen-dmm: Make serial write call block.
This call is executed from an event handler and was previously nonblocking,
but has no partial write handling. It sends a short packet so should be OK
to block, most likely the output buffer will be empty anyway.
2014-09-24 23:30:00 +02:00
Martin Ling 44be13b1f8 brymen-dmm: Mark serial read calls as nonblocking.
The driver opens the port with SERIAL_NONBLOCK so these were already
nonblocking, and are handled appropriately.
2014-09-24 23:30:00 +02:00
Martin Ling 5305266a28 atten-pps3xxx: Remove SERIAL_NONBLOCK.
All serial read/write calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:00 +02:00
Martin Ling c3116bc311 atten-pps3xxx: Make serial write call block.
This call is executed from an event handler and was previously nonblocking,
but has no partial write handling. It sends a short packet so should be OK
to block, most likely the output buffer will be empty anyway.
2014-09-24 23:30:00 +02:00
Martin Ling e7b4103697 atten-pps3xxx: Make serial write call block in scan.
This is called at scan time so free to block. There is no partial write
handling and a response is expected afterwards. This should therefore be a
blocking call.
2014-09-24 23:30:00 +02:00
Martin Ling 25dd083128 appa-55ii: Mark serial read nonblocking and remove SERIAL_NONBLOCK.
This is the only read/write call in the driver. It is already non-blocking
and is handled appropriately.
2014-09-24 23:29:49 +02:00
Martin Ling 64c536be52 aglient-dmm: Remove SERIAL_NONBLOCK flag.
All serial calls in this driver are now explicitly (non)blocking.
2014-09-24 23:18:21 +02:00
Martin Ling a5053ddd21 agilent-dmm: Make serial write call block in send.
This call is executed from an event handler context was previously
nonblocking, however there is no handling for a partial write.

The output buffer is unlikely to be full and the commands to be sent
are short, so it should be OK to make this a blocking call.
2014-09-24 23:18:21 +02:00
Martin Ling 485b9ae34d agilent-dmm: Make serial write call block in scan.
This call is executed at scan time so is free to block. There is no
handling for a partial write and a response is expected immediately
afterwards. It should therefore be a blocking call.
2014-09-24 23:18:21 +02:00
Martin Ling e0b781a45b agilent-dmm: Mark serial read call as nonblocking.
This driver opens the port with the SERIAL_NONBLOCK flag, so this call is
already a nonblocking one, and is handled appropriately.
2014-09-24 23:18:21 +02:00
Martin Ling 2e360339f9 serial-dmm: Remove SERIAL_NONBLOCK flag.
All serial read/write calls in this driver are now explicitly
nonblocking so there is no need for this flag.
2014-09-24 23:18:20 +02:00
Martin Ling 4277ac349c serial-dmm: Mark serial read/write calls as nonblocking.
This driver opens the port with the SERIAL_NONBLOCK flag so these calls were
already non-blocking.
2014-09-24 23:18:20 +02:00
Martin Ling 02bd1d0298 colead-slm: Mark serial write call as blocking.
This driver opens the port without the SERIAL_NONBLOCK flag,
so this call was already blocking.
2014-09-24 23:18:20 +02:00
Martin Ling bbff0fe0d2 manson-hcs-3xxx: Mark serial read call as blocking.
This driver opens the port without the SERIAL_NONBLOCK flag, so this call is
already a blocking one.
2014-09-24 23:18:20 +02:00
Martin Ling bf505eed6b serial_readline: Implement using sp_blocking_read. 2014-09-24 23:18:20 +02:00
Martin Ling 18e4d5bc45 serial_stream_detect: Make read nonblocking.
This code implements its own waiting based on baudrate, so the read itself
should be nonblocking. In general it will have been already, since drivers
almost universally use the SERIAL_NONBLOCK flag.
2014-09-24 23:18:20 +02:00
Soeren Apel 2fe6210af6 Add serial_num and connection_id fields to sr_dev_inst 2014-09-24 00:40:03 +02:00
Soeren Apel db156e5409 Add usb_get_port_path() helper function
There is currently no way to uniquely identify USB devices in
libsigrok. It uses the "bus.address" scheme which is only
constant as long as the device remains attached to the bus.
In order to allow USB device persistence in PulseView, devices
need to provide a unique identifier even in absence of a
serial number. This function is the first step as it provides
the ability to query the physical location of a USB device.
2014-09-24 00:40:03 +02:00
Bert Vermeulen f12d997948 demo: Fix pattern mode and amplitude option publishing. 2014-09-23 22:40:47 +02:00
Bert Vermeulen 9a10ce65d6 colead-slm: Properly check acquisition sample limit. 2014-09-23 22:27:34 +02:00
Bert Vermeulen 79f92686c6 session: Don't try to send packets if no session has been set.
This indicates a bug, but let's not segfault if it happens.
2014-09-22 00:47:22 +02:00
Bert Vermeulen 04c2f202f2 input/chronovu_la8: Fix broken I/O loop. 2014-09-22 00:47:22 +02:00
Uwe Hermann af945a6625 Typos and consistency fixes. 2014-09-19 01:03:32 +02:00
Bert Vermeulen d4ccb6bd8f yokogawa-dlm: Don't implement dummy scan options. 2014-09-17 17:41:41 +02:00
Bert Vermeulen 5827f61b64 Publish config key capabilities.
Every driver now publishes its device option config keys, i.e. the
list fetched with sr_config_list(SR_CONF_DEVICE_OPTIONS), with a
set of flags indicating which methods are implemented by the driver
for that key.

The config keys are OR'ed with any combination of SR_CONF_GET,
SR_CONF_SET and SR_CONF_LIST. These are defined as the high bits
of the uint32_t config key. Clients can OR config keys with
SR_CONF_MASK to strip out these bits. This mask will be kept up to
date if other bits are added to the capabilities list; clients MUST
therefore use SR_CONF_MASK for this.

Some keys don't have capability bits added, such as the informative
device type keys (SR_CONF_MULTIMETER, SR_CONF_OSCILLOSCOPE, ...) and
SR_CONF_CONTINUOUS.

Scan options do not have capabilities bits.
2014-09-17 15:36:11 +02:00
Bert Vermeulen 138589b02e beaglelogic: Add missing scan options, and cleanup. 2014-09-16 23:51:38 +02:00
Bert Vermeulen a0e0bb4149 Consistently use 'scanopts' variable across all drivers. 2014-09-16 22:19:02 +02:00
Bert Vermeulen f254bc4bba Consistently use 'devopts' variable across all drivers. 2014-09-16 22:11:39 +02:00
Bert Vermeulen 584560f142 Change type of SR_CONF keys to uint32_t. 2014-09-16 21:22:41 +02:00
Martin Ling a4e4745458 C++: Make hardware device instances user owned. 2014-09-14 05:33:24 +01:00