Skip to content

Commit

Permalink
Fix checking returns for CheckServiceFaultResponse.
Browse files Browse the repository at this point in the history
  • Loading branch information
nauful committed Apr 17, 2024
1 parent e36f62c commit b34a5b7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
46 changes: 23 additions & 23 deletions NET Core/LibUA/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -2021,7 +2021,7 @@ public StatusCode CloseSession()

if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.CloseSessionResponse))
{
CheckServiceFaultResponse(recvHandler);
return CheckServiceFaultResponse(recvHandler);
}

if (!succeeded)
Expand Down Expand Up @@ -2124,7 +2124,7 @@ public StatusCode Read(ArraySegment<ReadValueId> Ids, ArraySegment<DataValue> re

if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.ReadResponse))
{
CheckServiceFaultResponse(recvHandler);
return CheckServiceFaultResponse(recvHandler);
}

succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numRecv);
Expand Down Expand Up @@ -2246,7 +2246,7 @@ public StatusCode Write(ArraySegment<WriteValue> Ids, ArraySegment<uint> results

if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.WriteResponse))
{
CheckServiceFaultResponse(recvHandler);
return CheckServiceFaultResponse(recvHandler);
}

succeeded &= recvHandler.RecvBuf.DecodeArraySize(out uint numRecv);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -2900,7 +2900,7 @@ public StatusCode BrowseNext(IList<byte[]> contPoints, bool releaseContinuationP

if (!recvHandler.Type.EqualsNumeric(0, (uint)RequestCode.BrowseNextResponse))
{
CheckServiceFaultResponse(recvHandler);
return CheckServiceFaultResponse(recvHandler);
}

if (!releaseContinuationPoints)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion NET Core/LibUA/LibUA.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Title>LibUA Core</Title>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/nauful/libua</RepositoryUrl>
<Version>1.0.19</Version>
<Version>1.0.20</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit b34a5b7

Please sign in to comment.