Skip to content

Commit

Permalink
Separated I/O independent (as known as Sans-I/O) protocol part.
Browse files Browse the repository at this point in the history
The protocol part can be used from not only Boost.Asio but also other
I/O mechanism including OS-less enviromnemt.
  • Loading branch information
redboltz committed Dec 6, 2024
1 parent 455c155 commit 264404f
Show file tree
Hide file tree
Showing 337 changed files with 13,096 additions and 9,554 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

= History

== 10.0.0
=== breaking changes
* Re-organized include files.
* Removed non bulk read to meet Sans-I/O interface.
* Supported I/O independent (aka Sans-I/O) library.
* underlying_handshake functionality is updated from free function to member function.

== 9.1.0
* Added invalid combination checking of sharename and nl(no local). #372
* Fixed receive maximum processing. #371
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# http://www.boost.org/LICENSE_1_0.txt)

cmake_minimum_required (VERSION 3.13.0)
project(async_mqtt_iface VERSION 9.1.0)
project(async_mqtt_iface VERSION 10.0.0)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -20,6 +20,7 @@ option(ASYNC_MQTT_BUILD_TOOLS "Enable building tools (broker, bench, etc.." OFF)
option(ASYNC_MQTT_BUILD_EXAMPLES "Enable building example applications" OFF)
option(ASYNC_MQTT_BUILD_EXAMPLES_SEPARATE "Enable building separate library build example applications(It requires much memory)" OFF)
option(ASYNC_MQTT_BUILD_LIB "Enable building separate compilation library" OFF)
option(ASYNC_MQTT_MRDOCS "For Mr.Docs document generation" OFF)

# Not implemented yet
option(ASYNC_MQTT_USE_STR_CHECK "Enable UTF8 String check" OFF)
Expand Down Expand Up @@ -157,7 +158,7 @@ if(DOXYGEN_FOUND)
COMMAND ${CMAKE_COMMAND} -E echo "FILE_PATTERNS = *.hpp" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMAND ${CMAKE_COMMAND} -E echo "OUTPUT_DIRECTORY = doc" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMAND ${CMAKE_COMMAND} -E echo "PROJECT_NAME = async_mqtt" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMAND ${CMAKE_COMMAND} -E echo "PROJECT_NUMBER = 9.1.0" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMAND ${CMAKE_COMMAND} -E echo "PROJECT_NUMBER = 10.0.0" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMAND ${CMAKE_COMMAND} -E echo "RECURSIVE = YES" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMAND ${CMAKE_COMMAND} -E echo "PREDEFINED = GENERATING_DOCUMENTATION ASYNC_MQTT_USE_TLS ASYNC_MQTT_USE_WS ASYNC_MQTT_USE_LOG" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
COMMAND ${CMAKE_COMMAND} -E echo "INPUT = ${CMAKE_CURRENT_SOURCE_DIR}/include/async_mqtt" >> ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
# async_mqtt

Asynchronous MQTT communication library.
- I/O independent (as known as Sans-I/O) MQTT protocol library for C++17.
- Asynchronous MQTT communication library using the MQTT protocol library and Boost.Asio.

Version 9.1.0 [![Actions Status](https://github.com/redboltz/async_mqtt/workflows/CI/badge.svg)](https://github.com/redboltz/async_mqtt/actions)[![codecov](https://codecov.io/gh/redboltz/async_mqtt/branch/main/graph/badge.svg)](https://codecov.io/gh/redboltz/async_mqtt)
Version 10.0.0 [![Actions Status](https://github.com/redboltz/async_mqtt/workflows/CI/badge.svg)](https://github.com/redboltz/async_mqtt/actions)[![codecov](https://codecov.io/gh/redboltz/async_mqtt/branch/main/graph/badge.svg)](https://codecov.io/gh/redboltz/async_mqtt)

This is Boost.Asio oriented asynchronous MQTT communication library. You can use async_mqtt to develop not only your MQTT client application but also your server (e.g. broker).
Based on https://github.com/redboltz/mqtt_cpp experience, there are many improvements. See overview.

Document is https://github.com/redboltz/async_mqtt/blob/doc/README.adoc

# Overview
## Document

[Latest document](https://redboltz.github.io/async_mqtt/doc/latest/index.html)

## I/O independent protocol library
- connection
- Protocol state machine for MQTT connection.
- All APIs are implemented as synchronous member functions.
- State machine events are implemented as pure virtual functions.
- rv_connection
- Inherits connection.
- State machine events are implemented as the return value of APIs.
- The type of return value is vector of event_variant.

## Boost.Asio style asynchronous APIs support

### [Completion Token](https://www.boost.org/doc/html/boost_asio/overview/model/completion_tokens.html) is supported
Expand Down
218 changes: 176 additions & 42 deletions doc/modules/ROOT/pages/reference.adoc
Original file line number Diff line number Diff line change
@@ -1,142 +1,276 @@
[#reference]
= Reference

[width=100%]
== I/O independent (a.k.a Sans-I/O) MQTT protocol machine

[%header,width=100%,cols="1,1,1"]
|===
1+| *MQTT Connections* | *Predefined Layers* | *MQTT packets* | *Errors*
|MQTT Protocol
|Timer
|Error

| **Class Templates**
|

xref:reference:async_mqtt/client.adoc[`client`]
**Classes**

xref:reference:async_mqtt/endpoint.adoc[`endpoint`]
**Protocol machines**

xref:reference:async_mqtt/basic_endpoint.adoc[`basic_endpoint`]
xref:reference:async_mqtt/connection.adoc[`connection`]

xref:reference:async_mqtt/basic_connection.adoc[`basic_connection`]

xref:reference:async_mqtt/rv_connection.adoc[`rv_connection`]

xref:reference:async_mqtt/basic_rv_connection.adoc[`basic_rv_connection`]

**Events**

xref:reference:async_mqtt/event_variant.adoc[`event_variant`]

xref:reference:async_mqtt/event/basic_send.adoc[`basic_send`]

xref:reference:async_mqtt/event/send.adoc[`send`]

xref:reference:async_mqtt/event/basic_packet_received.adoc[`basic_packet_received`]

xref:reference:async_mqtt/event/packet_received.adoc[`packet_received`]

xref:reference:async_mqtt/event/close.adoc[`close`]

xref:reference:async_mqtt/event/basic_packet_id_released.adoc[`basic_packet_id_released`]

xref:reference:async_mqtt/event/packet_id_released.adoc[`packet_id_released`]

xref:reference:async_mqtt/event/timer.adoc[`timer`]

**Enums**

xref:reference:async_mqtt/protocol_version.adoc[`protocol_version`]

xref:reference:async_mqtt/role.adoc[`role`]

|

**Enums**

xref:reference:async_mqtt/timer_kind.adoc[`timer_kind`]

xref:reference:async_mqtt/timer_op.adoc[`timer_op`]

**Functions**

xref:reference:async_mqtt/setup_log.adoc[`setup_log`]
xref:reference:async_mqtt/timer_kind_to_string.adoc[`timer_kind_to_string`]

xref:reference:async_mqtt/logger.adoc[`log`]
xref:reference:async_mqtt/timer_op_to_string.adoc[`timer_op_to_string`]

| **Types**
|

xref:reference:async_mqtt/protocol/mqtt.adoc[`mqtt`]
**Types**

xref:reference:async_mqtt/protocol/mqtts.adoc[`mqtts`]
xref:reference:async_mqtt/error_code.adoc[`error_code`]

xref:reference:async_mqtt/protocol/ws.adoc[`ws`]
**Enums**

xref:reference:async_mqtt/protocol/wss.adoc[`wss`]
**common**

**Class Templates**
xref:reference:async_mqtt/mqtt_error.adoc[`mqtt_error`]

xref:reference:async_mqtt/layer_customize-03.adoc[`layer_customize(TCP)`]
**v3.1.1**

xref:reference:async_mqtt/layer_customize-08.adoc[`layer_customize(TLS)`]
xref:reference:async_mqtt/connect_return_code.adoc[`connect_return_code`]

xref:reference:async_mqtt/layer_customize-02.adoc[`layer_customize(WS)`]
xref:reference:async_mqtt/suback_return_code.adoc[`suback_return_code`]

**v5**

xref:reference:async_mqtt/connect_reason_code.adoc[`connect_reason_code`]

xref:reference:async_mqtt/disconnect_reason_code.adoc[`disconnect_reason_code`]

xref:reference:async_mqtt/suback_reason_code.adoc[`suback_reason_code`]

**Function Templates**
xref:reference:async_mqtt/unsuback_reason_code.adoc[`unsuback_reason_code`]

xref:reference:async_mqtt/async_underlying_handshake-05.adoc[`async_underlying_handshake(TCP)`]
xref:reference:async_mqtt/async_underlying_handshake-09.adoc[`async_underlying_handshake(TLS)`]
xref:reference:async_mqtt/async_underlying_handshake-06.adoc[`async_underlying_handshake(WS)`]
xref:reference:async_mqtt/async_underlying_handshake-0b.adoc[`async_underlying_handshake(WS with path)`]
xref:reference:async_mqtt/puback_reason_code.adoc[`puback_reason_code`]

| **Class Templates**
xref:reference:async_mqtt/pubrec_reason_code.adoc[`pubrec_reason_code`]

**common**
xref:reference:async_mqtt/pubrel_reason_code.adoc[`pubrel_reason_code`]

xref:reference:async_mqtt/pubcomp_reason_code.adoc[`pubcomp_reason_code`]

xref:reference:async_mqtt/auth_reason_code.adoc[`auth_reason_code`]

|===


[%header,width=100%,cols="1,1,1,1"]
|===
4+|MQTT packets

|

**Classes(1 of 4)**

**variants**

xref:reference:async_mqtt/packet_variant.adoc[`packet_variant`]

xref:reference:async_mqtt/basic_packet_variant.adoc[`basic_packet_variant`]

**v3.1.1**

xref:reference:async_mqtt/v3_1_1/connect_packet.adoc[`connect_packet`]

xref:reference:async_mqtt/v3_1_1/connack_packet.adoc[`connack_packet`]

xref:reference:async_mqtt/v3_1_1/disconnect_packet.adoc[`disconnect_packet`]

xref:reference:async_mqtt/v3_1_1/subscribe_packet.adoc[`subscribe_packet`]

xref:reference:async_mqtt/v3_1_1/basic_subscribe_packet.adoc[`basic_subscribe_packet`]

xref:reference:async_mqtt/v3_1_1/suback_packet.adoc[`suback_packet`]

xref:reference:async_mqtt/v3_1_1/basic_suback_packet.adoc[`basic_suback_packet`]

xref:reference:async_mqtt/v3_1_1/unsubscribe_packet.adoc[`unsubscribe_packet`]

xref:reference:async_mqtt/v3_1_1/basic_unsubscribe_packet.adoc[`basic_unsubscribe_packet`]

xref:reference:async_mqtt/v3_1_1/unsuback_packet.adoc[`unsuback_packet`]

xref:reference:async_mqtt/v3_1_1/basic_unsuback_packet.adoc[`basic_unsuback_packet`]

|

**Classes(2 of 4)**

xref:reference:async_mqtt/v3_1_1/publish_packet.adoc[`publish_packet`]

xref:reference:async_mqtt/v3_1_1/basic_publish_packet.adoc[`basic_publish_packet`]

xref:reference:async_mqtt/v3_1_1/puback_packet.adoc[`puback_packet`]

xref:reference:async_mqtt/v3_1_1/basic_puback_packet.adoc[`basic_puback_packet`]

xref:reference:async_mqtt/v3_1_1/pubrec_packet.adoc[`pubrec_packet`]

xref:reference:async_mqtt/v3_1_1/basic_pubrec_packet.adoc[`basic_pubrec_packet`]

xref:reference:async_mqtt/v3_1_1/pubrel_packet.adoc[`pubrel_packet`]

xref:reference:async_mqtt/v3_1_1/basic_pubrel_packet.adoc[`basic_pubrel_packet`]

xref:reference:async_mqtt/v3_1_1/pubcomp_packet.adoc[`pubcomp_packet`]

xref:reference:async_mqtt/v3_1_1/basic_pubcomp_packet.adoc[`basic_pubcomp_packet`]

xref:reference:async_mqtt/v3_1_1/pingreq_packet.adoc[`pingreq_packet`]

xref:reference:async_mqtt/v3_1_1/pingresp_packet.adoc[`pungresp_packet`]

|

**Classes(3 of 4)**

**v5**

xref:reference:async_mqtt/v5/connect_packet.adoc[`connect_packet`]

xref:reference:async_mqtt/v5/connack_packet.adoc[`connack_packet`]

xref:reference:async_mqtt/v5/disconnect_packet.adoc[`disconnect_packet`]

xref:reference:async_mqtt/v5/subscribe_packet.adoc[`subscribe_packet`]

xref:reference:async_mqtt/v5/basic_subscribe_packet.adoc[`basic_subscribe_packet`]

xref:reference:async_mqtt/v5/suback_packet.adoc[`suback_packet`]

xref:reference:async_mqtt/v5/basic_suback_packet.adoc[`basic_suback_packet`]

xref:reference:async_mqtt/v5/unsubscribe_packet.adoc[`unsubscribe_packet`]

xref:reference:async_mqtt/v5/basic_unsubscribe_packet.adoc[`basic_unsubscribe_packet`]

xref:reference:async_mqtt/v5/unsuback_packet.adoc[`unsuback_packet`]

xref:reference:async_mqtt/v5/basic_unsuback_packet.adoc[`basic_unsuback_packet`]

|

**Classes(4 of 4)**

xref:reference:async_mqtt/v5/publish_packet.adoc[`publish_packet`]

xref:reference:async_mqtt/v5/basic_publish_packet.adoc[`basic_publish_packet`]

xref:reference:async_mqtt/v5/puback_packet.adoc[`puback_packet`]

xref:reference:async_mqtt/v5/basic_puback_packet.adoc[`basic_puback_packet`]

xref:reference:async_mqtt/v5/pubrec_packet.adoc[`pubrec_packet`]

xref:reference:async_mqtt/v5/basic_pubrec_packet.adoc[`basic_pubrec_packet`]

xref:reference:async_mqtt/v5/pubrel_packet.adoc[`pubrel_packet`]

xref:reference:async_mqtt/v5/basic_pubrel_packet.adoc[`basic_pubrel_packet`]

xref:reference:async_mqtt/v5/pubcomp_packet.adoc[`pubcomp_packet`]

xref:reference:async_mqtt/v5/basic_pubcomp_packet.adoc[`basic_pubcomp_packet`]

xref:reference:async_mqtt/v5/pingreq_packet.adoc[`pingreq_packet`]

xref:reference:async_mqtt/v5/pingresp_packet.adoc[`pungresp_packet`]

xref:reference:async_mqtt/v5/auth_packet.adoc[`auth_packet`]

|===

| **Types**

xref:reference:async_mqtt/error_code.adoc[`error_code`]
== Boost.Asio binding of the MQTT protocol machine

**Enums**
[width=100%]
|===
1+| *MQTT Connections* | *Predefined Layers*

**common**
|

xref:reference:async_mqtt/mqtt_error.adoc[`mqtt_error`]
**Classes**

**v3.1.1**
xref:reference:async_mqtt/client.adoc[`client`]

xref:reference:async_mqtt/connect_return_code.adoc[`connect_return_code`]
xref:reference:async_mqtt/suback_return_code.adoc[`suback_return_code`]
xref:reference:async_mqtt/endpoint.adoc[`endpoint`]

**v5**
xref:reference:async_mqtt/basic_endpoint.adoc[`basic_endpoint`]

xref:reference:async_mqtt/connect_reason_code.adoc[`connect_reason_code`]
xref:reference:async_mqtt/disconnect_reason_code.adoc[`disconnect_reason_code`]
xref:reference:async_mqtt/suback_reason_code.adoc[`suback_reason_code`]
xref:reference:async_mqtt/unsuback_reason_code.adoc[`unsuback_reason_code`]
xref:reference:async_mqtt/puback_reason_code.adoc[`puback_reason_code`]
xref:reference:async_mqtt/pubrec_reason_code.adoc[`pubrec_reason_code`]
xref:reference:async_mqtt/pubrel_reason_code.adoc[`pubrel_reason_code`]
xref:reference:async_mqtt/pubcomp_reason_code.adoc[`pubcomp_reason_code`]
xref:reference:async_mqtt/auth_reason_code.adoc[`auth_reason_code`]
**Functions**

xref:reference:async_mqtt/setup_log.adoc[`setup_log`]

xref:reference:async_mqtt/logger.adoc[`log`]

|

**Types**

xref:reference:async_mqtt/protocol/mqtt.adoc[`mqtt`]

xref:reference:async_mqtt/protocol/mqtts.adoc[`mqtts`]

xref:reference:async_mqtt/protocol/ws.adoc[`ws`]

xref:reference:async_mqtt/protocol/wss.adoc[`wss`]

**Classes**

xref:reference:async_mqtt/layer_customize-03.adoc[`layer_customize(TCP)`]

xref:reference:async_mqtt/layer_customize-08.adoc[`layer_customize(TLS)`]

xref:reference:async_mqtt/layer_customize-02.adoc[`layer_customize(WS)`]

|===
2 changes: 1 addition & 1 deletion doc/mrdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ base-url: https://www.github.com/redboltz/async_mqtt/blob/main/include/
verbose: true
multipage: true

cmake: '-D CMAKE_CXX_STANDARD=17 -D ASYNC_MQTT_USE_TLS=ON -D ASYNC_MQTT_USE_WS=ON -D ASYNC_MQTT_USE_LOG=ON -D ASYNC_MQTT_BUILD_TOOLS=ON"'
cmake: '-D CMAKE_CXX_STANDARD=17 -D ASYNC_MQTT_USE_TLS=ON -D ASYNC_MQTT_USE_WS=ON -D ASYNC_MQTT_USE_LOG=ON -D ASYNC_MQTT_BUILD_TOOLS=ON -D ASYNC_MQTT_MRDOCS=ON'
Loading

0 comments on commit 264404f

Please sign in to comment.