|
|
@ -473,8 +473,12 @@ handleLastApplErrorMessage(IedConnection self, MmsValue* lastApplError)
|
|
|
|
self->lastApplError.ctlNum = MmsValue_toUint32(ctlNum);
|
|
|
|
self->lastApplError.ctlNum = MmsValue_toUint32(ctlNum);
|
|
|
|
self->lastApplError.addCause = (ControlAddCause) MmsValue_toInt32(addCause);
|
|
|
|
self->lastApplError.addCause = (ControlAddCause) MmsValue_toInt32(addCause);
|
|
|
|
self->lastApplError.error = (ControlLastApplError) MmsValue_toInt32(error);
|
|
|
|
self->lastApplError.error = (ControlLastApplError) MmsValue_toInt32(error);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Semaphore_wait(self->clientControlsLock);
|
|
|
|
|
|
|
|
|
|
|
|
LinkedList control = LinkedList_getNext(self->clientControls);
|
|
|
|
LinkedList control = LinkedList_getNext(self->clientControls);
|
|
|
|
while (control != NULL) {
|
|
|
|
|
|
|
|
|
|
|
|
while (control) {
|
|
|
|
ControlObjectClient object = (ControlObjectClient) control->data;
|
|
|
|
ControlObjectClient object = (ControlObjectClient) control->data;
|
|
|
|
|
|
|
|
|
|
|
|
const char* objectRef = ControlObjectClient_getObjectReference(object);
|
|
|
|
const char* objectRef = ControlObjectClient_getObjectReference(object);
|
|
|
@ -485,6 +489,8 @@ handleLastApplErrorMessage(IedConnection self, MmsValue* lastApplError)
|
|
|
|
|
|
|
|
|
|
|
|
control = LinkedList_getNext(control);
|
|
|
|
control = LinkedList_getNext(control);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Semaphore_post(self->clientControlsLock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
static void
|
|
|
@ -515,9 +521,11 @@ informationReportHandler(void* parameter, char* domainName,
|
|
|
|
if (DEBUG_IED_CLIENT)
|
|
|
|
if (DEBUG_IED_CLIENT)
|
|
|
|
printf("IED_CLIENT: RCVD CommandTermination for %s/%s\n", domainName, variableListName);
|
|
|
|
printf("IED_CLIENT: RCVD CommandTermination for %s/%s\n", domainName, variableListName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Semaphore_wait(self->clientControlsLock);
|
|
|
|
|
|
|
|
|
|
|
|
LinkedList control = LinkedList_getNext(self->clientControls);
|
|
|
|
LinkedList control = LinkedList_getNext(self->clientControls);
|
|
|
|
|
|
|
|
|
|
|
|
while (control != NULL) {
|
|
|
|
while (control) {
|
|
|
|
ControlObjectClient object = (ControlObjectClient) control->data;
|
|
|
|
ControlObjectClient object = (ControlObjectClient) control->data;
|
|
|
|
|
|
|
|
|
|
|
|
const char* objectRef = ControlObjectClient_getObjectReference(object);
|
|
|
|
const char* objectRef = ControlObjectClient_getObjectReference(object);
|
|
|
@ -527,6 +535,8 @@ informationReportHandler(void* parameter, char* domainName,
|
|
|
|
|
|
|
|
|
|
|
|
control = LinkedList_getNext(control);
|
|
|
|
control = LinkedList_getNext(control);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Semaphore_post(self->clientControlsLock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MmsValue_delete(value);
|
|
|
|
MmsValue_delete(value);
|
|
|
@ -587,6 +597,7 @@ createNewConnectionObject(TLSConfiguration tlsConfig, bool useThreads)
|
|
|
|
if (self) {
|
|
|
|
if (self) {
|
|
|
|
self->enabledReports = LinkedList_create();
|
|
|
|
self->enabledReports = LinkedList_create();
|
|
|
|
self->logicalDevices = NULL;
|
|
|
|
self->logicalDevices = NULL;
|
|
|
|
|
|
|
|
self->clientControlsLock = Semaphore_create(1);
|
|
|
|
self->clientControls = LinkedList_create();
|
|
|
|
self->clientControls = LinkedList_create();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -812,6 +823,7 @@ IedConnection_destroy(IedConnection self)
|
|
|
|
|
|
|
|
|
|
|
|
LinkedList_destroyStatic(self->clientControls);
|
|
|
|
LinkedList_destroyStatic(self->clientControls);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Semaphore_destroy(self->clientControlsLock);
|
|
|
|
Semaphore_destroy(self->outstandingCallsLock);
|
|
|
|
Semaphore_destroy(self->outstandingCallsLock);
|
|
|
|
Semaphore_destroy(self->stateMutex);
|
|
|
|
Semaphore_destroy(self->stateMutex);
|
|
|
|
Semaphore_destroy(self->reportHandlerMutex);
|
|
|
|
Semaphore_destroy(self->reportHandlerMutex);
|
|
|
@ -3805,13 +3817,21 @@ IedConnection_getLastApplError(IedConnection self)
|
|
|
|
void
|
|
|
|
void
|
|
|
|
iedConnection_addControlClient(IedConnection self, ControlObjectClient control)
|
|
|
|
iedConnection_addControlClient(IedConnection self, ControlObjectClient control)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Semaphore_wait(self->clientControlsLock);
|
|
|
|
|
|
|
|
|
|
|
|
LinkedList_add(self->clientControls, control);
|
|
|
|
LinkedList_add(self->clientControls, control);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Semaphore_post(self->clientControlsLock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
iedConnection_removeControlClient(IedConnection self, ControlObjectClient control)
|
|
|
|
iedConnection_removeControlClient(IedConnection self, ControlObjectClient control)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Semaphore_wait(self->clientControlsLock);
|
|
|
|
|
|
|
|
|
|
|
|
LinkedList_remove(self->clientControls, control);
|
|
|
|
LinkedList_remove(self->clientControls, control);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Semaphore_post(self->clientControlsLock);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FileDirectoryEntry
|
|
|
|
FileDirectoryEntry
|
|
|
|