From b34a5b7473692d61208285afcef8756521b3176f Mon Sep 17 00:00:00 2001 From: nauful Date: Wed, 17 Apr 2024 07:33:48 -0500 Subject: [PATCH] Fix checking returns for CheckServiceFaultResponse. --- NET Core/LibUA/Client.cs | 46 ++++++++++++++++++------------------- NET Core/LibUA/LibUA.csproj | 2 +- README.md | 2 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/NET Core/LibUA/Client.cs b/NET Core/LibUA/Client.cs index 60b0855..4c6dcc2 100644 --- a/NET Core/LibUA/Client.cs +++ b/NET Core/LibUA/Client.cs @@ -617,7 +617,7 @@ public StatusCode GetEndpoints(out EndpointDescription[] endpointDescs, string[] if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.GetEndpointsResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numEndpointDescs); @@ -716,7 +716,7 @@ public StatusCode FindServers(out ApplicationDescription[] results, string[] loc if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.FindServersResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numDescs); @@ -1916,7 +1916,7 @@ public StatusCode CreateSession(ApplicationDescription appDesc, string sessionNa if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.CreateSessionResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.Decode(out NodeId sessionIdToken); @@ -2021,7 +2021,7 @@ public StatusCode CloseSession() if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.CloseSessionResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } if (!succeeded) @@ -2124,7 +2124,7 @@ public StatusCode Read(ArraySegment Ids, ArraySegment re if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.ReadResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numRecv); @@ -2246,7 +2246,7 @@ public StatusCode Write(ArraySegment Ids, ArraySegment results if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.WriteResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numRecv); @@ -2357,7 +2357,7 @@ public StatusCode AddNodes(AddNodesItem[] addNodesItems, out AddNodesResult[] re if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.AddNodesResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numRecv); @@ -2461,7 +2461,7 @@ public StatusCode DeleteNodes(DeleteNodesItem[] deleteNodesItems, out uint[] res if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.DeleteNodesResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numRecv); @@ -2565,7 +2565,7 @@ public StatusCode AddReferences(AddReferencesItem[] addReferencesItems, out uint if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.AddReferencesResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numRecv); @@ -2669,7 +2669,7 @@ public StatusCode DeleteReferences(DeleteReferencesItem[] deleteReferencesItems, if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.DeleteReferencesResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numRecv); @@ -2782,7 +2782,7 @@ public StatusCode Browse(BrowseDescription[] requests, uint requestedMaxReferenc if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.BrowseResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numRecv); @@ -2900,7 +2900,7 @@ public StatusCode BrowseNext(IList contPoints, bool releaseContinuationP if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.BrowseNextResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } if (!releaseContinuationPoints) @@ -3101,7 +3101,7 @@ public StatusCode HistoryRead(object historyReadDetails, TimestampsToReturn time if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.HistoryReadResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } if (!releaseContinuationPoints) @@ -3272,7 +3272,7 @@ public StatusCode HistoryUpdate(HistoryUpdateData[] requests, out uint[] results if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.HistoryUpdateResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numRecv); @@ -3376,7 +3376,7 @@ public StatusCode TranslateBrowsePathsToNodeIds(BrowsePath[] requests, out Brows if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.TranslateBrowsePathsToNodeIdsResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numRecv); @@ -3486,7 +3486,7 @@ public StatusCode Call(CallMethodRequest[] requests, out CallMethodResult[] resu if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.CallResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numRecv); @@ -3624,7 +3624,7 @@ public StatusCode CreateSubscription(double RequestedPublishingInterval, UInt32 if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.CreateSubscriptionResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.Decode(out result); @@ -3732,7 +3732,7 @@ public StatusCode ModifySubscription(uint subscriptionId, double RequestedPublis if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.ModifySubscriptionResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.Decode(out double revisedPublishInterval); @@ -3828,7 +3828,7 @@ public StatusCode DeleteSubscription(uint[] subscriptionIds, out uint[] results) if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.DeleteSubscriptionsResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numResults); @@ -3927,7 +3927,7 @@ public StatusCode SetPublishingMode(bool PublishingEnabled, uint[] requestIds, o if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.SetPublishingModeResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numResults); @@ -4028,7 +4028,7 @@ public StatusCode CreateMonitoredItems(uint subscriptionId, TimestampsToReturn t if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.CreateMonitoredItemsResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numResults); @@ -4129,7 +4129,7 @@ public StatusCode ModifyMonitoredItems(uint subscriptionId, TimestampsToReturn t if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.ModifyMonitoredItemsResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numResults); @@ -4228,7 +4228,7 @@ public StatusCode DeleteMonitoredItems(uint subscriptionId, uint[] monitorIds, o if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.DeleteMonitoredItemsResponse)) { - CheckServiceFaultResponse(recvHandler); + return CheckServiceFaultResponse(recvHandler); } succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numResults); diff --git a/NET Core/LibUA/LibUA.csproj b/NET Core/LibUA/LibUA.csproj index f049755..28a1b05 100644 --- a/NET Core/LibUA/LibUA.csproj +++ b/NET Core/LibUA/LibUA.csproj @@ -10,7 +10,7 @@ LibUA Core git https://github.com/nauful/libua - 1.0.19 + 1.0.20 README.md LICENSE diff --git a/README.md b/README.md index 048daf0..de4a358 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # LibUA Open-source OPC UA client and server library for .NET Framework and .NET Core based on IEC 62541. Available a library, a demo client and a demo server. Tested and commercially used in industrial applications with commercial vendors' UA servers and clients. -Available as a nuget package for .NET Core (1.0.19): +Available as a nuget package for .NET Core (1.0.20): https://www.nuget.org/packages/nauful-LibUA-core ### Features