UA Bundle SDK .NET
2.4.0.361
|
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) |
Close is used to close a file represented by a FileType. When a client closes a file, the handle becomes invalid. More... | |
StatusCode | GetPosition (RequestContext context, FileModel model, uint FileHandle, out ulong Position) |
GetPosition is used to provide the current position of the FileHandle. More... | |
StatusCode | Open (RequestContext context, FileModel model, byte Mode, out uint FileHandle) |
Used to open a file represented by an Object of FileType. More... | |
StatusCode | Read (RequestContext context, FileModel model, uint FileHandle, int Length, out byte[] Data) |
Read is used to read a part of the file starting from the current file position. More... | |
StatusCode | SetPosition (RequestContext context, FileModel model, uint FileHandle, ulong Position) |
Used to set the current position of the FileHandle. More... | |
StatusCode | Write (RequestContext context, FileModel model, uint FileHandle, byte[] Data) |
Write is used to write 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 | ||
) |
Close is used to close a file represented by a FileType. When a client closes a file, the handle becomes invalid.
context | |
model | |
FileHandle | A handle 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 | ||
) |
GetPosition is used to provide 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 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 | ||
) |
Used to open a file represented by an Object of FileType.
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 | ||
) |
Read is used to read 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 indicating the access request and thus indirectly the position inside the file. |
Length | Defines the length in byte that should be returned in data, starting from the current position of the file handle. If the end of file is reached, only all data till the end of the file are returned. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size are returned. Only positive values are allowed. |
Data | Contains the returned data of the file. |
Implemented in UnifiedAutomation.UaServer.FileModel.
StatusCode UnifiedAutomation.UaServer.IFileMethods.SetPosition | ( | RequestContext | context, |
FileModel | model, | ||
uint | FileHandle, | ||
ulong | Position | ||
) |
Used to set 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 | ||
) |
Write is used to write 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 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. |
Implemented in UnifiedAutomation.UaServer.FileModel.