Bug 477535 - There was a bug when we used the Eclipse Paho MQTT Utility to publish the message when we selected a image
Summary: There was a bug when we used the Eclipse Paho MQTT Utility to publish the mes...
Status: UNCONFIRMED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Paho (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: James Sutton CLA
QA Contact: Ian Craggs CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-16 04:46 EDT by Henry Zhu CLA
Modified: 2016-02-05 11:16 EST (History)
1 user (show)

See Also:


Attachments
Eclipse Paho MQTT Utility issue (89.40 KB, image/png)
2015-09-16 04:49 EDT, Henry Zhu CLA
no flags Details
Mockup showing the raw check box (16.10 KB, image/png)
2015-11-16 10:27 EST, James Sutton CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Henry Zhu CLA 2015-09-16 04:46:37 EDT
After opening the Eclipse Paho MQTT Utility, we found that there was a bug when we used the Eclipse Paho MQTT Utility to publish the message when we selected a image file. The binary which was sent to the MQTT server was not the binary but the string format of binary. Meanwhile, the binary format is correct if we used the command which was provided by mosquitto using the below command, for example mosquitto_pub.exe -h 192.168.80.196 -p 1884 -f C:\temp\1.png -t test1
Comment 1 Henry Zhu CLA 2015-09-16 04:49:30 EDT
Created attachment 256609 [details]
Eclipse Paho MQTT Utility issue
Comment 2 James Sutton CLA 2015-11-16 10:26:42 EST
The behaviour isn't what I would expect either, I've had a look in the source, looks like the file reader simply tries to read the file as UTF-8 and if it fails, it reads the file in as a byte array but converts it to HEX.

I propose that we add another Checkbox to the UI called 'Raw' that allows the user to choose between the file being sent as HEX or as a raw byte array (Which to me would be the expected behaviour)

When the file is read in, we should keep it as the byte array internally and then only convert it to hex if the user ticks the box. Though we should keep the byte array in case they change their minds.
Comment 3 James Sutton CLA 2015-11-16 10:27:19 EST
Created attachment 257977 [details]
Mockup showing the raw check box
Comment 4 James Sutton CLA 2016-02-05 05:59:58 EST
Migrated to GitHub Issue: https://github.com/eclipse/paho.mqtt.java/issues/22