libiec61850  1.5.3
goose_receiver.h
Go to the documentation of this file.
1 /*
2  * goose_receiver.h
3  *
4  * Copyright 2014-2019 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 LIB61850_API GooseReceiver
53 
64 LIB61850_API GooseReceiver
65 GooseReceiver_createEx(uint8_t* buffer);
66 
73 LIB61850_API void
74 GooseReceiver_setInterfaceId(GooseReceiver self, const char* interfaceId);
75 
83 LIB61850_API const char*
85 
95 LIB61850_API void
97 
107 LIB61850_API void
109 
115 LIB61850_API void
117 
125 LIB61850_API void
127 
137 LIB61850_API bool
139 
145 LIB61850_API void
147 
148 /***************************************
149  * Functions for non-threaded operation
150  ***************************************/
151 LIB61850_API EthernetSocket
153 
154 LIB61850_API void
156 
166 LIB61850_API bool
168 
179 LIB61850_API void
180 GooseReceiver_handleMessage(GooseReceiver self, uint8_t* buffer, int size);
181 
184 #ifdef __cplusplus
185 }
186 #endif
187 
188 
189 #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 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:41
LIB61850_API GooseReceiver GooseReceiver_createEx(uint8_t *buffer)
Create a new receiver instance using the provided buffer instead of allocating an own buffer.