Skip to content

Conversation

corollaries
Copy link
Contributor

For a couple of months I've been working on creating a wrapper for the Azure IoT Hub Service SDK as a personal project to learn Rust. Meanwhile I've been keeping an eye on the azure-sdk-for-rust repository as well. Found some similarities and have spent a couple of hours to merge some of the functionality that I've implemented into this repository. Maybe this could be useful for others!

Features

This PR would add support for:

  • Creating an Azure IoT Hub ServiceClient from either:
    • A given connection string from one of the shared access policies.
    • A private key from one of the shared access policies.
    • A previously generated shared access token.
  • Creating a direct method that can be invoked on an IoT Hub Device or an IoT Edge module.

Thoughts

  • The example and code have only been tested on a couple of Linux distributions. If need be, I'd be able to test it on Windows as well.
  • I noticed by sifting through the already existing code that hyper-rustls is being used for hyper TLS support. Unfortunately after some testing I did not manage to get the ServiceClient to work with this due to some server errors. Did not investigate further however and continued using hyper-tls for now, though it did seem to be some problem with hyper-rustls itself.
  • There are two other features that could be merged in the near future if this PR would be found acceptable. Both are already implemented but would need some porting from one repository to the other. I decided to keep this initial PR a bit smaller for now however. Two other features are:
    • Support for device and module twins.
    • Setting the Azure IoT Edge modules configuration.

@ghost
Copy link

ghost commented Oct 28, 2020

CLA assistant check
All CLA requirements met.

Copy link
Contributor

@rylev rylev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Just some nitpicks.

I don't have experience with the iothubs SDK. @MindFlavor, do you mind looking at this as well?

Copy link
Contributor

@MindFlavor MindFlavor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an expert either but it seems fine to me as well.

The only thing I would like to address - but at a later stage - is to try and integrate better the generate_sas_token function in the core crate (to avoid replicating the same logic).

Great work BTW!

@MindFlavor MindFlavor merged commit 3cf1ad7 into Azure:master Nov 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants