Skip to content

Commit cf5bf36

Browse files
authored
azure_iot_hub (#444)
1 parent 987ab22 commit cf5bf36

30 files changed

+168
-168
lines changed

sdk/iothub/Cargo.toml renamed to sdk/iot_hub/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "iothub"
2+
name = "iot_hub"
33
version = "0.1.0"
44
authors = ["Microsoft Corp."]
55
edition = "2018"

sdk/iot_hub/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Azure SDK for Rust - Azure iot_hub crate
2+
3+
Azure iot_hub crate for the unofficial Microsoft Azure SDK for Rust. This crate is part of a collection of crates: for more information please refer to [https://github.com/azure/azure-sdk-for-rust](https://github.com/azure/azure-sdk-for-rust).

sdk/iothub/examples/device_identity.rs renamed to sdk/iot_hub/examples/device_identity.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use iothub::service::resources::{AuthenticationMechanism, DesiredCapability, Status};
2-
use iothub::service::ServiceClient;
1+
use iot_hub::service::resources::{AuthenticationMechanism, DesiredCapability, Status};
2+
use iot_hub::service::ServiceClient;
33
use std::error::Error;
44

55
#[tokio::main]
66
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
7-
let iothub_connection_string = std::env::var("IOTHUB_CONNECTION_STRING")
7+
let iot_hub_connection_string = std::env::var("IOTHUB_CONNECTION_STRING")
88
.expect("Set env variable IOTHUB_CONNECTION_STRING first!");
99

1010
let device_id = std::env::args()
@@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
1414
println!("Getting device twin for device '{}'", device_id);
1515
let http_client = azure_core::new_http_client();
1616
let service_client =
17-
ServiceClient::from_connection_string(http_client, iothub_connection_string, 3600)?;
17+
ServiceClient::from_connection_string(http_client, iot_hub_connection_string, 3600)?;
1818
let device = service_client
1919
.create_device_identity()
2020
.execute(

sdk/iothub/examples/directmethod.rs renamed to sdk/iot_hub/examples/directmethod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use iothub::service::ServiceClient;
1+
use iot_hub::service::ServiceClient;
22
use serde_json;
33
use std::error::Error;
44

55
#[tokio::main]
66
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
7-
let iothub_connection_string = std::env::var("IOTHUB_CONNECTION_STRING")
7+
let iot_hub_connection_string = std::env::var("IOTHUB_CONNECTION_STRING")
88
.expect("Set env variable IOTHUB_CONNECTION_STRING first!");
99

1010
let device_id = std::env::args()
@@ -25,10 +25,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
2525

2626
let http_client = azure_core::new_http_client();
2727
let service_client =
28-
ServiceClient::from_connection_string(http_client, iothub_connection_string, 3600)?;
28+
ServiceClient::from_connection_string(http_client, iot_hub_connection_string, 3600)?;
2929
println!(
3030
"Sending direct method {} to {}:{} on: {}",
31-
method_name, device_id, module_id, service_client.iothub_name
31+
method_name, device_id, module_id, service_client.iot_hub_name
3232
);
3333

3434
let direct_method =

sdk/iothub/examples/gettwin.rs renamed to sdk/iot_hub/examples/gettwin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
use iothub::service::ServiceClient;
1+
use iot_hub::service::ServiceClient;
22
use std::error::Error;
33

44
#[tokio::main]
55
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
6-
let iothub_connection_string = std::env::var("IOTHUB_CONNECTION_STRING")
6+
let iot_hub_connection_string = std::env::var("IOTHUB_CONNECTION_STRING")
77
.expect("Set env variable IOTHUB_CONNECTION_STRING first!");
88

99
let device_id = std::env::args()
@@ -14,7 +14,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
1414

1515
let http_client = azure_core::new_http_client();
1616
let service_client =
17-
ServiceClient::from_connection_string(http_client, iothub_connection_string, 3600)?;
17+
ServiceClient::from_connection_string(http_client, iot_hub_connection_string, 3600)?;
1818
let twin = service_client.get_device_twin(device_id).await?;
1919

2020
println!("Received device twin: {:?}", twin);

sdk/iothub/examples/module_identity.rs renamed to sdk/iot_hub/examples/module_identity.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use iothub::service::resources::AuthenticationMechanism;
2-
use iothub::service::ServiceClient;
1+
use iot_hub::service::resources::AuthenticationMechanism;
2+
use iot_hub::service::ServiceClient;
33
use std::error::Error;
44

55
#[tokio::main]
66
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
7-
let iothub_connection_string = std::env::var("IOTHUB_CONNECTION_STRING")
7+
let iot_hub_connection_string = std::env::var("IOTHUB_CONNECTION_STRING")
88
.expect("Set env variable IOTHUB_CONNECTION_STRING first!");
99

1010
let device_id = std::env::args()
@@ -17,7 +17,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
1717

1818
let http_client = azure_core::new_http_client();
1919
let service_client =
20-
ServiceClient::from_connection_string(http_client, iothub_connection_string, 3600)?;
20+
ServiceClient::from_connection_string(http_client, iot_hub_connection_string, 3600)?;
2121
let module = service_client
2222
.create_module_identity()
2323
.execute(

sdk/iothub/examples/query_iothub.rs renamed to sdk/iot_hub/examples/query_iothub.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
use iothub::service::ServiceClient;
1+
use iot_hub::service::ServiceClient;
22
use std::error::Error;
33

44
#[tokio::main]
55
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
66
env_logger::init();
77

8-
let iothub_connection_string = std::env::var("IOTHUB_CONNECTION_STRING")
8+
let iot_hub_connection_string = std::env::var("IOTHUB_CONNECTION_STRING")
99
.expect("Set env variable IOTHUB_CONNECTION_STRING first!");
1010

1111
let query = "SELECT * FROM devices";
1212
println!("Invoking query '{}' on the IoT Hub", query);
1313

1414
let http_client = azure_core::new_http_client();
1515
let service_client =
16-
ServiceClient::from_connection_string(http_client, iothub_connection_string, 3600)?;
16+
ServiceClient::from_connection_string(http_client, iot_hub_connection_string, 3600)?;
1717

1818
let response = service_client
1919
.query()

sdk/iothub/examples/updatetwin.rs renamed to sdk/iot_hub/examples/updatetwin.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use iothub::service::ServiceClient;
1+
use iot_hub::service::ServiceClient;
22
use serde_json;
33
use std::error::Error;
44

55
#[tokio::main]
66
async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
7-
let iothub_connection_string = std::env::var("IOTHUB_CONNECTION_STRING")
7+
let iot_hub_connection_string = std::env::var("IOTHUB_CONNECTION_STRING")
88
.expect("Set env variable IOTHUB_CONNECTION_STRING first!");
99

1010
let device_id = std::env::args()
@@ -19,7 +19,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
1919
let http_client = azure_core::new_http_client();
2020

2121
let service_client =
22-
ServiceClient::from_connection_string(http_client, iothub_connection_string, 3600)?;
22+
ServiceClient::from_connection_string(http_client, iot_hub_connection_string, 3600)?;
2323
let updated_twin = service_client
2424
.update_device_twin(device_id)
2525
.properties(serde_json::from_str(&payload)?)
File renamed without changes.

0 commit comments

Comments
 (0)