Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bretambrose committed Mar 9, 2024
1 parent 545aba0 commit f69b09f
Show file tree
Hide file tree
Showing 4 changed files with 598 additions and 112 deletions.
1 change: 1 addition & 0 deletions include/aws/mqtt/mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ enum aws_mqtt_error {
AWS_ERROR_MQTT_CONNECTION_RESUBSCRIBE_NO_TOPICS,
AWS_ERROR_MQTT_CONNECTION_SUBSCRIBE_FAILURE,
AWS_ERROR_MQTT_PROTOCOL_ADAPTER_FAILING_REASON_CODE,
AWS_ERROR_MQTT_REQUEST_RESPONSE_CLIENT_SHUT_DOWN,

AWS_ERROR_END_MQTT_RANGE = AWS_ERROR_ENUM_END_RANGE(AWS_C_MQTT_PACKAGE_ID),
};
Expand Down
20 changes: 10 additions & 10 deletions include/aws/mqtt/request-response/request_response_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ struct aws_mqtt_client_connection;
struct aws_mqtt5_client;
struct aws_mqtt_streaming_operation;

struct aws_mqtt_request_operation_message_path {
struct aws_mqtt_request_operation_response_path {
struct aws_byte_cursor topic;

/* potential point of expansion into an abstract "extractor" if we ever need to support non-JSON payloads */
struct aws_byte_cursor correlation_token_json_path;
};

typedef void(aws_mqtt_request_operation_completion_fn)(int error_code, struct aws_byte_cursor payload, void *user_data);
typedef void(aws_mqtt_request_operation_completion_fn)(struct aws_byte_cursor *payload, int error_code, void *user_data);

struct aws_mqtt_request_operation_options {
struct aws_byte_cursor subscription_topic_filter;

struct aws_mqtt_request_operation_message_path *message_paths;
size_t message_path_count;
struct aws_mqtt_request_operation_response_path *response_paths;
size_t response_path_count;

struct aws_byte_cursor publish_topic;
struct aws_byte_cursor serialized_request;
Expand All @@ -41,7 +41,7 @@ struct aws_mqtt_request_operation_options {
struct aws_mqtt_request_operation_storage {
struct aws_mqtt_request_operation_options options;

struct aws_array_list operation_message_paths;
struct aws_array_list operation_response_paths;

struct aws_byte_buf operation_data;
};
Expand Down Expand Up @@ -113,15 +113,15 @@ AWS_MQTT_API struct aws_mqtt_request_response_client *aws_mqtt_request_response_

AWS_MQTT_API int aws_mqtt_request_response_client_submit_request(
struct aws_mqtt_request_response_client *client,
struct aws_mqtt_request_operation_options *request_options);
const struct aws_mqtt_request_operation_options *request_options);

AWS_MQTT_API struct aws_mqtt_streaming_operation *aws_mqtt_request_response_client_create_streaming_operation(
AWS_MQTT_API struct aws_mqtt_rr_client_operation *aws_mqtt_request_response_client_create_streaming_operation(
struct aws_mqtt_request_response_client *client,
struct aws_mqtt_streaming_operation_options *streaming_options);
const struct aws_mqtt_streaming_operation_options *streaming_options);

AWS_MQTT_API struct aws_mqtt_streaming_operation *aws_mqtt_streaming_operation_acquire(struct aws_mqtt_streaming_operation *operation);
AWS_MQTT_API struct aws_mqtt_rr_client_operation *aws_mqtt_rr_client_operation_acquire(struct aws_mqtt_rr_client_operation *operation);

AWS_MQTT_API struct aws_mqtt_streaming_operation *aws_mqtt_streaming_operation_release(struct aws_mqtt_streaming_operation *operation);
AWS_MQTT_API struct aws_mqtt_rr_client_operation *aws_mqtt_rr_client_operation_release(struct aws_mqtt_rr_client_operation *operation);

AWS_EXTERN_C_END

Expand Down
3 changes: 3 additions & 0 deletions source/mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ bool aws_mqtt_is_valid_topic_filter(const struct aws_byte_cursor *topic_filter)
AWS_DEFINE_ERROR_INFO_MQTT(
AWS_ERROR_MQTT_PROTOCOL_ADAPTER_FAILING_REASON_CODE,
"MQTT operation returned a failing reason code"),
AWS_DEFINE_ERROR_INFO_MQTT(
AWS_ERROR_MQTT_REQUEST_RESPONSE_CLIENT_SHUT_DOWN,
"Request operation failed due to client shut down"),
};
/* clang-format on */
#undef AWS_DEFINE_ERROR_INFO_MQTT
Expand Down
Loading

0 comments on commit f69b09f

Please sign in to comment.