Skip to content

Commit

Permalink
fix: IotSharp RPC response topic error. (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
280780363 authored Feb 15, 2023
1 parent bfd22ac commit 6cdac03
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Plugins/Plugin/DeviceThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public void MyMqttClient_OnExcRpc(object? sender, RpcRequest e)

_logger.LogInformation($"{Device.DeviceName}收到RPC,{e}");
RpcResponse rpcResponse = new()
{ DeviceName = e.DeviceName, RequestId = e.RequestId, IsSuccess = false };
{ DeviceName = e.DeviceName, RequestId = e.RequestId, IsSuccess = false, Method = e.Method};
//执行写入变量RPC
if (e.Method.ToLower() == "write")
{
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Plugin/MyMqttClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public async Task ResponseRpcAsync(RpcResponse rpcResponse)
await ResponseIsRpcAsync(new ISRpcResponse
{
DeviceId = rpcResponse.DeviceName,
Method = "Method",
Method = rpcResponse.Method,
ResponseId = rpcResponse.RequestId,
Data = JsonConvert.SerializeObject(new Dictionary<string, object>
{
Expand Down
1 change: 1 addition & 0 deletions Plugins/PluginInterface/RpcResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace PluginInterface
public class RpcResponse
{
public string RequestId { get; set; }
public string Method { get; set; }
public string DeviceName { get; set; }
public bool IsSuccess { get; set; }
public string Description { get; set; }
Expand Down

0 comments on commit 6cdac03

Please sign in to comment.