Skip to content

Commit

Permalink
Merge branch 'main' into user/ashdhin/IssueTemplateRegressionCheckbox
Browse files Browse the repository at this point in the history
  • Loading branch information
jmklix authored Oct 25, 2024
2 parents ce62f38 + 627c333 commit 4577ecc
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
32 changes: 17 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.9)
project(aws-c-mqtt C)

if (POLICY CMP0069)
cmake_policy(SET CMP0069 NEW) # Enable LTO/IPO if available in the compiler, see AwsCFlags
endif()

option(ASSERT_LOCK_HELD "Enable ASSERT_SYNCED_DATA_LOCK_HELD for checking thread issue" OFF)
if (ASSERT_LOCK_HELD)
add_definitions(-DASSERT_LOCK_HELD)
Expand Down Expand Up @@ -39,39 +35,44 @@ include(AwsFindPackage)

file(GLOB AWS_MQTT_HEADERS
"include/aws/mqtt/*.h"
)
)

file(GLOB AWS_MQTT5_HEADERS
"include/aws/mqtt/v5/*.h"
)
)

file(GLOB AWS_MQTT_RR_HEADERS
"include/aws/mqtt/request-response/*.h"
)

file(GLOB AWS_MQTT_PRIV_HEADERS
"include/aws/mqtt/private/*.h"
"include/aws/mqtt/private/request-response/*.h"
"include/aws/mqtt/private/v5/*.h"
)
)

file(GLOB AWS_MQTT_PRIV_EXPOSED_HEADERS
"include/aws/mqtt/private/mqtt_client_test_helper.h"
)
)

file(GLOB AWS_MQTT_SRC
"source/*.c"
"source/v5/*.c"
"source/request-response/*.c"
)
)

file(GLOB MQTT_HEADERS
${AWS_MQTT_HEADERS}
${AWS_MQTT_PRIV_HEADERS}
)
)

file(GLOB AWS_MQTT5_HEADERS
${AWS_MQTT5_HEADERS}
)
)

file(GLOB MQTT_SRC
${AWS_MQTT_SRC}
)
)

add_library(${PROJECT_NAME} ${MQTT_HEADERS} ${MQTT_SRC})
aws_set_common_properties(${PROJECT_NAME})
Expand All @@ -94,13 +95,14 @@ aws_prepare_shared_lib_exports(${PROJECT_NAME})

install(FILES ${AWS_MQTT_HEADERS} DESTINATION "include/aws/mqtt" COMPONENT Development)
install(FILES ${AWS_MQTT5_HEADERS} DESTINATION "include/aws/mqtt/v5" COMPONENT Development)
install(FILES ${AWS_MQTT_RR_HEADERS} DESTINATION "include/aws/mqtt/request-response" COMPONENT Development)
install(FILES ${AWS_MQTT_TESTING_HEADERS} DESTINATION "include/aws/testing/mqtt" COMPONENT Development)
install(FILES ${AWS_MQTT_PRIV_EXPOSED_HEADERS} DESTINATION "include/aws/mqtt/private" COMPONENT Development)

if (BUILD_SHARED_LIBS)
set (TARGET_DIR "shared")
set (TARGET_DIR "shared")
else()
set (TARGET_DIR "static")
set (TARGET_DIR "static")
endif()

install(EXPORT "${PROJECT_NAME}-targets"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ C99 implementation of the MQTT 3.1.1 and MQTT 5 specifications.

## License

This library is licensed under the Apache 2.0 License.
This library is licensed under the Apache 2.0 License.

## Usage

### Building

CMake 3.1+ is required to build.
CMake 3.9+ is required to build.

`<install-path>` must be an absolute path in the following instructions.

Expand Down Expand Up @@ -203,6 +203,6 @@ the wire. For QoS 1, as soon as PUBACK comes back. For QoS 2, PUBCOMP. `topic` a
```c
int aws_mqtt_client_connection_ping(struct aws_mqtt_client_connection *connection);
```
Sends a PINGREQ packet to the server.
Sends a PINGREQ packet to the server.
[aws-c-io]: https://github.com/awslabs/aws-c-io
3 changes: 3 additions & 0 deletions include/aws/mqtt/mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ enum aws_mqtt_error {
AWS_ERROR_MQTT_REQUEST_RESPONSE_INTERNAL_ERROR,
AWS_ERROR_MQTT_REQUEST_RESPONSE_PUBLISH_FAILURE,
AWS_ERROR_MQTT_REUQEST_RESPONSE_STREAM_ALREADY_ACTIVATED,
AWS_ERROR_MQTT_REQUEST_RESPONSE_MODELED_SERVICE_ERROR,
AWS_ERROR_MQTT_REQUEST_RESPONSE_PAYLOAD_PARSE_ERROR,
AWS_ERROR_MQTT_REQUEST_RESPONSE_INVALID_RESPONSE_PATH,

AWS_ERROR_END_MQTT_RANGE = AWS_ERROR_ENUM_END_RANGE(AWS_C_MQTT_PACKAGE_ID),
};
Expand Down
11 changes: 10 additions & 1 deletion source/mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,16 @@ bool aws_mqtt_is_valid_topic_filter(const struct aws_byte_cursor *topic_filter)
"Request-response operation failed because the associated publish failed synchronously."),
AWS_DEFINE_ERROR_INFO_MQTT(
AWS_ERROR_MQTT_REUQEST_RESPONSE_STREAM_ALREADY_ACTIVATED,
"Streaming operation activation failed because the operaation had already been activated."),
"Streaming operation activation failed because the operation had already been activated."),
AWS_DEFINE_ERROR_INFO_MQTT(
AWS_ERROR_MQTT_REQUEST_RESPONSE_MODELED_SERVICE_ERROR,
"Request-response operation failed with a modeled service error."),
AWS_DEFINE_ERROR_INFO_MQTT(
AWS_ERROR_MQTT_REQUEST_RESPONSE_PAYLOAD_PARSE_ERROR,
"Request-response operation failed due to an inability to parse the payload."),
AWS_DEFINE_ERROR_INFO_MQTT(
AWS_ERROR_MQTT_REQUEST_RESPONSE_INVALID_RESPONSE_PATH,
"Request-response operation failed due to arrival on an unknown response path"),
};
/* clang-format on */
#undef AWS_DEFINE_ERROR_INFO_MQTT
Expand Down

0 comments on commit 4577ecc

Please sign in to comment.