libiec61850  1.2.0
goose_receiver.h
Go to the documentation of this file.
1 /*
2  * goose_receiver.h
3  *
4  * Copyright 2014 Michael Zillgith
5  *
6  * This file is part of libIEC61850.
7  *
8  * libIEC61850 is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * libIEC61850 is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * See COPYING file for the complete license text.
22  */
23 
24 #ifndef GOOSE_RECEIVER_H_
25 #define GOOSE_RECEIVER_H_
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #include <stdbool.h>
32 
33 #include "hal_ethernet.h"
34 #include "goose_subscriber.h"
35 
41 typedef struct sGooseReceiver* GooseReceiver;
42 
51 GooseReceiver
53 
60 void
61 GooseReceiver_setInterfaceId(GooseReceiver self, const char* interfaceId);
62 
72 void
73 GooseReceiver_addSubscriber(GooseReceiver self, GooseSubscriber subscriber);
74 
84 void
85 GooseReceiver_removeSubscriber(GooseReceiver self, GooseSubscriber subscriber);
86 
92 void
93 GooseReceiver_start(GooseReceiver self);
94 
102 void
103 GooseReceiver_stop(GooseReceiver self);
104 
114 bool
115 GooseReceiver_isRunning(GooseReceiver self);
116 
122 void
123 GooseReceiver_destroy(GooseReceiver self);
124 
125 /***************************************
126  * Functions for non-threaded operation
127  ***************************************/
129 GooseReceiver_startThreadless(GooseReceiver self);
130 
131 void
132 GooseReceiver_stopThreadless(GooseReceiver self);
133 
143 bool
144 GooseReceiver_tick(GooseReceiver self);
145 
148 #ifdef __cplusplus
149 }
150 #endif
151 
152 
153 #endif /* GOOSE_RECEIVER_H_ */
void GooseReceiver_stopThreadless(GooseReceiver self)
void GooseReceiver_removeSubscriber(GooseReceiver self, GooseSubscriber subscriber)
Remove a subscriber from this receiver instance.
struct sGooseSubscriber * GooseSubscriber
Definition: goose_subscriber.h:40
void GooseReceiver_addSubscriber(GooseReceiver self, GooseSubscriber subscriber)
Add a subscriber to this receiver instance.
EthernetSocket GooseReceiver_startThreadless(GooseReceiver self)
struct sEthernetSocket * EthernetSocket
Opaque handle that represents an Ethernet "socket".
Definition: hal_ethernet.h:49
void GooseReceiver_stop(GooseReceiver self)
stop the GOOSE receiver running in a separate thread
void GooseReceiver_setInterfaceId(GooseReceiver self, const char *interfaceId)
sets the interface for the GOOSE receiver
bool GooseReceiver_tick(GooseReceiver self)
Parse GOOSE messages if they are available.
void GooseReceiver_start(GooseReceiver self)
start the GOOSE receiver in a separate thread
bool GooseReceiver_isRunning(GooseReceiver self)
Check if GOOSE receiver is running.
GooseReceiver GooseReceiver_create(void)
Create a new receiver instance.
struct sGooseReceiver * GooseReceiver
Definition: goose_receiver.h:41
void GooseReceiver_destroy(GooseReceiver self)
Free all resource of the GooseReceiver and all installed GooseSubscribers.