patchlwIP - A Lightweight TCP/IP stack - Patches: patch #10049, Support for binary Will Message

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #10049: Support for binary Will Message

Submitter:  Jiri Findejs <findejs>
Submitted:  Fri 26 Mar 2021 06:21:51 PM UTC
   
 
Category:  apps Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  2.2.1

Fri 29 Sep 2023 08:08:39 PM UTC, comment #2: 

Pushed, thanks for reporting!

Simon Goldschmidt <goldsimon>
Group administrator
Thu 15 Dec 2022 01:27:51 PM UTC, comment #1: 

Yeah, I stumbled upon the same problem. In the Sparkplug protocol (which uses MQTT) the data is sent in binary form, for Sparkplug B it uses ProtoBuf to encode it. MQTT's "will" is used for "NDEATH" message type and is also binary, which means it can include a null byte on any position. With current lwIP MQTT implementation, such binary data that contains a null byte will result in malformed encoding, usually causing all the Sparkplug recipients to go crazy (as MQTT broker doesn't know what format this data has, so it just resends it to all subscribed clients).

Please consider this one for merging to the master branch.

Freddie Chopin <freddie_chopin>
Fri 26 Mar 2021 06:21:51 PM UTC, original submission:  

Hi,

MQTT implementation supports strings for Will Messages, see struct mqtt_connect_client_info_t, field will_msg. The message length is computed in mqtt_client_connect as follows:

len = strlen(client_info->will_msg);


This implementation does not allow sending binary Will Messages, which are supported by MQTT 3.1.1.
The attached patch adds support for binary message with minimal changes to existing API and small impact on the existing code base.
Another option is to change type of will_msg field and make API more clear. Please comment.

Best Regards,
Jiri

Jiri Findejs <findejs>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by freddie_chopin (Posted a comment)
  • -email is unavailable- added by findejs (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-09-29 goldsimon StatusNone Done
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
        Planned ReleaseNone 2.2.1
    2021-03-26 findejs Attached File- Added mqtt-support-for-binary-will-message.patch, #51145

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code