89 Commits

Author SHA1 Message Date
fa88da5282 Merge branch 'lifetime_clarification' into 'master'
Clarify data that users need to take care of lifetime.

See merge request espressif/esp-mqtt!197
2024-01-26 19:10:50 +08:00
acdb66d5c6 add const char * to esp_mqtt_client_subscribe() generic macros 2024-01-25 15:35:32 +07:00
371f594cce docs: Clarify data that users need to take care of lifetime.
- Adds to field that the mqtt client doesn't copy a note about it.
2024-01-24 09:38:37 +01:00
ea0df31e00 fix: Move buffer initialization to set config
When calling set config message buffers were not affected because the
creation was handled on init.

Closes https://github.com/espressif/esp-mqtt/issues/267
2023-10-25 07:47:05 +00:00
c355e0b5ae docs: Adds missing documentation to outbox configuration. 2023-08-31 22:22:04 +08:00
cb1e6cf218 docs: Clarify keepalive timeout
Adds information on the behavior of the PINGREQ message timeout and some
reasoning behind the choice.
2023-07-11 05:34:46 +08:00
363fbf7dab feat: Add option to bind interface of use
Enable user to set which interface should be used for client network,
allowing client to be binded to the interface selected by user forcing
it to go through the selected interface.

Closes https://github.com/espressif/esp-mqtt/issues/253
2023-06-14 14:48:44 +02:00
372ab7b374 feat: Introduces outbox limit
A memory limit for the outbox can be configured.
User will not be able to publish or enqueue if the new message goes
beyond the configured limit.
2023-06-13 15:59:55 +02:00
ed628098a1 Merge branch 'feature/custom_transport' into 'master'
Add custom transport configuration

See merge request espressif/esp-mqtt!169
2023-06-13 14:30:24 +08:00
a492935951 Removes leftover calls to event_handler
The possibility to add a callback as custom handler was removed from
the client in favor of esp_event. These removes the older alternative
that wasn't possible to use.
2023-06-09 10:44:50 +02:00
6195762d28 Added support to set server common name. 2023-06-08 08:46:41 +02:00
a5c1b441dc feat: Add custom transport configuration
Today there is no way to add a new transport without applying
modifications to the transport list. This impose limitations on the
client usage. Adding the custom configuration we enable user defined
transports.
2023-06-08 06:38:53 +00:00
70cbaca728 Merge branch 'bugfix/cpp_compilation' into 'master'
Fix: Compilation in C++ with multiple subscribe

See merge request espressif/esp-mqtt!171

(cherry picked from commit 88413ec3f27102daa805ae1992dd145b42d4690d)

47da99fb Fix: Compilation in C++ with multiple subscribe
2023-06-01 17:02:05 +08:00
32102558d3 Feature: Enable SUBSCRIBE to multiple topics
- Adds an api for multiple topics on SUBSCRIBE message.

Apply 2 suggestion(s) to 1 file(s)

Removing headers

y
2023-02-03 14:19:24 +01:00
9af5c26045 Adds error code to MQTT_EVENT_SUBSCRIBED in case of failure
- Payload data parsed for error codes. Check only for first filter
  because our subscribe function only handle one topic filter in each
  call.

- Closes https://github.com/espressif/esp-mqtt/issues/233
2022-10-20 13:29:16 +02:00
97503cceb3 client: Add support for user events
Also supporting configurable queue size for the internal event loop.

Closes https://github.com/espressif/esp-mqtt/issues/230
2022-07-29 09:08:52 +02:00
a9a9fe76bf Adds unregister event API
- Added to enable users to unregister event handler.

 Closes https://github.com/espressif/esp-idf/issues/9194
2022-07-28 10:36:24 +00:00
ae53d799da Restructure the client configuration struct
- Groups configuration fields by context.
- Removes user_context in favor of the event loop.
2022-07-13 08:37:20 -03:00
fdf2aeb36f Seperate MQTT5 from MQTT 3.1.1 2022-06-14 09:37:46 +00:00
3d275f42b9 mqtt: Support MQTT5 protocol 2022-06-14 09:37:46 +00:00
e31834c00f Fix documentation of config struct
- Transport selection enum was incorrectly pointed as having precedence
  over URI.

- Added names to unnamed enums and structs on typedefs.

- Reorganize config struct fields grouping fields with related context.
2022-05-02 13:29:39 -03:00
1fd50dd2cb Adds a config flag to allow an empty client id
This commit covers a use case where the user can select to send an
empty user id.
2021-11-01 18:17:29 +01:00
de47f1c341 add payload to MQTT_EVENT_SUBSCRIBE
+ documentation
+ cleanup logging

Closes https://github.com/espressif/esp-mqtt/issues/200
Merges https://github.com/espressif/esp-mqtt/pull/203
2021-10-04 10:38:02 +02:00
e1d5a9402f add qos and dup to MQTT_EVENT_DATA 2021-09-23 18:09:39 +02:00
89894bd0c6 Merge branch 'feature/configurable_retransmit' into 'master'
Add configurable retransmit (GitHub PR)

See merge request espressif/esp-mqtt!110
2021-09-15 18:10:50 +00:00
1b009c840b Config: Add configurable retransmit timeout
sometime user want to configure retransmit timeout due to network or other requirement

Merges https://github.com/espressif/esp-mqtt/pull/199
2021-09-15 18:43:23 +02:00
88f4b8ed50 Reports config conflicts error to the user
- Configuration conflicts were verified, logged but not reported to the
  user.
2021-09-15 15:09:23 +08:00
db13533904 Remove unnecessary parentheses.
- Removed extra parentheses on definition of certificate bundle attach.
2021-06-24 18:35:26 +02:00
78fcf23947 Merge branch 'bugfix/partial_transport_writes' into 'master'
Address partial writes and retain flags

See merge request espressif/esp-mqtt!99
2021-05-26 15:56:08 +00:00
048f12f55f Merge branch 'feature/add_crt_bundle' into 'master'
Added support for certificate bundle

See merge request espressif/esp-mqtt!98
2021-05-26 15:54:21 +00:00
a00a3134c6 Add support for Retain flag in messages posted by events
Closes https://github.com/espressif/esp-mqtt/issues/193
2021-05-24 10:57:37 +02:00
06157be118 Add crt_bundle function pointer to be accessible from esp_mqtt_client_config_t 2021-05-24 10:32:10 +02:00
5b27d1896e Fix: Adds missing field at config struct.
If an user chooses to config broker by hostname it wasn't possible to
 add the path.
2021-05-14 15:57:42 +01:00
1db731f985 Merge branch 'feature/mqtt_unit_test_cleanup' into 'master'
Reduce the includes used in files.

See merge request espressif/esp-mqtt!93
2021-04-07 11:37:00 +00:00
87fcce72c9 Reduce the includes used in all files.
- To reduce the dependencies to the minimal the number of includes was
  reduced.
2021-04-07 10:49:49 +01:00
2f57985c0b esp-mqtt: Added nullchecks for public APIs
Closes IDFGH-4724
Closes https://github.com/espressif/esp-mqtt/issues/185
2021-03-04 18:30:27 +04:00
e2de0f3e3e Publish: Allow for qos=0 messages to be stored using esp_mqtt_client_enqueue()
The API presents a boolean parameter to control storing the qos=0
messages into the internal outbox
2020-12-15 19:43:33 +01:00
2e35d4d4d5 Events: Add new event to report deleted messages from outbox 2020-12-09 10:14:54 +01:00
f44dcb1c26 Config: Add a new option to disable publishing when disconnected
Related https://github.com/espressif/esp-mqtt/pull/177
2020-12-09 10:14:54 +01:00
dc7fd5c0b1 Publish: Add new API to enqueue qos>0 messages
Closes https://github.com/espressif/esp-mqtt/issues/155
2020-12-09 10:14:54 +01:00
f65d5d05db Cleanup public include dirs 2020-12-06 11:26:03 +01:00
8562437c8a mqtt_config: Add config value to disable keepalive mechanism
Added a separate config value to allow disable the keepalive mechanism (and keep the existing API the same)
Internally though, the keepalive value (in connect_info) is in line with 3.1.2.10 Keep Alive from mqtt spec:
* keepalive=0: Keep alive mechanism disabled (server not to disconnect the client on its inactivity)
* period in seconds to send a Control packet if inactive

Closes https://github.com/espressif/esp-mqtt/issues/179
2020-11-18 14:41:44 +01:00
e8be6c3aa7 Merge branch 'feature/add_get_outbox_size' into 'master'
Add esp_mqtt_client_get_outbox_size API

See merge request espressif/esp-mqtt!82
2020-11-18 16:45:27 +08:00
0a1d9d0300 mqtt: Add esp_mqtt_client_get_outbox_size API
Allow application to get current outbox_size.
Application may try to send many publish request for a long period and then
system can hit OOM when publish QoS>1 with a busy borker.
Reduce OUTBOX_EXPIRED_TIMEOUT_MS does not help too much because the publish
freauency depends on the data received in different environment.
i.e. In some environment, sometimes it's easy to hit OOM before reaching OUTBOX_EXPIRED_TIMEOUT_MS.

To avoid such issue, add esp_mqtt_client_get_outbox_size API, so the application
can stop publishing to avoid OOM when outbox takes too much memory.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2020-11-11 17:13:32 +08:00
23c8e1ecf5 error reporting: extended error event to use errno captured in transports
Also renamed error type MQTT_ERROR_TYPE_ESP_TLS to
MQTT_ERROR_TYPE_TCP_TRANSPORT, as the former was confusing and might
have implied the error occurred in TLS layer.

Applicable IDF version >= v4.3

Closes https://github.com/espressif/esp-idf/issues/5906
2020-11-04 08:01:06 +01:00
a03228ac46 Allow to configure network timeout
Merges https://github.com/espressif/esp-mqtt/pull/166
2020-09-02 08:36:01 +02:00
7d8e59de00 mqtt: Add support for Digital Signature (through ESP-TLS)
Digital Signature enables hardware accelerated RSA signature
for TLS handshake.The RSA private key(client key) is also stored in
encrypted format and ecryption key is stored in hardware(efuse) which adds
additional level of security for mutual authentication.
* Digital Signature is only supported for ESP32-S2.

Applicable IDF version >= v4.3
2020-08-18 11:55:43 +05:30
5e17dcaeb2 MQTT: Fix esp_mqtt_client_stop deadlock
esp_mqtt_client_stop would lead to a deadlock (with itself) when called
from the event handler.

Updated comments to reflect that some functions should not be called from
the event handler.

Closes https://github.com/espressif/esp-mqtt/issues/163
2020-08-04 19:26:37 +08:00
a7ff9afa3f esp-mqtt: add support for tls with secure element (ATECC608A)
Closes https://github.com/espressif/esp-mqtt/issues/156
2020-06-25 10:36:58 +05:30
5e8950e681 SSL: add config option for skipping common name check
Closes IDFGH-3408
Closes https://github.com/espressif/esp-mqtt/issues/158
2020-06-09 14:23:40 +08:00