- added documentation to HandleSet functions

pull/6/head
Michael Zillgith 11 years ago
parent ad89a0f26a
commit 91b9c2c64b

@ -113,6 +113,9 @@ namespace IEC61850
[DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)] [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)] [DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)]
static extern IntPtr IedConnection_getLogicalDeviceDirectory (IntPtr self, out int error, string logicalDeviceName); static extern IntPtr IedConnection_getLogicalDeviceDirectory (IntPtr self, out int error, string logicalDeviceName);
@ -255,6 +258,16 @@ namespace IEC61850
return controlObject; 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> /// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
public List<string> GetServerDirectory (bool fileDirectory = false) public List<string> GetServerDirectory (bool fileDirectory = false)
{ {

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

@ -54,15 +54,44 @@ typedef struct sSocket* Socket;
/** Opaque reference for a set of server and socket handles */ /** Opaque reference for a set of server and socket handles */
typedef struct sHandleSet* HandleSet; typedef struct sHandleSet* HandleSet;
/**
* \brief Create a new connection handle set (HandleSet)
*
* \return new HandleSet instance
*/
HandleSet HandleSet
Handleset_new(void); Handleset_new(void);
/**
* \brief add a soecket to an existing handle set
*
* \param self the HandleSet instance
* \param sock the socket to add
*/
void void
Handleset_addSocket(HandleSet self, const Socket sock); 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 int
Handleset_waitReady(HandleSet self, unsigned int timeoutMs); Handleset_waitReady(HandleSet self, unsigned int timeoutMs);
/**
* \brief destroy the HandleSet instance
*
* \param self the HandleSet instance to destroy
*/
void void
Handleset_destroy(HandleSet self); Handleset_destroy(HandleSet self);

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

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

@ -607,13 +607,16 @@ typedef void (*ReportCallbackFunction) (void* parameter, ClientReport report);
/** /**
* \brief Install a report handler function for the specified report control block (RCB) * \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 * This function will replace a report handler set earlier for the specified RCB. The report handler
* of type MMS_STRUCTURE that contains the data set entries as structure elements. This is required because otherwise * will be called whenever a report for the specified RCB is received.
* the report handler is not able to correctly parse the report message from the server. * 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 rcbReference object reference of the report control block
* \param rptId a string that identifies the report. If the rptId is not available then the * \param rptId a string that identifies the report. If the rptId is not available then the
* rcbReference is used to identify the report. * 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) * \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 void
IedConnection_uninstallReportHandler(IedConnection self, char* rcbReference); IedConnection_uninstallReportHandler(IedConnection self, char* rcbReference);

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

Loading…
Cancel
Save