Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary LWT message #167

Closed
fpagliughi opened this issue Aug 23, 2016 · 5 comments
Closed

Binary LWT message #167

fpagliughi opened this issue Aug 23, 2016 · 5 comments
Assignees
Milestone

Comments

@fpagliughi
Copy link
Contributor

fpagliughi commented Aug 23, 2016

Why does the C library only allow for a text LWT message payload, through a const char* message instead of a const void* payload and corresponding payload length? Does the MQTT standard prevent you from using a binary LWT payload?

@guilhermeferreira
Copy link
Contributor

According to the MQTT v3.1 protocol specification [http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html] the Will Message "is UTF-8 encoded [character string] in the CONNECT message [...] The message must therefore only consist of 7-bit ASCII characters."

But, to me, the MQTT v3.1.1 Protocol [http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/mqtt-v3.1.1.html], section 3.1.3.3, is not very clear : "The Will Message defines the Application Message that is to be published to the Will Topic [...] This field consists of a two byte length followed by the payload for the Will Message expressed as a sequence of zero or more bytes. The length gives the number of bytes in the data that follows and does not include the 2 bytes taken up by the length itself."

If the v3.1.1 description says the same thing as the v3.1, then its correct to define it as const char*. However, if the v3.1.1 allows arbitrary bytes, then I guess it should be const unsigned char*, right?

Anyone with a deeper understand of the protocol could clarify this?

@guilhermeferreira
Copy link
Contributor

There is another issue open for the same problem, #34.

@icraggs icraggs added this to the 1.2 milestone Apr 4, 2017
@icraggs icraggs self-assigned this Apr 4, 2017
@icraggs
Copy link
Contributor

icraggs commented Apr 5, 2017

I'll add the ability to send binary LWT payloads, as well as passwords (PR #159). "Zero or more bytes" means that any data should be able to be sent.

icraggs pushed a commit that referenced this issue Apr 6, 2017
Squashed commit of the following:

commit 907b9ec
Author: Ian Craggs <icraggs@uk.ibm.com>
Date:   Wed Apr 5 23:33:44 2017 +0100

    Use binary passwords in tests

commit 3930b18
Author: Ian Craggs <icraggs@uk.ibm.com>
Date:   Wed Apr 5 17:15:29 2017 +0100

    Binary MQTT password support

commit 4abe6a9
Author: Ian Craggs <icraggs@uk.ibm.com>
Date:   Wed Apr 5 16:13:18 2017 +0100

    Fix test config

commit e742ed1
Author: Ian Craggs <icraggs@uk.ibm.com>
Date:   Wed Apr 5 15:46:53 2017 +0100

    Async binary will message

commit 9313e66
Author: Ian Craggs <icraggs@uk.ibm.com>
Date:   Wed Apr 5 11:50:10 2017 +0100

    Binary will message support, take 2

commit 5cf5485
Author: Ian Craggs <icraggs@uk.ibm.com>
Date:   Tue Apr 4 22:54:15 2017 +0100

    Binary will message
@icraggs
Copy link
Contributor

icraggs commented Apr 6, 2017

Update added to the develop branch, for release in June.

@icraggs
Copy link
Contributor

icraggs commented Apr 7, 2017

I think this issue is fixed - closing.

@icraggs icraggs closed this as completed Apr 7, 2017
JuergenKosel added a commit to JuergenKosel/paho.mqtt.c that referenced this issue Apr 13, 2017
# By Ian Craggs (50) and others
# Via Ian Craggs (10) and others
* testcase-for-issue-190: (119 commits)
  Include MQTTAsync_create() call in the test iteration loop for test2d
  Set use_identity_as_username false for mosquitto listener 18884
  Enable the server certificate in test5-2d
  Set the serverURI in the corresponding array of the connect options for test5-2d
  Ignore the build.paho directory, which is created by travis build script
  Rerun test5-2d 100 times
  Add new test2d for issue eclipse#190
  Binary passwords and will messages: PR eclipse#159, issues eclipse#167 and eclipse#34 Squashed commit of the following:
  Fix for issue eclipse#164
  Documentation updates
  Some small changes to PR eclipse#200
  Some small cleanup
  Tidy up test3 and CMake config
  Reduce size on messages in test8-4
  Fix TLS certs dir on Windows
  Add applink.c to windows TLS test program
  Fix startprocess path
  Fix startprocess syntax
  Fix proxy start
  Different approach to starting proxy
  ...

Signed-off-by: Juergen Kosel <juergen.kosel@softing.com>
JuergenKosel added a commit to JuergenKosel/paho.mqtt.c that referenced this issue Apr 18, 2017
# By Ian Craggs (50) and others
# Via Ian Craggs (10) and others
* testcase-for-issue-190-without-serverURI: (118 commits)
  In test5 - 2d the client must not have the valid client certificate!
  Stop any mosquitto instance which may be still running from previous runs
  Correct / update the unit test labeling
  Reduce time for test2d
  Include MQTTAsync_create() call in the test iteration loop for test2d
  Set use_identity_as_username false for mosquitto listener 18884
  Enable the server certificate in test5-2d
  Set the serverURI in the corresponding array of the connect options for test5-2d
  Ignore the build.paho directory, which is created by travis build script
  Rerun test5-2d 100 times
  Add new test2d for issue eclipse#190
  Binary passwords and will messages: PR eclipse#159, issues eclipse#167 and eclipse#34 Squashed commit of the following:
  Fix for issue eclipse#164
  Documentation updates
  Some small changes to PR eclipse#200
  Some small cleanup
  Tidy up test3 and CMake config
  Reduce size on messages in test8-4
  Fix TLS certs dir on Windows
  Add applink.c to windows TLS test program
  ...

Signed-off-by: Juergen Kosel <juergen.kosel@softing.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants