Commit Graph

2793 Commits

Author SHA1 Message Date
Bert Vermeulen 60107497fe input: Use SR_ERR_NA instead of SR_OK_CONTINUE. 2014-09-30 01:49:58 +02:00
Bert Vermeulen d5cc282ff8 input: sr_input_free() is now a void function.
Its backend, input_module.cleanup(), is now also a void function.
2014-09-30 01:49:58 +02:00
Bert Vermeulen 7066fd4660 input: Add sr_input_end().
This signifies to the module instance no more input will come. This
will cause the module to process any data it may have buffered. The
SR_DF_END packet will also typically be sent at this time.
2014-09-30 01:49:58 +02:00
Bert Vermeulen 89da5b3b54 input: Free instance-private storage at instance free. 2014-09-30 01:49:58 +02:00
Bert Vermeulen d018181331 input: Add sdi_ready flag to struct sr_input.
When an input module instance has received enough input to fully
populate the struct sr_dev_inst, sdi_ready is set to TRUE and its
receive() method returns immediately. Any remaining received data
is buffered until the next time the function is called.
2014-09-30 01:49:58 +02:00
Soeren Apel 66c91e2509 Removal of sdi->index, step 8: fix victor-dmm 2014-09-30 01:42:58 +02:00
Soeren Apel bde9fbd197 Removal of sdi->index, step 7: fix testo 2014-09-30 01:42:58 +02:00
Soeren Apel c79d4444fe Removal of sdi->index, step 6: fix sysclk-lwla 2014-09-30 01:42:58 +02:00
Soeren Apel 65340dd5df Removal of sdi->index, step 5: fix ikalogic-scanalogic2 2014-09-30 01:42:58 +02:00
Soeren Apel aed4ad0bea Removal of sdi->index, step 4: fix trivial sr_dev_inst_new() calls 2014-09-30 01:42:58 +02:00
Soeren Apel f220936473 Removal of sdi->index, step 3: sr_dev_inst_new() calls for input mods 2014-09-30 01:42:58 +02:00
Soeren Apel c6805a02cc Removal of sdi->index, step 2: remove it from sr_session_load() 2014-09-30 01:42:58 +02:00
Soeren Apel 1b9e567b08 Removal of sdi->index, step 1: remove it from headers and helper funcs 2014-09-30 01:42:58 +02:00
Soeren Apel ce7d3578e3 saleae-logic16: Use physical USB connection instead of sdi->index 2014-09-30 01:42:58 +02:00
Soeren Apel 71580ef1f3 Remove sdi->index from openbench-logic-sniffer and pipistrello-ols 2014-09-30 01:42:58 +02:00
Soeren Apel 395206f460 hantek-dso: Use physical USB connection instead of sdi->index 2014-09-30 01:42:58 +02:00
Soeren Apel ee4f9bb1bd zeroplus-logic-cube: Use physical USB connection instead of sdi->index 2014-09-30 01:42:58 +02:00
Aurelien Jacobs 03a4c07aff C++: handle uint32_t SR_CONF keys which contain key capabilities
This adapts the C++ bindings according to commits 584560f and 5827f61.
2014-09-30 00:37:03 +02:00
Soeren Apel 5e2c86eb31 fx2lafw: Use physical USB connection instead of sdi->index
Previously, sdi->index was used to tell several identical fx2lafw-compatible
devices apart. This was a bit of a hack, so this patch makes it use physical
device connections instead. They're guaranteed to remain the same even if
the USB device reconnects.
2014-09-27 12:49:44 +02:00
Bert Vermeulen 8143cfdc90 Add sr_packet_copy/_free functions.
These will be used to make a copy of a packet on the session bus,
valid for the duration of the device instance that generated it.
2014-09-26 01:35:02 +02:00
Martin Ling 98edee7926 serial: Eliminate serial_read(), serial_write() and SERIAL_NONBLOCK. 2014-09-24 23:30:32 +02:00
Martin Ling 6c592ece70 std_serial_dev_open: Remove SERIAL_NONBLOCK flag.
All calls in drivers are now explicitly (non)blocking.
2014-09-24 23:30:32 +02:00
Martin Ling 406e0c79cf scpi_serial: Mark read/write calls nonblocking, remove SERIAL_NONBLOCK.
These calls were already nonblocking. Having marked them as such, the flag can
be removed.
2014-09-24 23:30:32 +02:00
Martin Ling 7ef93fb09f tondaj-sl-814: Remove SERIAL_NONBLOCK flag.
All calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:32 +02:00
Martin Ling 539a85596f tondaj-sl-814: Mark serial read/write calls as blocking.
These calls are executed from an event handler and were previously nonblocking,
but they have no partial read/write handling. The code is already marked TODO
for improvement.
2014-09-24 23:30:32 +02:00
Martin Ling 47d98603e7 tondaj-sl-814: Mark serial read call 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 9333691aaf teleinfo: Mark serial read as nonblocking, remove SERIAL_NONBLOCK flag.
This call was already nonblocking due to the flag.
2014-09-24 23:30:31 +02:00
Martin Ling 4ded59eef0 openbench-logic-sniffer: Remove SERIAL_NONBLOCK flag.
All calls in this driver are already explicitly (non)blocking.
2014-09-24 23:30:31 +02:00
Martin Ling d12ef776d3 norma-dmm: Remove SERIAL_NONBLOCK flag.
All calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:31 +02:00
Martin Ling 92714255b3 norma-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:31 +02:00
Martin Ling 8849f45ad7 norma-dmm: Make write call block.
This call was previously nonblocking, but has no partial write handling.
It is called in the scan where it is free to block.
2014-09-24 23:30:31 +02:00
Martin Ling 32950cc071 norma-dmm: 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 5b980134c5 motech-lps-30x: Remove SERIAL_NONBLOCK.
All calls in the driver are now explicitly (non)blocking.
2014-09-24 23:30:31 +02:00
Martin Ling 856dccb7a6 motech-lps-30x: Make serial write call block.
This call was previously explicitly 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 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