Commit Graph

234 Commits

Author SHA1 Message Date
Laukik Hase
e05d873aa2 Added checks for cleanly-closed connection and timeout
- Related MR: https://gitlab.espressif.cn:6688/espressif/esp-idf/-/merge_requests/16394
2022-06-08 16:12:11 +05:30
David Cermak
9299f5400f Fix implicit malloc/free inclusion
This fails when building on host
2022-06-08 05:16:29 +00:00
Craig Kewley
69b6493423 mqtt_client: fix esp_mqtt_client_enqueue for len=0
Commit 372b323 (mqtt_client: Fix mqtt send long data error, 2021-12-21)
removed the length calculation from esp_mqtt_client_enqueue_priv and
added it to esp_mqtt_client_publish. However, esp_mqtt_client_enqueue
was missed. Currently calls to esp_mqtt_client_enqueue appear to send no
data, fix this by adding the length calculation to esp_mqtt_client_enqueue.
2022-05-30 21:56:33 +01:00
Yuan Jian Min
647e0eff32 feat(mqtt): Optimize mqtt transport list and remove unused transport 2022-05-23 22:19:24 +08:00
David Čermák
59b48a4d49 Merge branch 'bugfix/keep_alive_ping_periodic' into 'master'
Changes the moment we update keepalive_tick.

See merge request espressif/esp-mqtt!127
2022-04-19 22:16:19 +08:00
gabsuren
6b794e4708 MQTT: Fix signature matching for integer values
Closes https://github.com/espressif/esp-idf/issues/8482
2022-04-08 19:56:56 +04:00
Euripedes Rocha
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
AndriiFilippov
fb3184cc14 Make the mqtt submodule logging tags lower case 2022-04-04 10:33:06 +02:00
Darian Leung
6ef98d6510 Client: Remove usage of legacy FreeRTOS types 2022-01-13 00:34:53 +08:00
yuanjm
372b323535 mqtt_client: Fix mqtt send long data error
Closes https://github.com/espressif/esp-mqtt/issues/214
2021-12-21 15:31:56 +08:00
yuanjm
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
Euripedes Rocha
09287a1156 Removes redundant field on mqtt state
Client connection_info was unnecessarilly repeated. Removed from
mqtt_state and kept on mqtt_client.
2021-11-01 18:17:29 +01:00
Euripedes Rocha
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
David Cermak
3f05b1aedc Client: Fix reconnect/disconnect if auto_reconnect=off
Closes https://github.com/espressif/esp-mqtt/issues/206
2021-10-06 17:46:32 +02:00
David Cermak
86e40f8615 Send disconnect message if client asked to disconnect
https://github.com/espressif/esp-mqtt/issues/208
2021-10-06 17:46:32 +02:00
Bert Melis
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
Bert Melis
e1d5a9402f add qos and dup to MQTT_EVENT_DATA 2021-09-23 18:09:39 +02:00
David Čermák
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
David Čermák
1d10608409 Merge branch 'feature/set_config_error_reporting' into 'master'
Reports config conflicts error to the user

See merge request espressif/esp-mqtt!102
2021-09-15 16:46:35 +00:00
Umer Ilyas
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
Euripedes Rocha
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
David Cermak
5b3c81ee48 Config: Fix build issue if WS/WSS transport disabled
Closes https://github.com/espressif/esp-idf/issues/7535
2021-09-10 09:15:41 +02:00
David Cermak
1b71980575 Config: Add error message if certbunde is not enabled
Merges https://github.com/espressif/esp-mqtt/pull/198
2021-09-07 15:42:11 +02:00
fractal-def
4a89bff610 Check CONFIG_MBEDTLS_CERTIFICATE_BUNDLE is set
Fixes a compilation error where `esp_transport_ssl_crt_bundle_attach` is undefined in this scenario.
2021-08-10 15:02:35 -06:00
David Čermák
026ea95338 Merge branch 'remove_outbox_cleanup_function' into 'master'
Removes unnecessary outbox_cleanup

See merge request espressif/esp-mqtt!108
2021-07-09 16:13:48 +00:00
Euripedes Rocha
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
Euripedes Rocha
7471177fe7 Fix: Return an error when fail to enqueue
The functions that enqueue messages didn't had a return for the
handler, with this the error was only logged instead of returned which
may cause the user to have an ID for a message that was not published.
2021-07-01 09:29:58 +01:00
David Čermák
831d25cb56 Merge branch 'update/qemu_test_IDFv4.3' into 'master'
CI: Update QEMU image and test against IDF v4.4-dev (plus minor fixes)

See merge request espressif/esp-mqtt!104
2021-06-24 16:34:31 +00:00
David Cermak
1a94efe8b9 outbox: Cleanup all items when connection closes 2021-06-24 06:31:29 +02:00
David Čermák
c4b7324bd6 Merge branch 'feature/remove_unnecessary_queue_requests' into 'master'
Removes unnecessary calls to outbox_set_pending

See merge request espressif/esp-mqtt!105
2021-06-23 06:46:06 +00:00
Euripedes Rocha
67553aba45 MQTT: Makes abort connection function void.
The function only returned ESP_OK and the call was always ignored.
2021-06-18 17:18:51 +01:00
Euripedes Rocha
36a3990404 Removes unnecessary calls to outbox_set_pending
The call of this function is unnecessary for PUBACK and PUBCOMP,
also the item is deleted on the call of is_valid_mqtt_msg and the
function allways fail.
2021-06-18 14:11:21 +01:00
David Čermák
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
David Čermák
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
David Čermák
ff8226a464 Merge branch 'bugfix/missing_path_field_in_config' into 'master'
Fix: Adds missing field at config struct.

See merge request espressif/esp-mqtt!96
2021-05-26 15:51:45 +00:00
liuhan
8f3cac8c36 Client: Add optimize for depend on ssl 2021-05-24 16:14:02 +02:00
David Cermak
d8c9c7a9e7 Add support for partial transport writes
Partially addresses https://github.com/espressif/esp-idf/issues/6940
2021-05-24 10:58:42 +02:00
David Cermak
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
flohas
06157be118 Add crt_bundle function pointer to be accessible from esp_mqtt_client_config_t 2021-05-24 10:32:10 +02:00
Euripedes Rocha
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
David Čermák
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
Euripedes Rocha Filho
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
suren.gabrielyan
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
David Cermak
001dc1a95e Config: Add missing nullcheck after cfg password allocation
Partially addresses https://github.com/espressif/esp-idf/issues/6440
2021-02-11 15:54:45 +01:00
Euripedes Rocha Filho
369f4207f8 Renames states and add missing handler on task
- The state transition on esp_mqtt_task was missing 2 states
- MQTT_STATE_ERROR removed
- Added a default case for state transition.
- Renamed MQTT_STATE_WAIT_TIMEOUT -> MQTT_STATE_WAIT_RECONNECT
2021-01-27 17:33:22 +00:00
David Čermák
a74adfa9eb Merge branch 'client_init_refactor' into 'master'
Clean client init

See merge request espressif/esp-mqtt!87
2021-01-21 15:57:52 +08:00
Euripedes Rocha Filho
e05ed2ce18 mqtt: Clean client init
- Moves check and copy of parameter to a function to reduce repetition
- Removes cfg variable to be explicit about what is being modified.
2021-01-19 11:54:09 +00:00
Euripedes Rocha Filho
b834be80a5 mqtt: Makes esp_mqtt_destroy_config void
- Makes the function a nop in case of NULL config.
2021-01-18 11:42:59 +00:00
David Cermak
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
David Cermak
2e35d4d4d5 Events: Add new event to report deleted messages from outbox 2020-12-09 10:14:54 +01:00