aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Hide the API of QCoapProtocolSona Kurazyan2019-05-141-0/+1
| | | | | | | | No need to keep this class public, there is no public API for accessing it anyway. Change-Id: I231a560becb5799667819c30eca6372282adeb41 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Hide the APIs of QCoapConnection and QCoapQUdpConnectionSona Kurazyan2019-05-142-12/+35
| | | | | | | | | | | | At the moment only the QCoapQUdpConnection class implements the QCoapConnection interface. If later we decide to add other implementations, and it turns out that the current API is not good enough, it won't be possible to change it without breaking the source compatibility. Let's make these classes private, we can make them public when there is a need for it. Change-Id: I41336dda0e6eaa762f0eb9c8f4aa98a9c7b62a2c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove the "Error" ending from QtCoap::Error enum value namesv5.13.0-rc3v5.13.0-rc2v5.13.0-rc1v5.13.0-beta4v5.13.05.13.0Sona Kurazyan2019-05-032-7/+7
| | | | | | | | | | | | | QtCoap::Error is a scoped enum class, so its value names will get the "Error::" prefix anyway. No need to have it as a suffix for the value names. For the same reason replaced QtCoap::Error::NoError by QtCoap::Error::Ok. Change-Id: Iaf7b51cdab6ea330e940e5af73ba93a55eb48315 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Use scoped enumsSona Kurazyan2019-05-037-102/+113
| | | | | | | | | | | Execptions are made for QCoapOption::OptionName and QtCoap::Port enums, because the values of these types are not limited only to the values listed in the enums. In case of using custom values, it would be more convenient to use integers directly, instead of using a static_cast each time the user needs a custom value. Change-Id: Ibc63e26c59629702c03528dd7e5e5eedc6bcc90a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add an API for closing the connection's transportSona Kurazyan2019-04-252-0/+26
| | | | | | Change-Id: I916ddb226b653aaf563ecf0adc3a1110d6da3132 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Hide the API for sending byte array requestsSona Kurazyan2019-03-201-0/+4
| | | | | | | | | | | Users should not be able to send "manually" constructed requests with raw byte array data. Only QCoapProtocol knows how to correctly construct/send coap messages and make the proper signal/slot connections. Change-Id: I8fd64638ea7f8e7b20671b80e6db4e1a7758c4fa Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add the sender address to responses for a multicast requestSona Kurazyan2019-03-111-16/+27
| | | | | | | | | | | For the responses to multicast requests the address of the sender of the reply does not match with the host address in the request URI. There should be a way to find out who has sent the response. Change-Id: Icbc6c6ae926198870dbc7dbbb92dc319c46d7de7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Hide APIs for specifying the request methodSona Kurazyan2019-03-114-36/+23
| | | | | | | | | | | | Since the request method is set anyway when sending a request (get, put, post, etc.), allowing users to specify the request method is fatuous (it will be overridden anyway when sending the request). Change-Id: Ibf079bd513f145c791d5d703aa5685bfe66dda7d Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fix URL adjustment for URLs with no schemev5.13.0-beta1Sona Kurazyan2019-03-061-0/+8
| | | | | | | | | Prepend the "scheme://" part a to URL only if it is relative and doesn't have a host. Non-relative URLs having a host already contain the "://" part. Change-Id: If2ac3db4f2eb0d18ffa1893415f44b9d2c85db26 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move resourcesFromCoreLinkList() where it fits betterSona Kurazyan2019-03-061-2/+3
| | | | | Change-Id: I930f53462598fd7019da2144ddf1bf04dc5930c8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add support for multicast CoAP requestsSona Kurazyan2019-02-212-0/+119
| | | | | | | Change-Id: I9cf6d4f97c863c232b17bc8e560c6b62c3f39624 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Make sure that URLs are adjusted when sending requestsSona Kurazyan2019-02-061-0/+13
| | | | | | Change-Id: I53972747a57082e11b923caca8e816bca0347f0b Reviewed-by: Adrien Leravat <aleravat@witekio.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Add DTLS support to CoAP implementationv5.13.0-alpha1Sona Kurazyan2019-01-305-44/+88
| | | | | | | | | | | | | | | | | | | | | | | | | Added transport layer security based on QDtls. This implementation supports authentication using pre-shared keys and X.509 certificates. Split the QCoapConnection class into a base class to be shared with other transports and a specialized class that relies on QUdpSocket using QDtls for security. Note, that raw public key mode (which is mandatory to implement according to RFC) is not implemented yet, since the underlying OpenSSL library does not support it yet. However, if we later decide to integrate another DTLS implementation, it can be done with minimal changes, by having the new implementations's connection type inherit the QCoapConnection class, which hides the implementation of the transport layer. Tests and examples will be added in a later commit. Change-Id: I14b34a9fd978e1993e86d47becbeed74397d1d6e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Improve QCoapMessage and corresponding testsSona Kurazyan2018-12-212-17/+220
| | | | | | | | | * Add possibility to retrieve multiple options with the same option name * Add more tests for QCoapMessage Change-Id: Ib5ccb45633488e7654427d7513835502f8011257 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Fix review comments left from the initial commitSona Kurazyan2018-12-202-4/+4
| | | | | | | | | Added some minor improvements and fixes for review comments from the initial commit. Change-Id: Ic3b36118262660c110ccf7ef2209a25208703ab7 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Add the CoAP module, providing a client for QtAdrien Leravat2018-12-1424-0/+2270
Features: - Send GET/POST/PUT/DELETE requests - Discover resources (single server) - Observe resources and cancel the observation - Blockwise requests and replies - Requests (and replies) can be confirmable or non-confirmable - Some options can be added to the request - Replies can be received in a separate or piggybacked message Change-Id: I31e0e20a4f19bdc6d6489281fde73a4ff848eda4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>