awslabs / aws-c-mqtt

C99 implementation of the MQTT 3.1.1 specification.
Apache License 2.0
93 stars 29 forks source link

Extra Connection Callbacks in 311 #300

Closed xiazhvera closed 1 year ago

xiazhvera commented 1 year ago

Issue #, if available:

Description of changes: Add on_connection_success and on_connection_failure callbacks for mqtt311 in aws-c-mqtt. The on_connection_success will get triggered with a successful CONNACK (on first connection attempt succeed and on resumed). The on_connection_failed will triggered when connection failed.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 87.50% and project coverage change: +0.19 :tada:

Comparison is base (8e40355) 80.08% compared to head (ed70b11) 80.27%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #300 +/- ## ========================================== + Coverage 80.08% 80.27% +0.19% ========================================== Files 18 18 Lines 7626 7640 +14 ========================================== + Hits 6107 6133 +26 + Misses 1519 1507 -12 ``` | [Impacted Files](https://app.codecov.io/gh/awslabs/aws-c-mqtt/pull/300?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs) | Coverage Δ | | |---|---|---| | [source/mqtt3\_to\_mqtt5\_adapter.c](https://app.codecov.io/gh/awslabs/aws-c-mqtt/pull/300?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c291cmNlL21xdHQzX3RvX21xdHQ1X2FkYXB0ZXIuYw==) | `45.27% <ø> (ø)` | | | [source/client.c](https://app.codecov.io/gh/awslabs/aws-c-mqtt/pull/300?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c291cmNlL2NsaWVudC5j) | `69.67% <84.61%> (+0.63%)` | :arrow_up: | | [source/client\_channel\_handler.c](https://app.codecov.io/gh/awslabs/aws-c-mqtt/pull/300?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c291cmNlL2NsaWVudF9jaGFubmVsX2hhbmRsZXIuYw==) | `70.09% <100.00%> (+1.59%)` | :arrow_up: | | [source/client\_impl\_shared.c](https://app.codecov.io/gh/awslabs/aws-c-mqtt/pull/300?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=awslabs#diff-c291cmNlL2NsaWVudF9pbXBsX3NoYXJlZC5j) | `81.81% <100.00%> (+0.86%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.