Commit Graph

352 Commits

Author SHA1 Message Date
David Cermak
bbcf078a2b fix possible double free of client config if init fails 2020-01-29 08:25:05 +01:00
David Cermak
ed90a64551 client: queued oversized messaged even if not connected 2020-01-29 08:25:05 +01:00
David Cermak
f7941e29be mqtt_outbox: fixed outbox_destroy() to correctly delete all queued messages
Closes https://github.com/espressif/esp-idf/issues/4643
Closes IDFGH-2558
Closes https://github.com/espressif/esp-mqtt/issues/148
Closes IDFGH-2599
Closes https://github.com/espressif/esp-mqtt/issues/147
Closes IDFGH-2598
2020-01-29 08:22:52 +01:00
David Cermak
3a47e3abae client locking: used recursive mutex instead to avoid getting the code too complex 2020-01-27 12:26:10 +01:00
David Cermak
9eca3f6db9 mqtt_client: set_config to update ssl-transport configuration
closes https://github.com/espressif/esp-mqtt/issues/146
closes IDFGH-2534
2020-01-25 22:24:00 +01:00
David Cermak
7087193093 mqtt_msg: address const correctness 2020-01-25 21:57:02 +01:00
David Cermak
89a0c1fc95 removed examples from the submodule
Valid and tested examples are always in esp-idf. these examples were for reference and might and have coused some confussion
2020-01-25 21:57:02 +01:00
David Cermak
6e08f6a04f mqtt_outbox: fix to store timestamps in long-long format
closes https://github.com/espressif/esp-mqtt/issues/144
closes IDFGH-2491
2020-01-25 21:57:02 +01:00
David Čermák
8ab095b5bb Merge branch 'feature/protocol_ver_rt_cfg' into 'master'
MQTT: Add runtime selection of mqtt protocol version

See merge request espressif/esp-mqtt!54
2020-01-20 16:41:55 +08:00
David Čermák
616fa257fb Merge branch 'feature/large_buffers' into 'master'
Support larger buffers and messages

See merge request espressif/esp-mqtt!56
2020-01-17 17:15:10 +08:00
Marius Vikhammer
7ac0a42831 MQTT: Add runtime selection of mqtt protocol version
Add config option for selecting protocol version at runtime.

This also fixed MQTT protocol version 3.1 which wasnt working with the original implementation

Closes https://github.com/espressif/esp-idf/issues/4448
Closes IDFGH-2311
Closes IDF-1320
2020-01-09 14:49:33 +08:00
Rohan Singh
ab1e8d7969 Support larger buffers and messages
Use `uint32_t` instead of `uint16_t` for message and buffer lengths.
This is necessary for receiving messages that are larger than 65K.
2020-01-08 15:00:10 -05:00
David Čermák
86fc8b7584 Merge branch 'feature/support_clientkey_password' into 'master'
add support for password protected client-key

See merge request espressif/esp-mqtt!53
2020-01-09 02:57:30 +08:00
David Cermak
2684ed413d add support for password protected client-key 2020-01-08 09:05:18 +01:00
David Čermák
f74fe3d887 Merge branch 'bugfix/jira_workflow' into 'master'
fix sync issues and pull requests to jira

See merge request espressif/esp-mqtt!52
2020-01-06 14:59:05 +08:00
David Cermak
acc91bacf3 fix sync issues and pull requests to jira 2020-01-03 08:11:00 +01:00
David Čermák
057f140228 Merge branch 'bugfix/fix_connect_timeout' into 'master'
waiting for entire connack message with configured network timeout

See merge request espressif/esp-mqtt!50
2019-12-23 15:57:16 +08:00
David Cermak
97f91eda5c wait for the entire connack message with the configured timeout
Configured network timeout was used to receive separate characters
in the message. This change waits for the configured timeout if reading
the mqtt packet was left in progress (mqtt_message_receive() returns 0)

Closes FCS-254
2019-12-23 07:54:59 +01:00
David Čermák
716b8625ba Merge branch 'feature/qemu_tests' into 'master'
ci: added job with publish tests on qemu

See merge request espressif/esp-mqtt!51
2019-12-23 14:52:47 +08:00
David Cermak
b25077a338 ci: add pushlish weekend tests to all pipelines (running on qemu) 2019-12-19 10:58:58 +01:00
David Čermák
99586c2768 Merge branch 'bugfix/event_handler_mem_leak' into 'master'
Fixed bug where the event loop wouldn't get cleaned up during destroy.

See merge request espressif/esp-mqtt!49
2019-12-04 18:50:43 +08:00
Marius Vikhammer
17e2f68e43 Fixed bug where the event loop wouldn't get cleaned up during destroy.
The event loop would never get deleted due to the event loop handle being
cleared to 0 before checking if it exists.

Closes https://github.com/espressif/esp-idf/issues/4433
Closes IDFGH-2293
2019-12-04 11:12:17 +08:00
David Čermák
9a5187771a Merge branch 'bugfix/publish_before_connect' into 'master'
Fixed crash due to publishing before successful transport connect.

See merge request espressif/esp-mqtt!48
2019-11-23 03:39:59 +08:00
David Cermak
e8bb0bcf6f ci: fixed ci build with latest idf using up to date compiler 2019-11-22 20:29:13 +01:00
Marius Vikhammer
9ca997d2d4 Fix potential memory leak if failing to create mutex
Closes https://github.com/espressif/esp-idf/issues/4384
Closes IDFGH-2235
2019-11-22 20:28:45 +01:00
Marius Vikhammer
9655845fdc Fixed crash due to publishing before successful transport connect.
Initialization of the outgoing message buffer is now done during mqtt_init,
which means messages can be queued before the first connection is made.

The client now checks for fail_message after creating a message, and cancels
the current operation if this happens. Updated error handling in client_publish
to be more inline with API documentation.

Closes https://github.com/espressif/esp-idf/issues/4349
Closes https://github.com/espressif/esp-mqtt/issues/140
2019-11-22 20:28:45 +01:00
David Čermák
1cd0885611 Merge branch 'feature/alpn_support' into 'master'
Add support for ALPN

See merge request espressif/esp-mqtt!46
2019-11-20 21:06:48 +08:00
Marius Vikhammer
e1ab64f0d8 Add support for ALPN
Closes IDF-1162

Closes https://github.com/espressif/esp-mqtt/issues/137
2019-11-20 17:30:58 +08:00
David Čermák
c1766c0f56 Merge branch 'feature/configurable_recon_time' into 'master'
Add reconnect time as a configurable parameter.

See merge request espressif/esp-mqtt!47
2019-11-20 17:12:45 +08:00
Marius Vikhammer
3da472fd37 Add reconnect time as a configurable parameter.
Closes IDF-1126
2019-11-18 14:43:44 +08:00
David Čermák
566b034984 Merge branch 'bugfix/err_event_mqtt_related' into 'master'
ADD: Get the response code from a failing connection.

See merge request espressif/esp-mqtt!41
2019-10-17 19:00:21 +08:00
David Cermak
e3b013e2db Extended error structure to be used in mqtt library and include mqtt
specific errors.
Corrected typos in comments and log messages
2019-10-09 11:22:02 +02:00
João Cabral
67042a1315 ADD: Get the response code from a failing connection.
This commit adds an event information "connect_return_code" that is written
when the client state is MQTT_STATE_INIT, and the connection fails.

This event info can then be written by the user app to find out the reason
of the fail connection.

Merges https://github.com/espressif/esp-mqtt/pull/100
2019-10-09 09:23:53 +02:00
David Čermák
430676cadb Merge branch 'bugfix/early_retransmit' into 'master'
Fix early retransmit

See merge request espressif/esp-mqtt!44
2019-10-03 20:21:56 +08:00
Marius Vikhammer
52cdfa9087 Fix early retransmit
The time for retransmitting a message was set before transfer was done. This ment that if the transfer speed is slow or the message is big then it would be possible to trigger a retransmit too early.

Closes https://github.com/espressif/esp-mqtt/issues/131
2019-10-03 14:03:32 +02:00
David Čermák
40302a3d43 Merge branch 'bugfix/pulished_events_not_posted' into 'master'
MQTT: fix MQTT_PUBLISHED_EVENT not always being posted

See merge request espressif/esp-mqtt!43
2019-10-03 19:58:36 +08:00
Marius Vikhammer
3e35fc8323 MQTT: fix MQTT_PUBLISHED_EVENT not always being posted
- Some PUBLISHED events would not be posted due to outbox messages being deleted before receiving PUBCOMP.
 - Current pending_message is no longer used to check for acknowledgements, as it doesn't work with multiple or out of order messages.

Closes https://github.com/espressif/esp-mqtt/issues/132
2019-10-03 13:28:51 +02:00
David Čermák
78e2a7050e Merge branch 'bugfix/mqtt_docs_fix' into 'master'
docs: Updated publish message return code to make it clear that message_id is always 0 for QoS 0

See merge request espressif/esp-mqtt!42
2019-10-03 19:25:47 +08:00
David Čermák
d01c77f70b Merge branch 'feature/error_check_for_null_msgs' into 'master'
Error checks for sending null messages

See merge request espressif/esp-mqtt!39
2019-10-03 19:14:36 +08:00
David Čermák
59b228e0ad Merge branch 'bugfix/err_report_on_publish' into 'master'
Fix not dispatching MQTT_EVENT_ERROR

See merge request espressif/esp-mqtt!40
2019-10-03 17:58:15 +08:00
David Cermak
9fbd7d9244 docs: Updated publish message return code to make it clear that message_id is always 0 for QoS 0
Closes https://github.com/espressif/esp-mqtt/issues/127
2019-09-30 08:05:51 +02:00
Laurent Louf
2e0e93a2d3 Add a check when publishing data to be able to publish a message without data without crashing.
Signed-off-by: Marius Vikhammer <marius.vikhammer@espressif.com>

Merges https://github.com/espressif/esp-mqtt/pull/117
2019-09-24 18:25:55 +08:00
Laurent Louf
2b04d177c7 Add a check when publishing data to verify that if some data length is set, data pointer cannot be NULL, in which case an error is returned.
Signed-off-by: Marius Vikhammer <marius.vikhammer@espressif.com>
2019-09-24 18:24:52 +08:00
Matias
176be08f75 Fix not dispatching MQTT_EVENT_ERROR
If a publish failure ocurred, MQTT_EVENT_ERROR was not delivered to handler set with esp_mqtt_client_register_event
2019-09-14 21:16:31 -03:00
David Čermák
04253b2b07 Merge branch 'featrue/enable_global_ca_store' into 'master'
client: added config option to enable global ca strore

See merge request espressif/esp-mqtt!38
2019-08-30 22:40:14 +08:00
David Cermak
0234f6e538 client: added config option to enable global ca strore
closes https://github.com/espressif/esp-mqtt/issues/125
2019-08-23 14:33:35 +02:00
David Čermák
1134cb234c Merge branch 'feature/support_der_certs' into 'master'
Feature/support der certs

See merge request espressif/esp-mqtt!37
2019-08-23 02:30:58 +08:00
Henning Fleddermann
9a56cc7e14 add der-format support for tls-certificates/keys 2019-08-22 15:11:49 +02:00
David Čermák
54c0161481 Merge branch 'feature/mqtt_use_new_event' into 'master'
MQTT uses new event

See merge request espressif/esp-mqtt!34
2019-08-21 17:20:26 +08:00
liu zhifu
fb3d2107cd MQTT examples use new event 2019-08-16 16:15:54 +08:00