Skip to content

Commit

Permalink
- CS 104 connection: set state variables in connect function to addre…
Browse files Browse the repository at this point in the history
…ss problem (#34)
  • Loading branch information
mzillgith committed Oct 17, 2018
1 parent 2efa0f2 commit 7b73a7f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib60870-C/src/iec60870/cs104/cs104_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,10 @@ handleConnection(void* parameter)
void
CS104_Connection_connectAsync(CS104_Connection self)
{
self->running = false;
self->failure = false;
self->close = false;

#if (CONFIG_USE_THREADS == 1)
self->connectionHandlingThread = Thread_create(handleConnection, (void*) self, false);

Expand All @@ -810,6 +814,10 @@ CS104_Connection_connectAsync(CS104_Connection self)
bool
CS104_Connection_connect(CS104_Connection self)
{
self->running = false;
self->failure = false;
self->close = false;

CS104_Connection_connectAsync(self);

while ((self->running == false) && (self->failure == false))
Expand Down

0 comments on commit 7b73a7f

Please sign in to comment.