| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Also some Qt6 related changes.
Task-number: QTBUG-86118
Change-Id: Id5bdf646071fcc10415945dfae73b2c66e53f7a7
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
| |
Unfortunately on Windows there's regularly failures to get config descriptors
for some devices. That's something I want in log files even if debug messages
are disabled, but it happens too often on Windows to show to users.
Change-Id: Ib6f1205074b8b8386175fda0ac1a91344d98ef8c
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
|
|
|
|
|
|
|
|
|
| |
Some commands allow users to retrieve server messages on the command
line.
Change-Id: Id9d69c6c9a300cfefadde58321e301eb827e04ce
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
For extensions of qdb the default error handler (start server and try again)
which was used for askDevices and watchDevices is used very often. In order
to not duplicate this function for every additional command the same function
is reused.
Change-Id: I469ccf6955c5590e295d9182a80cdfb3a4dfbcd0
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
| |
For later usage important log messages are stored in a buffer.
A logging class will notify listeners about new messages in the buffer.
Change-Id: If892c050ffe1e929d9ccf08880db26d98fdb4ed9
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
| |
Change-Id: I5b27907883ecebd7572b3b7e400179a240199f8f
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
| |
Change-Id: I26c4361900ebfa5691a8ce77ab4226e87cc07219
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
| |
End users will not know what LIBUSB_ERROR_ACCESS means.
Instead give a hint to read the manual because most probably they
forgot to setup the udev rule.
Change-Id: I8237d55dfe64976f4d4a279af31dfa743e8cc29c
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
| |
If -f is given with a client command, return code is always 0 even if
there were errors. This allows using stop-server even when it might fail
due to no server being available.
Change-Id: I0222b918510ffc47e804da381cfe21f83aa7dfef
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
| |
Existing `qdb server` runs the server on the foreground, which is
different.
Change-Id: Id4b9cf4b28e856e3dac93d03533a9a7d6d2874b9
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
The filter rule handling was not updated when the logging categories
were renamed to include qdb. This caused the raw messages to be logged
always.
Amends 2750685b372b78330a9139a98d084bb7a60e367e.
Change-Id: I43d37ea9f81f15efce4eefc4b04c74006ee72348
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-60434
Change-Id: I73740ae66ab565f32df25fa2c98d5cb6c019d666
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't allow reconfiguring the network on the device without a reset in
between. It wouldn't lead to a working configuration, since the host has
already gotten an IP from the existing configuration at this point.
But if the already configured network happens to be free, use it. This
allows devices to work keeping the same address even if host qdb is
restarted.
This doesn't guard against the possibility that the existing
configuration conflicts with a network already in place. But telling
apart that situation would be too difficult: How to tell whether the
network is the device or something else? In that case the user just
has to replug the device. Then it will pick an unused subnet.
Task-number: QTBUG-59451
Change-Id: I10c948713736dd79442265ac6a590b8a7cf8345a
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we don't keep track of them, inserting two devices at the same time
can lead to both picking the same candidate. This happens if the host
does not get an IP in time and thus the network is still free from host
perspective as the second call looks for the subnet to use.
The tracking is done by UsbDevice and DeviceInformation keeping a
SubnetReservation. The SubnetReservation is gotten from
findUnusedSubnet(), which uses a SubnetPool singleton to keep track of
them. When the SubnetReservations are destructed, they call SubnetPool
to free the subnet the reserved.
Task-number: QTBUG-59449
Change-Id: I4b28ade4fa7a5660bd699882398facafafc9d795
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the procedure for a newly detected device: First configure the
network and then do the handshake for the device information.
The configuring the network part is new and incorporates a new service
NetworkConfigurationService. On the device it relies on a script
b2qt-gadget-network.sh (or as specified in a command line parameter)
which does the actual configuring of the USB network interface.
The network configuration to apply is selected from a list of hardcoded
candidates from the private use IPv4 ranges available. They are checked
against the existing networks on the host and an unused one is picked.
On the device the USB interface is configured to use this network and to
act as a DHCP server for it. Host will then pick up an IP from this DHCP
server automatically. Previous configuration of the host network is thus
not necessary and is removed.
Task-number: QTBUG-58614
Change-Id: I6a4ed34ef7d5cba9e55e6fa4f07725bb3c00d795
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
| |
Rather than keeping that state in DeviceManager. DeviceManager can
then independently start fetching for new devices instead of keeping a
queue for them.
Change-Id: I0db131a84eec94aef473fb1a7bca2aa20be3d6d9
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
| |
Change-Id: Ia12faec41ef2bff6b2238848babaf68deea2a822
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This works around getting the correct serial number prepended with
U+033A (COMBINING INVERTED BRIDGE BELOW). That character does not seem
to be present when the serial is set up in the qdbd-init.sh script and
it is not read by HandshakeExecutor either.
This assumes serial numbers shouldn't have non-ASCII and don't have
question marks.
Change-Id: I133a76020b2ea42a12338485a45fce2679895845
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than directly creating the Connection inside
DeviceInformationFetcher, get it from a ConnectionPool that gives an
existing connection if there already is one to the device.
Change connections to close upon destruction. They will be closed once
last shared pointer gotten from ConnectionPool destructs.
Change-Id: I44d4b11d71f8b3c5488fdb52266608bfee69c644
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously a zero-length read was raised as a sign of error every 5
errors. However this meant reams of errors and invalid messages being
sent if a Connection was active to the device while it was unplugged.
The first invalid message is sufficient, since Connection will reset in
response.
Change-Id: I44cd5e90edf84aee1680f1852b637c0c2b590b2e
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The streams were only destroyed, not closed. This meant that ongoing
Services would have a dangling pointer.
Also only reset the connection once in response to Invalid messages.
Change-Id: I35ccb149986a76ee9abf9182923ee40bd5174373
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Install targets were gated on unix, so nothing intended was actually
installed on Windows.
One would be excused to think that there's no need to install a static
library that has already been linked with the executable. However, the
tests streamtest and servicetest link against the library as well. In
Coin they are built in a separate machine and only have the source and
the installed components available. Thus not installing the static
library means that those tests will fail to find the library.
Via qt_parts.prf we included qt_example_installs.prf which created an
nmake target that attempted to install the qmake files used in the
project. The destination path for installing them was malformed, since
it was created by concatenating two absolute Windows paths.
Because the path contained ':', it led to an error message "The filename,
directory name, or volume label syntax is incorrect.".
Change-Id: Idab40e3647de863a7b8ab47ff9b42b8990ed52ae
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously it was a shared library, but the symbols were not exported
properly, which meant that trying to use them lead to linker failures
when using MSVC.
This was previously worked around by including the files a second time,
so remove those workarounds.
Change-Id: Ieafd066c5a3924573cd5e6e397a0e544a35564b3
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
| |
Some places were setting directly the contents of LIBS, which overwrote
the libusb configuration, so instead append in those places. (And all
the other places for consistency.)
Change-Id: I8177a863a8b866f3e19fb5207e73082ea86352c5
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
| |
This allows proper errors if mismatching versions of client and
hostserver are running.
Change-Id: I4b13e52d6b410cedc8a2a99ae94be77082b113da
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
libusb may also access devices other than QDB devices and at least on my
Windows machine fetching the USB config descriptor for two of those
fails. Those devices will be ignored. This case would only be critical
if it happened to a QDB device, so warning level seems appropriate.
This still means warning for each such device on every polling interval.
Change-Id: I0ea36206f275296bde18ea66e3519333b73d6670
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
| |
There is no support for multiple versions, but the behavior changes in
this commit should allow adding that in the future. Device responds with
a new Refuse message, if it does not support the requested version.
Change-Id: I8a747654edb1c6efab485808b2692cd9689bd100
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Derive the version information with git-describe. It will use tags (once
they exist) as a reference, but always includes (an abbreviated version)
of the SHA1 so that finding the exact version is easy.
Also show the used Qt version.
A caveat is that since qmake is used, version is only updated after
qmake is run and mains are compiled. This should not be a problem for
real releases, since they will be built clean.
Change-Id: I59e32f99c30a957d624eff0cf04a927328a08212
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
| |
Uniform initialization bug.
Change-Id: I74d33a81124f32413d4a2080d29e718055ea9f34
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
| |
Also use qFormatLogMessage so that QT_MESSAGE_PATTERN is taken into
account in host server's own log message handler.
Change-Id: I2ae6f70021cbe1ce4cd31ed599bbcc5035081b12
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
| |
A new qdb subcommand `qdb watch-devices` gives a stream of new device
information and notifications about disconnected devices.
Change-Id: Ib79546e11360907905f721c74e2f623960899423
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
| |
Previously only one client at a time could connect via QLocalSocket to
the host server. Now a HostServlet is created to serve each client.
Change-Id: I885e068495d505676d5dcb7556b507efb642074c
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
| |
Previously reading errors in UsbConnection were not propagated further
up the stack. Single errors are still not, since there has been
some (apparently harmless) cases of that.
Change-Id: Iba04fc4d3bcda9902c74b81f439d1fa7d22d1a92
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Log to a file from the host server process. This can be prevented by
setting the environment variable QDB_LOGGING_TO_CONSOLE=1.
Add `qdb stop-server` for shutting down a host server process.
Task-number: QTBUG-56070
Change-Id: Ie6455c7a2517df90a3e7c42f0256cbbdd31b6cff
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Looking for inserted and removed devices is done by polling once a
second. libusb hotplug events are not used since they are not supported
on Windows and not available in the libusb version in RHEL 7.2.
If the IP address is not available for the device on the first check,
the device will be checked again after a short delay until the
information is complete. In the meanwhile the incomplete information is
exposed to the client when asked.
Parts that use libusb were moved from libqdb to the host part, since
they are only used on the host.
Task-number: QTBUG-56067
Change-Id: I0cfbd3659001982609a7d4a77cb1266a7dc6ce8c
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|
|
The two parts live in the same qdb binary. They communicate over
QLocalSocket. Other users of host QDB functionality (like QtC QDB
plugin) are intended to communicate over the local socket also.
For now the server only lists the devices when asked for by the client.
It can also handle only one client and one request at the same time.
Only listing the devices, getting information from them and configuring
the host network are necessary according to the current plans for QDB.
Hence file transfer and running processes on the device were not
converted to new architecture and are removed.
Task-number: QTBUG-56067
Change-Id: I1a49d346c755ef00e332c4fcbed2352486728e6a
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
|