Skip to content

Conversation

corollaries
Copy link
Contributor

This PR adds support for most twin related operations for the IoT Hub Service SDK.

Added

  • get_module_twin, get_device_twin, update_module_twin, replace_module_twin, update_device_twin, replace_device_twin functions to iothub::ServiceClient.
  • Structs/Enums for common types found in the module twin or device twin.
  • Examples for getting the device twin and updating the device twin.

Discussion

  • I've tried keeping DesiredTwinBuilder generic so it can be used for both updating module and device twins. As to hide some details for the user (mainly the return type of execute which returns the ModuleTwin when updating modules and DeviceTwin for updating the devices) I had to resort to using std::marker::PhantomData in the DesiredTwinBuilder. I'm not too sure about that in particular, but couldn't find another way of doing this neatly.

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.

Excellent work! Thank you!

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.

Looking good, but I have some questions before I'd be ready to merge this.

@corollaries corollaries force-pushed the feature/corollaries/implement-twin branch from 38a9e29 to b214734 Compare November 16, 2020 19:02
@corollaries corollaries force-pushed the feature/corollaries/implement-twin branch from b214734 to 3715842 Compare November 16, 2020 19:04
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.

Awesome stuff. I've noted a few nits that you might consider addressing, but we can also merge as is. 🎉

@MindFlavor MindFlavor merged commit 7d684b4 into Azure:master Nov 23, 2020
@corollaries corollaries deleted the feature/corollaries/implement-twin branch December 6, 2020 18:12
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