.NET Based OPC UA Client/Server SDK
2.5.3.389
|
The interface for methods implemented on the FileModel object. More...
Inherited by UnifiedAutomation.UaServer.FileModel, UnifiedAutomation.UaServer.IAddressSpaceFileMethods, and UnifiedAutomation.UaServer.ITrustListMethods.
Public Member Functions | |
StatusCode | Close (RequestContext context, FileModel model, uint FileHandle) |
Closes a file represented by a UnifiedAutomation.UaServer.FileModel. More... | |
StatusCode | GetPosition (RequestContext context, FileModel model, uint FileHandle, out ulong Position) |
Provides the current position of the FileHandle. More... | |
StatusCode | Open (RequestContext context, FileModel model, byte Mode, out uint FileHandle) |
Opens a file represented by an object of UnifiedAutomation.UaServer.FileModel. More... | |
StatusCode | Read (RequestContext context, FileModel model, uint FileHandle, int Length, out byte[] Data) |
Reads a part of the file starting from the current file position. More... | |
StatusCode | SetPosition (RequestContext context, FileModel model, uint FileHandle, ulong Position) |
Sets the current position of the FileHandle. More... | |
StatusCode | Write (RequestContext context, FileModel model, uint FileHandle, byte[] Data) |
Writes a part of the file starting from the current file position. More... | |
The interface for methods implemented on the FileModel object.
StatusCode UnifiedAutomation.UaServer.IFileMethods.Close | ( | RequestContext | context, |
FileModel | model, | ||
uint | FileHandle | ||
) |
Closes a file represented by a UnifiedAutomation.UaServer.FileModel.
When a client closes a file, the handle becomes invalid.
context | |
model | |
FileHandle | A handle returned by the UnifiedAutomation.UaServer.IFileMethods.Open method, indicating the access request and thus indirectly the position inside the file. |
Implemented in UnifiedAutomation.UaServer.FileModel.
StatusCode UnifiedAutomation.UaServer.IFileMethods.GetPosition | ( | RequestContext | context, |
FileModel | model, | ||
uint | FileHandle, | ||
out ulong | Position | ||
) |
Provides the current position of the FileHandle.
context | |
model | |
FileHandle | A handle returned by the UnifiedAutomation.UaServer.IFileMethods.Open method, indicating the access request and thus indirectly the position inside the file. |
Position | The position of the FileHandle in the file. If UnifiedAutomation.UaServer.IFileMethods.Read or UnifiedAutomation.UaServer.IFileMethods.Write is called, it starts at that position. |
Implemented in UnifiedAutomation.UaServer.FileModel.
StatusCode UnifiedAutomation.UaServer.IFileMethods.Open | ( | RequestContext | context, |
FileModel | model, | ||
byte | Mode, | ||
out uint | FileHandle | ||
) |
Opens a file represented by an object of UnifiedAutomation.UaServer.FileModel.
When a client opens a file, it gets a FileHandle that is valid while the session is open. Clients shall use the UnifiedAutomation.UaServer.IFileMethods.Close method to release the handle when they do not need access to the file anymore. Clients can open the same file several times for reading. A request to open for writing shall return Bad_NotWritable when the file is already opened.
context | ||||||||||||||||
model | ||||||||||||||||
Mode | Indicates whether the file should be opened only for read operations or for read and write operations and where the initial position is set. The mode is an 8-bit unsigned integer used as bit mask with the structure defined in the following table:
| |||||||||||||||
FileHandle | A handle for the file used in other method calls indicating not the file (this is done by the object of the method call) but the access request and thus the position in the file. The FileHandle is generated by the server and is unique for the Session. Clients cannot transfer the FileHandle to another Session but need to get a new FileHandle by calling the UnifiedAutomation.UaServer.IFileMethods.Open method. |
Implemented in UnifiedAutomation.UaServer.TrustListModel, and UnifiedAutomation.UaServer.FileModel.
StatusCode UnifiedAutomation.UaServer.IFileMethods.Read | ( | RequestContext | context, |
FileModel | model, | ||
uint | FileHandle, | ||
int | Length, | ||
out byte[] | Data | ||
) |
Reads a part of the file starting from the current file position.
The file position is advanced by the number of bytes read.
context | |
model | |
FileHandle | A handle returned by the UnifiedAutomation.UaServer.IFileMethods.Open method, indicating the access request and thus indirectly the position inside the file. |
Length | Defines the length in bytes that should be returned in data, starting from the current position of the file handle. If the end of file is reached, all data until the end of the file is returned. The Server is allowed to return less data than the specified length. Only positive values are allowed. |
Data | Contains the returned data of the file. If the ByteString is empty, it indicates that the end of the file is reached. |
Implemented in UnifiedAutomation.UaServer.FileModel.
StatusCode UnifiedAutomation.UaServer.IFileMethods.SetPosition | ( | RequestContext | context, |
FileModel | model, | ||
uint | FileHandle, | ||
ulong | Position | ||
) |
Sets the current position of the FileHandle.
context | |
model | |
FileHandle | A handle indicating the access request and thus indirectly the position inside the file. |
Position | The position to be set for the FileHandle in the file. If UnifiedAutomation.UaServer.IFileMethods.Read or UnifiedAutomation.UaServer.IFileMethods.Write is called, it starts at that position. If the position is higher than the file size, the position is set to the end of the file. |
Implemented in UnifiedAutomation.UaServer.FileModel.
StatusCode UnifiedAutomation.UaServer.IFileMethods.Write | ( | RequestContext | context, |
FileModel | model, | ||
uint | FileHandle, | ||
byte[] | Data | ||
) |
Writes a part of the file starting from the current file position.
The file position is advanced by the number of bytes written
context | |
model | |
FileHandle | A handle returned by the UnifiedAutomation.UaServer.IFileMethods.Open method, indicating the access request and thus indirectly the position inside the file. |
Data | Contains the data to be written at the position of the file. It is server-dependent whether the written data are persistently stored if the session is ended without calling the UnifiedAutomation.UaServer.IFileMethods.Close method with the FileHandle. Writing an empty or null ByteString returns a Good result code without any effect on the file. |
Implemented in UnifiedAutomation.UaServer.FileModel.