libiec61850  1.6.0
goose_receiver.h
Go to the documentation of this file.
1 /*
2  * goose_receiver.h
3  *
4  * Copyright 2014-2022 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 #include "r_session.h"
36 
42 typedef struct sGooseReceiver* GooseReceiver;
43 
52 LIB61850_API GooseReceiver
54 
65 LIB61850_API GooseReceiver
66 GooseReceiver_createEx(uint8_t* buffer);
67 
75 LIB61850_API GooseReceiver
76 GooseReceiver_createRemote(RSession session);
77 
84 LIB61850_API void
85 GooseReceiver_setInterfaceId(GooseReceiver self, const char* interfaceId);
86 
94 LIB61850_API const char*
96 
106 LIB61850_API void
108 
118 LIB61850_API void
120 
126 LIB61850_API void
128 
136 LIB61850_API void
138 
148 LIB61850_API bool
150 
156 LIB61850_API void
158 
159 /***************************************
160  * Functions for non-threaded operation
161  ***************************************/
162 LIB61850_API EthernetSocket
164 
165 LIB61850_API void
167 
177 LIB61850_API bool
179 
190 LIB61850_API void
191 GooseReceiver_handleMessage(GooseReceiver self, uint8_t* buffer, int size);
192 
195 #ifdef __cplusplus
196 }
197 #endif
198 
199 
200 #endif /* GOOSE_RECEIVER_H_ */
LIB61850_API const char * GooseReceiver_getInterfaceId(GooseReceiver self)
return the interface ID used by the GOOSE receiver
LIB61850_API void GooseReceiver_stop(GooseReceiver self)
stop the GOOSE receiver running in a separate thread
LIB61850_API void GooseReceiver_start(GooseReceiver self)
start the GOOSE receiver in a separate thread
LIB61850_API void GooseReceiver_destroy(GooseReceiver self)
Free all resource of the GooseReceiver and all installed GooseSubscribers.
LIB61850_API GooseReceiver GooseReceiver_createRemote(RSession session)
Create a new R-GOOSE receiver instance.
LIB61850_API void GooseReceiver_handleMessage(GooseReceiver self, uint8_t *buffer, int size)
Parse a GOOSE message.
LIB61850_API EthernetSocket GooseReceiver_startThreadless(GooseReceiver self)
LIB61850_API GooseReceiver GooseReceiver_create(void)
Create a new receiver instance.
LIB61850_API void GooseReceiver_stopThreadless(GooseReceiver self)
LIB61850_API bool GooseReceiver_isRunning(GooseReceiver self)
Check if GOOSE receiver is running.
LIB61850_API void GooseReceiver_removeSubscriber(GooseReceiver self, GooseSubscriber subscriber)
Remove a subscriber from this receiver instance.
LIB61850_API void GooseReceiver_setInterfaceId(GooseReceiver self, const char *interfaceId)
sets the interface for the GOOSE receiver
LIB61850_API bool GooseReceiver_tick(GooseReceiver self)
Parse GOOSE messages if they are available.
LIB61850_API void GooseReceiver_addSubscriber(GooseReceiver self, GooseSubscriber subscriber)
Add a subscriber to this receiver instance.
struct sGooseSubscriber * GooseSubscriber
Definition: goose_subscriber.h:53
struct sGooseReceiver * GooseReceiver
Definition: goose_receiver.h:42
LIB61850_API GooseReceiver GooseReceiver_createEx(uint8_t *buffer)
Create a new receiver instance using the provided buffer instead of allocating an own buffer.