Skip to content

Commit

Permalink
Indicate how many byte are received by the GetFile function
Browse files Browse the repository at this point in the history
  • Loading branch information
etihwo committed Jan 14, 2018
1 parent 7f78404 commit 3a44a2b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dotnet/IEC61850forCSharp/IEC61850ClientAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1134,21 +1134,23 @@ public GetFileCallback(GetFileHandler handler, object parameter)
/// <param name='parameter'>
/// User provided parameter that is passed to the callback handler
/// </param>
public void GetFile(string fileName, GetFileHandler handler, object parameter)
public uint GetFile(string fileName, GetFileHandler handler, object parameter)
{
int error;


GetFileCallback getFileCallback = new GetFileCallback(handler, parameter);

GCHandle handle = GCHandle.Alloc(getFileCallback);

IedConnection_getFile(connection, out error, fileName, new InternalIedClientGetFileHandler(iedClientGetFileHandler),
uint byteReceived = IedConnection_getFile(connection, out error, fileName, new InternalIedClientGetFileHandler(iedClientGetFileHandler),
GCHandle.ToIntPtr(handle));

if (error != 0)
throw new IedConnectionException("Error reading file", error);

handle.Free();
return byteReceived;
}

/// <summary>
Expand Down

0 comments on commit 3a44a2b

Please sign in to comment.