-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make DirectMethodPrequest.Payload to be settable by client applicatio…
…ns (#3317)
- Loading branch information
1 parent
6489070
commit d6a4c3c
Showing
19 changed files
with
85 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
iothub/device/src/DirectMethod/EdgeModuleDirectMethodRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.Azure.Devices.Client | ||
{ | ||
/// <summary> | ||
/// Parameters to execute a direct method on an edge device or an edge module by an <see cref="IotHubModuleClient"/>. | ||
/// </summary> | ||
public class EdgeModuleDirectMethodRequest : DirectMethodRequest | ||
{ | ||
/// <summary> | ||
/// A direct method request to be initialized by the client application when using an <see cref="IotHubModuleClient"/> for invoking | ||
/// a direct method on an edge device or an edge module connected to the same edge hub. | ||
/// </summary> | ||
/// <param name="methodName">The method name to invoke.</param> | ||
public EdgeModuleDirectMethodRequest(string methodName) | ||
: this(methodName, null) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// A direct method request to be initialized by the client application when using an <see cref="IotHubModuleClient"/> for invoking | ||
/// a direct method on an edge device or an edge module connected to the same edge hub. | ||
/// </summary> | ||
/// <param name="methodName">The method name to invoke.</param> | ||
/// <param name="payload">The direct method payload bytes.</param> | ||
public EdgeModuleDirectMethodRequest(string methodName, byte[] payload) | ||
: base(methodName) | ||
{ | ||
Payload = payload; | ||
} | ||
|
||
/// <summary> | ||
/// A direct method request to be initialized by the client application when using an <see cref="IotHubModuleClient"/> for invoking | ||
/// a direct method on an edge device or an edge module connected to the same edge hub. | ||
/// </summary> | ||
/// <param name="methodName">The method name to invoke.</param> | ||
/// <param name="payload">The direct method payload that will be serialized and encoded per <see cref="IotHubClientOptions.PayloadConvention"/>.</param> | ||
public EdgeModuleDirectMethodRequest(string methodName, object payload) | ||
: base(methodName) | ||
{ | ||
Payload = payload == null | ||
? null | ||
: PayloadConvention.GetObjectBytes(payload); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.