Commit Graph

28 Commits

Author SHA1 Message Date
Euripedes Rocha
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
Euripedes Rocha
6c849c62ef Fix: Allocation for connection buffer was incorrectly done.
By mistake calloc parameters were incorrect.
2023-06-21 08:24:46 +02:00
Euripedes Rocha
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
Euripedes Rocha
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
Euripedes Rocha
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
Euripedes Rocha
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
Anton Maklakov
f83d2a9111 remove unused variable 2022-03-04 07:42:25 +00: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
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
Axel Lin
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
David Cermak
8bb4a26f46 Config: Add a new option to use incremental message id
This option is off by default, so the client still uses
random message id unless CONFIG_MQTT_MSG_ID_INCREMENTAL is set

Closes https://github.com/espressif/esp-mqtt/issues/176
2020-12-09 10:12:57 +01:00
Angus Gratton
b9db8d9020 Use size_t for all lengths
Previously, uint32_t and size_t were used interchangeably. These types are
interchangeable on Xtensa gcc (uint32_t == size_t == unsigned int), but not on most
other 32-bit gcc architectures (where uint32_t == unsigned long, size_t ==
unsigned int).
2020-10-09 16:33:12 +11:00
David Cermak
7087193093 mqtt_msg: address const correctness 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
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
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
David Cermak
18b6f2c582 Fixed formatting for all files to comply with idf style formats 2019-05-15 13:40:14 +02:00
David Cermak
60cdb79a67 mqtt_msg: avoid uncasting const to mqtt topic and data pointers 2019-05-15 13:40:14 +02:00
João Cabral
db71c753aa FIX: mqtt_get_id wrong logic on msg size checks.
This error was preventing the function from returning the right msg ID,
returning always 0.
2019-05-15 13:40:14 +02:00
David Cermak
35fc42d2b9 mqtt_msg: added missing message type for unsubscribe msg type
Closes #109
2019-05-06 11:23:35 +02:00
David Cermak
fd564b1f17 client receive: refactor receive to read only one message to fragment only payload for longer messages
Closes #113
2019-05-06 11:23:28 +02:00
Gregory Eslinger
0450bd0093 MQTT Client: Added support for receiving empty payload 2019-04-26 17:07:04 +02:00
David Cermak
e0bbbebc08 mqtt support for sending fragmented messages and full mqtt message length support 2019-01-03 09:14:34 +01:00
Christian Gawron
4bc37bb8db fix handling of large messages (#40) 2018-05-03 20:46:06 +07:00
Tuan PM
c06c24a947 fixed default protocol is 3.11 2018-03-01 22:30:15 +07:00
Tuan PM
083f8789ac Add support outbox, changed API 2018-02-16 02:40:16 +07:00