https://github.com/awslabs/aws-c-mqtt

C99 implementation of the MQTT 3.1.1 specification.

https://github.com/awslabs/aws-c-mqtt

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.5%) to scientific vocabulary

Keywords

hacktoberfest mqtt

Keywords from Contributors

aws-sdk embedded
Last synced: 10 months ago · JSON representation

Repository

C99 implementation of the MQTT 3.1.1 specification.

Basic Info
  • Host: GitHub
  • Owner: awslabs
  • License: apache-2.0
  • Language: C
  • Default Branch: main
  • Homepage:
  • Size: 1.89 MB
Statistics
  • Stars: 99
  • Watchers: 22
  • Forks: 36
  • Open Issues: 4
  • Releases: 115
Topics
hacktoberfest mqtt
Created almost 8 years ago · Last pushed 12 months ago
Metadata Files
Readme Contributing License Code of conduct

README.md

AWS C MQTT

C99 implementation of the MQTT 3.1.1 and MQTT 5 specifications.

License

This library is licensed under the Apache 2.0 License.

Usage

Building

CMake 3.9+ is required to build.

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

Linux-Only Dependencies

If you are building on Linux, you will need to build aws-lc and s2n-tls first.

``` git clone git@github.com:awslabs/aws-lc.git cmake -S aws-lc -B aws-lc/build -DCMAKEINSTALLPREFIX= cmake --build aws-lc/build --target install

git clone git@github.com:aws/s2n-tls.git cmake -S s2n-tls -B s2n-tls/build -DCMAKEINSTALLPREFIX= -DCMAKEPREFIXPATH= cmake --build s2n-tls/build --target install ```

Building aws-c-mqtt and Remaining Dependencies

``` git clone git@github.com:awslabs/aws-c-common.git cmake -S aws-c-common -B aws-c-common/build -DCMAKEINSTALLPREFIX= cmake --build aws-c-common/build --target install

git clone git@github.com:awslabs/aws-c-cal.git cmake -S aws-c-cal -B aws-c-cal/build -DCMAKEINSTALLPREFIX= -DCMAKEPREFIXPATH= cmake --build aws-c-cal/build --target install

git clone git@github.com:awslabs/aws-c-io.git cmake -S aws-c-io -B aws-c-io/build -DCMAKEINSTALLPREFIX= -DCMAKEPREFIXPATH= cmake --build aws-c-io/build --target install

git clone git@github.com:awslabs/aws-c-compression.git cmake -S aws-c-compression -B aws-c-compression/build -DCMAKEINSTALLPREFIX= -DCMAKEPREFIXPATH= cmake --build aws-c-compression/build --target install

git clone git@github.com:awslabs/aws-c-http.git cmake -S aws-c-http -B aws-c-http/build -DCMAKEINSTALLPREFIX= -DCMAKEPREFIXPATH= cmake --build aws-c-http/build --target install

git clone git@github.com:awslabs/aws-c-mqtt.git cmake -S aws-c-mqtt -B aws-c-mqtt/build -DCMAKEINSTALLPREFIX= -DCMAKEPREFIXPATH= cmake --build aws-c-mqtt/build --target install ```

Overview

This library contains an MQTT implementation that is simple and easy to use, but also quite powerful and low on unnecessary copies. Here is a general overview of the API:

struct aws_mqtt_client;

aws_mqtt_client is meant to be created once per application to pool common resources required for opening MQTT connections. The instance does not need to be allocated, and may be managed by the user.

c int aws_mqtt_client_init( struct aws_mqtt_client *client, struct aws_allocator *allocator, struct aws_event_loop_group *elg); Initializes an instance of aws_mqtt_client with the required parameters. * client is effectively the this parameter. * allocator will be used to initialize the client (note that the client itself is NOT allocated). This resource must outlive client. * bootstrap will be used to initiate new socket connections MQTT. This resource must outlive client. See aws-c-io for more information about aws_client_bootstrap.

c void aws_mqtt_client_clean_up(struct aws_mqtt_client *client); Cleans up a client and frees all owned resources.

NOTE: DO NOT CALL THIS FUNCTION UNTIL ALL OUTSTANDING CONNECTIONS ARE CLOSED.

struct aws_mqtt_client_connection;

c struct aws_mqtt_client_connection *aws_mqtt_client_connection_new( struct aws_mqtt_client *client, struct aws_mqtt_client_connection_callbacks callbacks, const struct aws_byte_cursor *host_name, uint16_t port, struct aws_socket_options *socket_options, struct aws_tls_ctx_options *tls_options); Allocates and initializes a new connection object (does NOT actually connect). You may use the returned object to configure connection parameters, and then call aws_mqtt_client_connection_connect to actually open the connection. * client is required in order to use an existing DNS resolver, event loop group, and allocator. * callbacks provides the connection-level (not operation level) callbacks and the userdata to be given back. * host_name lists the end point to connect to. This may be a DNS address or an IP address. This resource may be freed immediately after return. * port the port to connect to on host_name. * socket_options describes how to open the connection. See aws-c-io for more information about aws_socket_options. * tls_options provides TLS credentials to connect with. Pass NULL to not use TLS (NOT RECOMMENDED). See aws-c-io for more information about aws_tls_ctx_options.

c void aws_mqtt_client_connection_destroy(struct aws_mqtt_client_connection *connection); Destroys a connection and frees all outstanding resources.

NOTE: DO NOT CALL THIS FUNCTION UNTIL THE CONNECTION IS CLOSED.

c int aws_mqtt_client_connection_set_will( struct aws_mqtt_client_connection *connection, const struct aws_byte_cursor *topic, enum aws_mqtt_qos qos, bool retain, const struct aws_byte_cursor *payload); Sets the last will and testament to be distributed by the server upon client disconnection. Must be called before aws_mqtt_client_connection_connect. See aws_mqtt_client_connection_publish for information on the parameters. topic and payload must persist past the call to aws_mqtt_client_connection_connect.

c int aws_mqtt_client_connection_set_login( struct aws_mqtt_client_connection *connection, const struct aws_byte_cursor *username, const struct aws_byte_cursor *password); Sets the username and password to be sent to the server on connection. Must be called before aws_mqtt_client_connection_connect. username and password must persist past the call to aws_mqtt_client_connection_connect.

c int aws_mqtt_client_connection_set_reconnect_timeout( struct aws_mqtt_client_connection *connection, uint64_t min_timeout, uint64_t max_timeout); Sets the minimum and maximum reconnect timeouts. The time between reconnect attempts will start at min and multipy by 2 until max is reached.

c int aws_mqtt_client_connection_connect( struct aws_mqtt_client_connection *connection, const struct aws_byte_cursor *client_id, bool clean_session, uint16_t keep_alive_time); Connects to the remote endpoint. The parameters here are set in the MQTT CONNECT packet directly. client_id must persist until the on_connack connection callback is called.

c int aws_mqtt_client_connection_disconnect(struct aws_mqtt_client_connection *connection); Closes an open connection. Does not clean up any resources, that's to be done by aws_mqtt_client_connection_destroy, probably from the on_disconnected connection callback.

c uint16_t aws_mqtt_client_connection_subscribe_single( struct aws_mqtt_client_connection *connection, const struct aws_byte_cursor *topic_filter, enum aws_mqtt_qos qos, aws_mqtt_client_publish_received_fn *on_publish, void *on_publish_ud, aws_mqtt_suback_single_fn *on_suback, void *on_suback_ud); Subscribes to the topic filter given with the given QoS. on_publish will be called whenever a packet matching topic_filter arrives. on_suback will be called when the SUBACK packet has been received. topic_filter must persist until on_suback is called. The packet_id of the SUBSCRIBE packet will be returned, or 0 on error.

c uint16_t aws_mqtt_client_connection_unsubscribe( struct aws_mqtt_client_connection *connection, const struct aws_byte_cursor *topic_filter, aws_mqtt_op_complete_fn *on_unsuback, void *on_unsuback_ud); Unsubscribes from the topic filter given. topic_filter must persist until on_unsuback is called. The packet_id of the UNSUBSCRIBE packet will be returned, or 0 on error.

c uint16_t aws_mqtt_client_connection_publish( struct aws_mqtt_client_connection *connection, const struct aws_byte_cursor *topic, enum aws_mqtt_qos qos, bool retain, const struct aws_byte_cursor *payload, aws_mqtt_op_complete_fn *on_complete, void *userdata); Publish a payload to the topic specified. For QoS 0, on_complete will be called as soon as the packet is sent over the wire. For QoS 1, as soon as PUBACK comes back. For QoS 2, PUBCOMP. topic and payload must persist until on_complete.

c int aws_mqtt_client_connection_ping(struct aws_mqtt_client_connection *connection); Sends a PINGREQ packet to the server.

Owner

  • Name: Amazon Web Services - Labs
  • Login: awslabs
  • Kind: organization
  • Location: Seattle, WA

AWS Labs

GitHub Events

Total
  • Release event: 7
  • Watch event: 6
  • Delete event: 31
  • Issue comment event: 22
  • Push event: 104
  • Pull request review comment event: 22
  • Pull request review event: 40
  • Pull request event: 54
  • Fork event: 3
  • Create event: 34
Last Year
  • Release event: 7
  • Watch event: 6
  • Delete event: 31
  • Issue comment event: 22
  • Push event: 104
  • Pull request review comment event: 22
  • Pull request review event: 40
  • Pull request event: 54
  • Fork event: 3
  • Create event: 34

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 309
  • Total Committers: 24
  • Avg Commits per committer: 12.875
  • Development Distribution Score (DDS): 0.767
Past Year
  • Commits: 24
  • Committers: 9
  • Avg Commits per committer: 2.667
  • Development Distribution Score (DDS): 0.667
Top Committers
Name Email Commits
Bret Ambrose b****e@g****m 72
Colden Cullen c****n@c****m 61
Michael Graeb g****m@a****m 31
Jonathan M. Henson j****n@g****m 23
TwistedTwigleg n****d@a****m 20
Dengke Tang 8****5@q****m 20
Steve Kim 8****K 13
Justin Boswell b****j@a****m 11
xiazhvera z****a@a****m 11
Igor Abdrakhimov o****c@g****m 10
James Siri j****i@a****m 7
Waqar Ahmed Khan w****7@g****m 5
Justin Boswell j****l@g****m 5
rccarper 5****r 3
Zach Giordano 7****s 3
Dmitriy Musatkin 6****n 3
Joseph Klix j****x@g****m 3
Alfred G 2****g 2
0xflotus 0****s@g****m 1
Alex Weibel a****l@a****m 1
Andrew Tang t****1@1****m 1
Ashish Dhingra 6****a 1
Ian Botsford 8****f 1
Yasmine Talby 1****y 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 18
  • Total pull requests: 232
  • Average time to close issues: 2 months
  • Average time to close pull requests: about 1 month
  • Total issue authors: 14
  • Total pull request authors: 22
  • Average comments per issue: 2.61
  • Average comments per pull request: 0.8
  • Merged pull requests: 153
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 56
  • Average time to close issues: 19 minutes
  • Average time to close pull requests: 9 days
  • Issue authors: 1
  • Pull request authors: 11
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.68
  • Merged pull requests: 34
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • overheat (3)
  • thomas-roos (2)
  • NickDarvey (1)
  • massi-ang (1)
  • h-vetinari (1)
  • rym002 (1)
  • TingDaoK (1)
  • Octogonapus (1)
  • egorpugin (1)
  • nunotexbsd (1)
  • yonas (1)
  • r7vme (1)
  • NAICOLAS (1)
Pull Request Authors
  • bretambrose (102)
  • xiazhvera (32)
  • sbSteveK (26)
  • TwistedTwigleg (22)
  • sfod (16)
  • graebm (12)
  • TingDaoK (10)
  • DmitriyMusatkin (6)
  • waahm7 (5)
  • jmklix (3)
  • Octogonapus (3)
  • alfred2g (3)
  • ashishdhingra (2)
  • r-burns (2)
  • ianbotsf (2)
Top Labels
Issue Labels
needs-triage (3) feature-request (3) bug (1) documentation (1) pending-release (1) p3 (1)
Pull Request Labels
Cmake (2)

Packages

  • Total packages: 15
  • Total downloads:
    • homebrew 3,921 last-month
  • Total dependent packages: 7
    (may contain duplicates)
  • Total dependent repositories: 23
    (may contain duplicates)
  • Total versions: 88
  • Total maintainers: 3
alpine-v3.18: aws-c-mqtt

AWS C99 implementation of the MQTT 3.1.1 specification

  • Versions: 5
  • Dependent Packages: 3
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 10.3%
Stargazers count: 20.3%
Forks count: 20.7%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.18: aws-c-mqtt-dev

AWS C99 implementation of the MQTT 3.1.1 specification (development files)

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 10.3%
Stargazers count: 20.3%
Forks count: 20.7%
Maintainers (1)
Last synced: 11 months ago
alpine-edge: aws-c-mqtt-dev

AWS C99 implementation of the MQTT 3.1.1 specification (development files)

  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 14.5%
Dependent packages count: 14.6%
Forks count: 21.4%
Stargazers count: 22.0%
Maintainers (1)
Last synced: 11 months ago
alpine-edge: aws-c-mqtt

AWS C99 implementation of the MQTT 3.1.1 specification

  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 14.5%
Dependent packages count: 14.6%
Forks count: 21.4%
Stargazers count: 22.0%
Maintainers (1)
Last synced: 11 months ago
conda-forge.org: aws-c-mqtt
  • Versions: 8
  • Dependent Packages: 2
  • Dependent Repositories: 23
Rankings
Dependent repos count: 7.6%
Dependent packages count: 19.6%
Average: 24.6%
Forks count: 34.8%
Stargazers count: 36.5%
Last synced: 11 months ago
formulae.brew.sh: aws-c-mqtt

C99 implementation of the MQTT 3.1.1 specification

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 3,921 Last month
Rankings
Dependent packages count: 17.9%
Average: 45.5%
Dependent repos count: 52.0%
Downloads: 66.5%
Last synced: 11 months ago
anaconda.org: aws-c-mqtt

C99 implementation of the MQTT 3.1.1 and MQTT 5 specifications.

  • Versions: 4
  • Dependent Packages: 2
  • Dependent Repositories: 0
Rankings
Dependent packages count: 50.7%
Average: 55.2%
Dependent repos count: 59.6%
Last synced: 11 months ago
alpine-v3.19: aws-c-mqtt

AWS C99 implementation of the MQTT 3.1.1 specification

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Last synced: 11 months ago
alpine-v3.19: aws-c-mqtt-dev

AWS C99 implementation of the MQTT 3.1.1 specification (development files)

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Last synced: 11 months ago
alpine-v3.22: aws-c-mqtt-dev

AWS C99 implementation of the MQTT 3.1.1 specification (development files)

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.21: aws-c-mqtt-dev

AWS C99 implementation of the MQTT 3.1.1 specification (development files)

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.20: aws-c-mqtt-dev

AWS C99 implementation of the MQTT 3.1.1 specification (development files)

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Last synced: 11 months ago
alpine-v3.21: aws-c-mqtt

AWS C99 implementation of the MQTT 3.1.1 specification

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 11 months ago
alpine-v3.20: aws-c-mqtt

AWS C99 implementation of the MQTT 3.1.1 specification

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Last synced: 11 months ago
alpine-v3.22: aws-c-mqtt

AWS C99 implementation of the MQTT 3.1.1 specification

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Dependent packages count: 0.0%
Average: 100%
Maintainers (1)
Last synced: 11 months ago

Dependencies

.github/workflows/clang-format.yml actions
  • DoozyX/clang-format-lint-action v0.3.1 composite
  • actions/checkout v1 composite
.github/workflows/codecov.yml actions
  • actions/checkout v3 composite
.github/workflows/ci.yml actions
.github/workflows/closed-issue-message.yml actions
  • aws-actions/closed-issue-message v1 composite
.github/workflows/handle-stale-discussions.yml actions
  • aws-github-ops/handle-stale-discussions v1 composite
.github/workflows/stale_issue.yml actions
  • aws-actions/stale-issue-cleanup v3 composite