102 Commits

Author SHA1 Message Date
37478a9c00 add return to faile_message, avoid segment fault
should not use response_topic when calloc failed
2024-04-02 10:48:45 +02:00
726e5f2fce fix: Minor warning of unused variable
In case of hardcoded id mac array was unused.
2024-03-28 14:16:34 +01:00
5e3abd4b8c fix: Cover the case for SOC without MAC address
We need to cover for the case where the available MAC isn't defined in
soc caps. E.g. A new target is being introduced but the support isn't
complete yet.
2024-03-28 12:40:07 +01:00
37cb056c5f Merge branch 'feature/atomic_state' into 'master'
Make state and size atomic

See merge request espressif/esp-mqtt!199
2024-03-22 15:26:15 +08:00
657a2aea77 fix: Make automatic client_id soc dependent
When creating the client_id for user, the library uses the device MAC.
For some of our devices WIFI isn't available and the library needs to select
a different MAC to use.
2024-03-14 07:31:37 +01:00
891380bdf5 feat: Make state and size atomic
This makes the mqtt client state atomic to reduce the scope of locking in
some parts of the code.
2024-03-12 08:49:36 +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
00ee059bf8 fix: Uses caps allocation for data buffer instead of item struct
Once introduced the memory destination for outbox was incorrectly
allocating the outbox data structuture instead of data buffer to the
selected memory.
2023-09-13 08:04:38 +02:00
a3b04f2d0a fix: LOG format strings
Fix log format strings and remove no-format warning configuration.
2023-06-30 10:17:32 +02:00
6c849c62ef Fix: Allocation for connection buffer was incorrectly done.
By mistake calloc parameters were incorrect.
2023-06-21 08:24:46 +02:00
aee82c7ba8 Merge branch 'bugfix/outbox_init_failure' into 'master'
Fix: Outbox was leaked in case of initialization failure

See merge request espressif/esp-mqtt!180
2023-06-14 21:46:04 +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
5d491a45ce Fix: Outbox was leaked in case of initialization failure
If the the list allocation fail, outbox must be freed.
2023-06-14 13:36:42 +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
21a5491d53 Removes unused outbox functions. 2023-06-13 11:56:11 +02:00
122875bf8a refactor: Group access to output buffer in mqtt_connection_t
- Moves mqtt_connect_info to mqtt_connection_t.
  - Removes outbound_message in favor of accessing it trough connection.
2023-06-13 11:56:05 +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
da6d38a17e Removes pending message count
The information was used only to log remaining messages on debug log.
It was checked on writing but updated prior to every call making the
verification meaningless.
2023-04-21 08:40:12 +02:00
2c71f9e69b feat: Adds a configuration for outbox data destination
Allow user to move outbox data to external SPI RAM.
2023-04-12 08:43:40 +00: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
2fa945d0b8 Adds Kconfig option to configure poll read timeout
A new Kconfig option was added to allow users to configure poll read
timeout.

Closes: https://github.com/espressif/esp-mqtt/issues/245
2023-02-02 20:52:02 +08:00
ed76036744 mqtt5: Fix flow control will regard the DUP packet and not consider PUBCOMP packet
Closes https://github.com/espressif/esp-mqtt/issues/243
2023-01-18 14:16:28 +08:00
f80772b8d7 Bugfix: Remove Remove possible null pointer dereferences
- Removed a possible derefrence on data in case of MQTT5 SUBACK with
  MQTT5 disabled.
- Covered a case of NULL data on message with negative size.
- Use correct type on calloc for alpn_protos
- Changed strcasecmp to strncasecmp.
2022-12-15 13:02:46 +01:00
fb42588a03 Fix the default configuration for event queue
- Event queue should be disabled, making it an opt-in feature.
2022-11-23 20:40:31 +08: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
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
89e5c6014f fix: MQTT tick not starting on connect and switch to esp_timer
- Tick should be updated on connect
- Dependency of system timer removed to avoid issues when updating via
  SNTP

Closes https://github.com/espressif/esp-mqtt/issues/225
2022-06-23 12:43:58 -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
f6caaff254 Fix WSS default port selection through menuconfig.
Evaluate the correct define to select default port.

 - Closes https://github.com/espressif/esp-mqtt/issues/223
2022-05-17 07:16:07 +00:00
2c2e6f38b5 Changes the moment we update keepalive_tick.
In order to keep sending keep alive messages in the scenario were client
publish too often with QoS0 the keepalive is updated when the response
is received.
2022-04-07 09:14:03 -03:00
fb3184cc14 Make the mqtt submodule logging tags lower case 2022-04-04 10:33:06 +02:00
f83d2a9111 remove unused variable 2022-03-04 07:42:25 +00:00
1a96ea3efa Replaced esp_system.h inclusion with esp_random.h and esp_mac.h
Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
2022-01-17 15:33:11 +01:00
df8dc92870 Client: Fix use esp_mqtt_client_enqueue API to send data, data dup flag will be set 1 2021-11-26 15:52:04 +08: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
ebef896b00 Removes unnecessary outbox_cleanup
The states that were cleaned by this function, CONFIRMED, are no longer reachable.
Itens were marked with this status previously in PUBCOMP and PUBREL
receive handlers.
2021-07-01 14:40:45 +01:00
1a94efe8b9 outbox: Cleanup all items when connection closes 2021-06-24 06:31:29 +02:00
eec6f0e17d Removes unused defines.
- mqtt_config.h had some defines that were not used. This removes them.

Closes https://github.com/espressif/esp-mqtt/issues/194
2021-05-31 13:29:25 +01:00
ff8e64839a mqtt_outbox: Use STAILQ_FOREACH for outbox_delete_single_expired
For the delete one entry and return case, no need to use STAILQ_FOREACH_SAFE.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2021-04-20 11:27:42 +08: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
169b6986eb platform: Remove __FILE__ macro from error logs 2021-02-22 18:11:41 +01:00
0213382593 mqtt: Moves mqtt_supported_features to public includes.
- To simplify user code to support multiple IDF versions.

Closes https://github.com/espressif/esp-mqtt/issues/184
2021-01-21 09:49:24 +00:00
3efac7b7fa mqtt_msg: Set zero length username if password is set without username
Some cloud server (e.g. exosite) takes empty username with password.

When password is set without username, the current esp-mqtt implementation will
ignore the username and only set password. This violates MQTT-3.1.2-22 [1].
To address this issue, send zero length username if password is set without username.

[1] MQTT-3.1.2-22: If the User Name Flag is set to 0 then the Password Flag MUST be set to 0.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2021-01-19 08:36:17 +01: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