Skip to content

Commit

Permalink
Implemented session support.
Browse files Browse the repository at this point in the history
  • Loading branch information
MayaPosch committed Jan 10, 2018
1 parent 5413975 commit 5d385e1
Show file tree
Hide file tree
Showing 18 changed files with 1,268 additions and 146 deletions.
168 changes: 88 additions & 80 deletions MQTTCute.pro
Original file line number Diff line number Diff line change
@@ -1,80 +1,88 @@
#-------------------------------------------------
#
# Project created by QtCreator 2017-12-24T16:50:07
#
#-------------------------------------------------

QT += core gui network

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = MQTTCute
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp \
mqttlistener.cpp \
topicwindow.cpp \
discoverywindow.cpp

win32-g++ {
SOURCES += mosquitto/lib/cpp/mosquittopp.cpp \
mosquitto/lib/logging_mosq.c \
mosquitto/lib/memory_mosq.c \
mosquitto/lib/messages_mosq.c \
mosquitto/lib/mosquitto.c \
mosquitto/lib/net_mosq.c \
mosquitto/lib/read_handle.c \
mosquitto/lib/read_handle_client.c \
mosquitto/lib/read_handle_shared.c \
mosquitto/lib/send_client_mosq.c \
mosquitto/lib/send_mosq.c \
mosquitto/lib/socks_mosq.c \
mosquitto/lib/srv_mosq.c \
mosquitto/lib/thread_mosq.c \
mosquitto/lib/time_mosq.c \
mosquitto/lib/tls_mosq.c \
mosquitto/lib/util_mosq.c \
mosquitto/lib/will_mosq.c
}

HEADERS += mainwindow.h \
mqttlistener.h \
topicwindow.h \
discoverywindow.h

win32-g++ {
HEADERS += mosquitto/lib/cpp/mosquittopp.h \
mosquitto/lib/dummypthread.h \
mosquitto/lib/logging_mosq.h \
mosquitto/lib/memory_mosq.h \
mosquitto/lib/messages_mosq.h \
mosquitto/lib/mosquitto.h \
mosquitto/lib/mosquitto_internal.h \
mosquitto/lib/mqtt3_protocol.h \
mosquitto/lib/net_mosq.h \
mosquitto/lib/read_handle.h \
mosquitto/lib/send_mosq.h \
mosquitto/lib/socks_mosq.h \
mosquitto/lib/time_mosq.h \
mosquitto/lib/tls_mosq.h \
mosquitto/lib/util_mosq.h \
mosquitto/lib/will_mosq.h
}

FORMS += mainwindow.ui \
topicwindow.ui \
discoverywindow.ui

!win32 {
LIBS += -lmosquitto -lmosquittopp
}

win32:CONFIG(release, debug|release): LIBS += -lws2_32
win32:CONFIG(debug, debug|release): LIBS += -lws2_32
win32-msvc:CONFIG(release, debug|release): LIBS += -L$$PWD/mosquitto/msvc_2017_x64/
win32-msvc:CONFIG(debug, debug|release): LIBS += -L$$PWD/mosquitto/msvc_2017_x64/

#INCLUDEPATH += $$PWD/mosquitto
#DEPENDPATH += $$PWD/mosquitto
#-------------------------------------------------
#
# Project created by QtCreator 2017-12-24T16:50:07
#
#-------------------------------------------------

QT += core gui network

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = MQTTCute
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp \
mqttlistener.cpp \
topicwindow.cpp \
discoverywindow.cpp \
sessiondialog.cpp \
settingsdialog.cpp

win32-g++ {
SOURCES += mosquitto/lib/cpp/mosquittopp.cpp \
mosquitto/lib/logging_mosq.c \
mosquitto/lib/memory_mosq.c \
mosquitto/lib/messages_mosq.c \
mosquitto/lib/mosquitto.c \
mosquitto/lib/net_mosq.c \
mosquitto/lib/read_handle.c \
mosquitto/lib/read_handle_client.c \
mosquitto/lib/read_handle_shared.c \
mosquitto/lib/send_client_mosq.c \
mosquitto/lib/send_mosq.c \
mosquitto/lib/socks_mosq.c \
mosquitto/lib/srv_mosq.c \
mosquitto/lib/thread_mosq.c \
mosquitto/lib/time_mosq.c \
mosquitto/lib/tls_mosq.c \
mosquitto/lib/util_mosq.c \
mosquitto/lib/will_mosq.c
}

HEADERS += mainwindow.h \
mqttlistener.h \
topicwindow.h \
discoverywindow.h \
sessiondialog.h \
settingsdialog.h

win32-g++ {
HEADERS += mosquitto/lib/cpp/mosquittopp.h \
mosquitto/lib/dummypthread.h \
mosquitto/lib/logging_mosq.h \
mosquitto/lib/memory_mosq.h \
mosquitto/lib/messages_mosq.h \
mosquitto/lib/mosquitto.h \
mosquitto/lib/mosquitto_internal.h \
mosquitto/lib/mqtt3_protocol.h \
mosquitto/lib/net_mosq.h \
mosquitto/lib/read_handle.h \
mosquitto/lib/send_mosq.h \
mosquitto/lib/socks_mosq.h \
mosquitto/lib/time_mosq.h \
mosquitto/lib/tls_mosq.h \
mosquitto/lib/util_mosq.h \
mosquitto/lib/will_mosq.h
}

FORMS += mainwindow.ui \
topicwindow.ui \
discoverywindow.ui \
sessiondialog.ui \
settingsdialog.ui

!win32 {
LIBS += -lmosquitto -lmosquittopp
}

win32:CONFIG(release, debug|release): LIBS += -lws2_32
win32:CONFIG(debug, debug|release): LIBS += -lws2_32
win32-msvc:CONFIG(release, debug|release): LIBS += -L$$PWD/mosquitto/msvc_2017_x64/
win32-msvc:CONFIG(debug, debug|release): LIBS += -L$$PWD/mosquitto/msvc_2017_x64/

RESOURCES += \
images.qrc

win32:RC_ICONS += img/mqtticon-large.png
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

**Author:** Maya Posch

**Date:** 2018/01/01
**Date:** 2018/01/10

## Overview ##

MQTTCute is an MQTT desktop client written in C++/Qt. Its main focus is on being helpful with the debugging and monitoring of MQTT-based systems which use binary protocols.

![MQTTCute screenshot](mqttcute.jpg)
![MQTTCute screenshot](mqttcute_v02.jpg)

## Installing ##

Expand Down Expand Up @@ -48,11 +48,14 @@ The received messages will be displayed twice, once in hexadecimal format on the

To **discover** active topics underneath a category, use the `New discovery' toolbar option and fill in a topic that ends with an MQTT wildcard topic ('/#'). In the window that appears one can then check 'subscribe' and the text field will be filled with all active topics on which are currently being published.

Use the menu options underneath **Session** to load sessions and create new ones. Currently sessions do not yet save open windows.

## TODO ##

At this point MQTTCute is still quite barebones. Features that are planned for inclusion are:

* Better and customisable received message formatting and copying.
* History function and loading of external files for publishing.
* Client sessions.
* Save open window state in session files.
* Encrypt usernames and passwords for MQTT brokers in session files.
* Etc.
8 changes: 7 additions & 1 deletion discoverywindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<property name="windowTitle">
<string>Discovery Window</string>
</property>
<property name="windowIcon">
<iconset resource="images.qrc">
<normaloff>:/img/img/mqtticon-large.png</normaloff>:/img/img/mqtticon-large.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
Expand Down Expand Up @@ -65,6 +69,8 @@
</item>
</layout>
</widget>
<resources/>
<resources>
<include location="images.qrc"/>
</resources>
<connections/>
</ui>
41 changes: 41 additions & 0 deletions doc/mqttcute_session_file_format.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
MQTTCute
Session file format
---

uint8 (8) MQTTCUTE
uint8 (6) SESSION
uint32 Bytes following this field.
uint8 Length of MQTT broker address string.
uint8 (*) MQTT broker address string.
uint16 MQTT broker port.
uint8 Login type: 0: Anonymous, 1: Password, 2: Certificate.
<login data>
<open topics>


> Login data:

* Anonymous:
No further data.

* Password:
uint8 Length of username string.
uint8 (*) Username string.
uint8 Length of password string.
uint8 (*) Password string.

* Certificate:
uint16 Length of CA file string.
uint8 (*) CA file string (path).
uint16 Length of Cert file string.
uint8 (*) Cert file string (path).
uint16 Length of Key file string.
uint8 (*) Key file string (path).


> Open topics:

uint8 (5) TOPIC
uint8 Type of window (0: topic, 1: discovery).
uint16 Length of topic string.
uint8 (*) Topic string.
5 changes: 5 additions & 0 deletions images.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/img">
<file>img/mqtticon-large.png</file>
</qresource>
</RCC>
Binary file added img/mqtticon-large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5d385e1

Please sign in to comment.