Skip to content

Commit 3ed9bea

Browse files
committed
puback -> publish acknowledgement
1 parent e924c6c commit 3ed9bea

8 files changed

Lines changed: 271 additions & 261 deletions

File tree

include/aws/mqtt/private/v5/mqtt5_client_impl.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,13 @@ struct aws_mqtt5_client_operational_state {
255255
/*
256256
* One more than the most recently used control packet id.
257257
*/
258-
uint64_t next_mqtt5_puback_control_id;
258+
uint64_t next_mqtt5_pub_ack_control_id;
259259
/* These tables are used for fast search of a packet_id and control_id pair. They both set an
260-
* aws_mqtt5_manual_puback_entry as its value */
261-
struct aws_hash_table manual_puback_packet_id_table;
262-
struct aws_hash_table manual_puback_control_id_table;
260+
* aws_mqtt5_manual_pub_ack_entry as its value */
261+
struct aws_hash_table manual_pub_ack_packet_id_table;
262+
struct aws_hash_table manual_pub_ack_control_id_table;
263263
/* This table contains control ids known to be cancelled due to client disconnect for better failure messaging */
264-
struct aws_hash_table manual_puback_cancelled_control_id_table;
264+
struct aws_hash_table manual_pub_ack_cancelled_control_id_table;
265265

266266
struct aws_linked_list queued_operations;
267267
struct aws_mqtt5_operation *current_operation;

include/aws/mqtt/private/v5/mqtt5_options_storage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ struct aws_mqtt5_operation_puback {
102102

103103
struct aws_mqtt5_packet_puback_storage options_storage;
104104

105-
struct aws_mqtt5_manual_puback_completion_options completion_options;
105+
struct aws_mqtt5_manual_publish_acknowledgement_completion_options completion_options;
106106
};
107107

108108
struct aws_mqtt5_operation_disconnect {
@@ -275,7 +275,7 @@ AWS_MQTT_API void aws_mqtt5_packet_publish_view_log(
275275
AWS_MQTT_API struct aws_mqtt5_operation_puback *aws_mqtt5_operation_puback_new(
276276
struct aws_allocator *allocator,
277277
const struct aws_mqtt5_packet_puback_view *puback_options,
278-
const struct aws_mqtt5_manual_puback_completion_options *completion_options);
278+
const struct aws_mqtt5_manual_publish_acknowledgement_completion_options *completion_options);
279279

280280
AWS_MQTT_API void aws_mqtt5_packet_puback_view_log(
281281
const struct aws_mqtt5_packet_puback_view *puback_view,

include/aws/mqtt/v5/mqtt5_client.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,13 @@ typedef void(aws_mqtt5_publish_completion_fn)(
295295
void *complete_ctx);
296296

297297
/**
298-
* Signature of callback invoked when a manual PUBACK operation completes.
298+
* Signature of callback invoked when a manual publish acknowledgement operation completes.
299299
*
300-
* @param puback_result result of the PUBACK operation
300+
* @param puback_result result of the publish acknowledgement operation
301301
* @param completion_user_data user data passed in with the completion options
302302
*/
303-
typedef void(aws_mqtt5_manual_puback_completion_fn)(
304-
enum aws_mqtt5_manual_puback_result puback_result,
303+
typedef void(aws_mqtt5_manual_publish_acknowledgement_completion_fn)(
304+
enum aws_mqtt5_manual_publish_acknowledgement_result publish_acknowledgement_result,
305305
void *completion_user_data);
306306

307307
/**
@@ -356,10 +356,10 @@ struct aws_mqtt5_publish_completion_options {
356356
};
357357

358358
/**
359-
* Completion options for the manual puback operation
359+
* Completion options for the manual publish acknowledgement operation
360360
*/
361-
struct aws_mqtt5_manual_puback_completion_options {
362-
aws_mqtt5_manual_puback_completion_fn *completion_callback;
361+
struct aws_mqtt5_manual_publish_acknowledgement_completion_options {
362+
aws_mqtt5_manual_publish_acknowledgement_completion_fn *completion_callback;
363363
void *completion_user_data;
364364
};
365365

@@ -757,33 +757,33 @@ int aws_mqtt5_client_publish(
757757
const struct aws_mqtt5_publish_completion_options *completion_options);
758758

759759
/**
760-
* Takes manual control of PUBACK for the given PUBLISH packet.
760+
* Takes manual control of publish acknowledgement for the given PUBLISH packet.
761761
*
762762
* This MUST only be called from within the publish received callback. A return value of 0 indicates an
763763
* invalid control id.
764764
*
765-
* @param client mqtt5 client that received the PUBLISH packet to take manual PUBACK control from.
766-
* @param publish_view the view of the PUBLISH packet that PUBACK control is taken from.
767-
* @return puback_control_id of the PUBLISH packet. This can be used to schedule a PUBACK for the PUBLISH packet
768-
* when used with the aws_mqtt5_client_invoke_puback function call.
765+
* @param client mqtt5 client that received the PUBLISH packet to take manual publish acknowledgement control from.
766+
* @param publish_view the view of the PUBLISH packet that publish acknowledgement control is taken from.
767+
* @return pub_ack_control_id of the PUBLISH packet. This can be used to schedule a publish acknowledgement for the
768+
* PUBLISH packet when used with the aws_mqtt5_client_invoke_publish_acknowledgement function call.
769769
*/
770-
AWS_MQTT_API uint64_t aws_mqtt5_client_acquire_puback(
770+
AWS_MQTT_API uint64_t aws_mqtt5_client_acquire_publish_acknowledgement(
771771
struct aws_mqtt5_client *client,
772772
const struct aws_mqtt5_packet_publish_view *publish_view);
773773

774774
/**
775-
* Send PUBACK for provided control id. Callback in completion_options will be invoked with an
776-
* aws_mqtt5_manual_puback_result once a PUBACK operation has been completed.
775+
* Send publish acknowledgement for provided control id. Callback in completion_options will be invoked with an
776+
* aws_mqtt5_manual_publish_acknowledgement_result once a publish acknowledgement operation has been completed.
777777
*
778778
* @param client mqtt5 client to queue a puback for
779-
* @param puback_control_id Control ID of aws_mqtt5_manual_puback_entry to send to broker/server
780-
* @return success/failure of starting the manual PUBACK operation.
779+
* @param pub_ack_control_id Control ID of aws_mqtt5_manual_pub_ack_entry to send to broker/server
780+
* @return success/failure of starting the manual publish acknowledgement operation.
781781
*/
782782
AWS_MQTT_API
783-
int aws_mqtt5_client_invoke_puback(
783+
int aws_mqtt5_client_invoke_publish_acknowledgement(
784784
struct aws_mqtt5_client *client,
785-
uint64_t puback_control_id,
786-
const struct aws_mqtt5_manual_puback_completion_options *completion_options);
785+
uint64_t pub_ack_control_id,
786+
const struct aws_mqtt5_manual_publish_acknowledgement_completion_options *completion_options);
787787

788788
/**
789789
* Queues a Subscribe operation in an mqtt5 client

include/aws/mqtt/v5/mqtt5_types.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ enum aws_mqtt5_puback_reason_code {
144144
* Result for manual PUBACK operations.
145145
*
146146
*/
147-
enum aws_mqtt5_manual_puback_result {
148-
AWS_MQTT5_MPR_SUCCESS = 0,
149-
AWS_MQTT5_MPR_PUBACK_CANCELLED = 1,
150-
AWS_MQTT5_MPR_PUBACK_INVALID = 2,
151-
AWS_MQTT5_MPR_CRT_FAILURE = 3,
147+
enum aws_mqtt5_manual_publish_acknowledgement_result {
148+
AWS_MQTT5_MPAR_SUCCESS = 0,
149+
AWS_MQTT5_MPAR_PUBACK_CANCELLED = 1,
150+
AWS_MQTT5_MPAR_PUBACK_INVALID = 2,
151+
AWS_MQTT5_MPAR_CRT_FAILURE = 3,
152152
};
153153

154154
/**
@@ -456,14 +456,14 @@ struct aws_mqtt5_packet_puback_view {
456456
};
457457

458458
/**
459-
* This is used to track which PUBLISH packets a user has taken manual PUBACK control from.
459+
* This is used to track which PUBLISH packets a user has taken manual publish acknowledgement control from.
460460
*/
461-
struct aws_mqtt5_manual_puback_entry {
461+
struct aws_mqtt5_manual_pub_ack_entry {
462462
struct aws_allocator *allocator;
463463
struct aws_ref_count ref_count;
464464

465465
/* control id for internal tracking */
466-
uint64_t puback_control_id;
466+
uint64_t pub_ack_control_id;
467467
/* packet_id of controlled publish */
468468
uint16_t packet_id;
469469
};

0 commit comments

Comments
 (0)