summaryrefslogtreecommitdiffstats
path: root/qdb
Commit message (Collapse)AuthorAgeFilesLines
* Add version field to JSON messages on the hostKari Oikarinen2016-12-224-101/+150
| | | | | | | | This allows proper errors if mismatching versions of client and hostserver are running. Change-Id: I4b13e52d6b410cedc8a2a99ae94be77082b113da Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
* Downgrade failure to fetch config descriptor to a warningKari Oikarinen2016-12-221-10/+16
| | | | | | | | | | | | 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>
* Handle host-device version mismatches forward-compatiblyKari Oikarinen2016-12-224-11/+85
| | | | | | | | | 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>
* Add --version optionKari Oikarinen2016-11-242-0/+4
| | | | | | | | | | | | | | | 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>
* Fix build error with GCC 4.8Kari Oikarinen2016-11-231-2/+1
| | | | | | | | 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>
* Categorize loggingKari Oikarinen2016-11-2315-117/+148
| | | | | | | | 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>
* Add command for watching for plugged and unplugged devicesKari Oikarinen2016-11-228-50/+305
| | | | | | | | 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>
* Allow concurrent clients in the host serverKari Oikarinen2016-11-225-79/+214
| | | | | | | | 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>
* Handle USB reading errors betterKari Oikarinen2016-11-217-21/+46
| | | | | | | | | 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>
* Start host server automatically from qdbKari Oikarinen2016-11-219-23/+306
| | | | | | | | | | | 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>
* Handle plugged and unplugged USB devicesKari Oikarinen2016-11-0720-87/+1152
| | | | | | | | | | | | | | | | | | 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>
* Split host QDB into client and server partsKari Oikarinen2016-11-0718-0/+1836
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>