- added documentation to HandleSet functions

This commit is contained in:
Michael Zillgith 2014-12-18 18:12:02 +01:00
parent ad89a0f26a
commit 91b9c2c64b
7 changed files with 61 additions and 11 deletions

View file

@ -111,7 +111,10 @@ namespace IEC61850
static extern IntPtr IedConnection_getLogicalNodeDirectory (IntPtr self, out int error, string logicalNodeReference, int acsiClass);
[DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)]
static extern IntPtr IedConnection_getServerDirectory (IntPtr self, out int error, bool getFileNames);
static extern IntPtr IedConnection_getServerDirectory (IntPtr self, out int error, bool getFileNames);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void IedConnection_getDeviceModelFromServer(IntPtr self, out int error);
[DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)]
static extern IntPtr IedConnection_getLogicalDeviceDirectory (IntPtr self, out int error, string logicalDeviceName);
@ -253,7 +256,17 @@ namespace IEC61850
ControlObject controlObject = new ControlObject (objectReference, connection, this);
return controlObject;
}
}
public void UpdateDeviceModel()
{
int error;
IedConnection_getDeviceModelFromServer(connection, out error);
if (error != 0)
throw new IedConnectionException("UpdateDeviceModel failed", error);
}
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
public List<string> GetServerDirectory (bool fileDirectory = false)

View file

@ -30,6 +30,10 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />

View file

@ -54,15 +54,44 @@ typedef struct sSocket* Socket;
/** Opaque reference for a set of server and socket handles */
typedef struct sHandleSet* HandleSet;
/**
* \brief Create a new connection handle set (HandleSet)
*
* \return new HandleSet instance
*/
HandleSet
Handleset_new(void);
/**
* \brief add a soecket to an existing handle set
*
* \param self the HandleSet instance
* \param sock the socket to add
*/
void
Handleset_addSocket(HandleSet self, const Socket sock);
/**
* \brief wait for a socket to become ready
*
* This function is corresponding to the BSD socket select function.
* It returns the number of sockets on which data is pending or 0 if no data is pending
* on any of the monitored connections. The function will return after "timeout" ms if no
* data is pending.
* The function shall return -1 if a socket error occures.
*
* \param self the HandleSet instance
* \oaram timeout in milliseconds (ms)
*/
int
Handleset_waitReady(HandleSet self, unsigned int timeoutMs);
/**
* \brief destroy the HandleSet instance
*
* \param self the HandleSet instance to destroy
*/
void
Handleset_destroy(HandleSet self);

View file

@ -89,7 +89,7 @@ Handleset_waitReady(HandleSet self, unsigned int timeoutMs)
{
int result;
if (self != NULL && self->maxHandle >= 0) {
if ((self != NULL) && (self->maxHandle >= 0)) {
struct timeval timeout;
timeout.tv_sec = timeoutMs / 1000;

View file

@ -966,9 +966,8 @@ IedConnection_getDeviceModelFromServer(IedConnection self, IedClientError* error
LinkedList_destroy(logicalDeviceNames);
}
else {
else
*error = iedConnection_mapMmsErrorToIedError(mmsError);
}
}
LinkedList /*<char*>*/

View file

@ -607,13 +607,16 @@ typedef void (*ReportCallbackFunction) (void* parameter, ClientReport report);
/**
* \brief Install a report handler function for the specified report control block (RCB)
*
* It is important that you provide a ClientDataSet instance that is already populated with an MmsValue object
* of type MMS_STRUCTURE that contains the data set entries as structure elements. This is required because otherwise
* the report handler is not able to correctly parse the report message from the server.
* This function will replace a report handler set earlier for the specified RCB. The report handler
* will be called whenever a report for the specified RCB is received.
* Please note that this function should be called whenever the RCB data set is changed or updated.
* Otherwise the internal data structures storing the received data set values will not be updated
* correctly.
*
* This function will replace a formerly set report handler function for the specified RCB.
* When replacing a report handler you only have to call this function. There is no separate call to
* IedConnection_uninstallReportHandler() required.
*
* \param connection the connection object
* \param self the connection object
* \param rcbReference object reference of the report control block
* \param rptId a string that identifies the report. If the rptId is not available then the
* rcbReference is used to identify the report.
@ -626,6 +629,9 @@ IedConnection_installReportHandler(IedConnection self, char* rcbReference, char*
/**
* \brief uninstall a report handler function for the specified report control block (RCB)
*
* \param self the connection object
* \param rcbReference object reference of the report control block
*/
void
IedConnection_uninstallReportHandler(IedConnection self, char* rcbReference);

View file

@ -328,7 +328,6 @@ sendReport(ReportControl* self, bool isIntegrity, bool isGI)
if (self->inclusionFlags[i] != REPORT_CONTROL_NONE)
addReferenceForEntry = true;
if (addReferenceForEntry) {
char dataReference[130];