libiec61850  1.5.3
goose_subscriber.h
Go to the documentation of this file.
1 /*
2  * goose_subscriber.h
3  *
4  * Copyright 2013-2021 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_SUBSCRIBER_H_
25 #define GOOSE_SUBSCRIBER_H_
26 
27 #include "libiec61850_common_api.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
38 #include "mms_value.h"
39 
40 typedef enum
41 {
52 
53 typedef struct sGooseSubscriber* GooseSubscriber;
54 
61 typedef void (*GooseListener)(GooseSubscriber subscriber, void* parameter);
62 
83 LIB61850_API GooseSubscriber
84 GooseSubscriber_create(char* goCbRef, MmsValue* dataSetValues);
85 
91 LIB61850_API char*
93 
99 LIB61850_API char*
101 
107 LIB61850_API char*
109 
118 LIB61850_API void
120 
129 LIB61850_API void
131 
139 LIB61850_API bool
141 
149 LIB61850_API GooseParseError
151 
160 LIB61850_API void
162 
170 LIB61850_API void
172 
178 LIB61850_API int32_t
180 
187 LIB61850_API void
189 
196 LIB61850_API void
198 
208 LIB61850_API uint32_t
210 
221 LIB61850_API uint32_t
223 
233 LIB61850_API bool
235 
244 LIB61850_API uint32_t
246 
257 LIB61850_API bool
259 
267 LIB61850_API uint32_t
269 
277 LIB61850_API uint64_t
279 
291 LIB61850_API MmsValue*
293 
294 LIB61850_API bool
296 
297 LIB61850_API uint16_t
299 
300 LIB61850_API uint8_t
302 
309 LIB61850_API void
311 #ifdef __cplusplus
312 }
313 #endif
314 
315 
318 #endif /* GOOSE_SUBSCRIBER_H_ */
struct sMmsValue MmsValue
Definition: mms_value.h:68
LIB61850_API void GooseSubscriber_getDstMac(GooseSubscriber self, uint8_t *buffer)
Get the destination MAC address of the received GOOSE message.
LIB61850_API uint64_t GooseSubscriber_getTimestamp(GooseSubscriber self)
Get the timestamp of the last received message.
LIB61850_API char * GooseSubscriber_getDataSet(GooseSubscriber self)
Get the DatSet value of the received GOOSE message.
GooseParseError
Definition: goose_subscriber.h:41
LIB61850_API bool GooseSubscriber_isValid(GooseSubscriber self)
Check if subscriber state is valid.
LIB61850_API char * GooseSubscriber_getGoId(GooseSubscriber self)
Get the GoId value of the received GOOSE message.
LIB61850_API void GooseSubscriber_setListener(GooseSubscriber self, GooseListener listener, void *parameter)
set a callback function that will be invoked when a GOOSE message has been received.
void(* GooseListener)(GooseSubscriber subscriber, void *parameter)
user provided callback function that will be invoked when a GOOSE message is received.
Definition: goose_subscriber.h:61
LIB61850_API void GooseSubscriber_setObserver(GooseSubscriber self)
Configure the Subscriber to listen to any received GOOSE message.
LIB61850_API uint16_t GooseSubscriber_getVlanId(GooseSubscriber self)
LIB61850_API void GooseSubscriber_destroy(GooseSubscriber self)
Destroy the GooseSubscriber instance.
LIB61850_API uint32_t GooseSubscriber_getSqNum(GooseSubscriber self)
return the sequence number (sqNum) of the last received GOOSE message.
LIB61850_API uint32_t GooseSubscriber_getConfRev(GooseSubscriber self)
returns the confRev value of the last received GOOSE message
LIB61850_API GooseParseError GooseSubscriber_getParseError(GooseSubscriber self)
Get parse error in case of invalid subscriber state.
LIB61850_API uint32_t GooseSubscriber_getTimeAllowedToLive(GooseSubscriber self)
Get the TimeAllowedToLive value of the last received message.
LIB61850_API bool GooseSubscriber_isTest(GooseSubscriber self)
returns the test flag of the last received GOOSE message
LIB61850_API MmsValue * GooseSubscriber_getDataSetValues(GooseSubscriber self)
get the data set values received with the last report
LIB61850_API bool GooseSubscriber_isVlanSet(GooseSubscriber self)
LIB61850_API bool GooseSubscriber_needsCommission(GooseSubscriber self)
returns the value of the ndsCom (needs commission) flag of the last received GOOSE message.
LIB61850_API uint8_t GooseSubscriber_getVlanPrio(GooseSubscriber self)
LIB61850_API uint32_t GooseSubscriber_getStNum(GooseSubscriber self)
return the state number (stNum) of the last received GOOSE message.
LIB61850_API GooseSubscriber GooseSubscriber_create(char *goCbRef, MmsValue *dataSetValues)
create a new GOOSE subscriber instance.
LIB61850_API char * GooseSubscriber_getGoCbRef(GooseSubscriber self)
Get the GOOSE Control Block reference value of the received GOOSE message.
LIB61850_API int32_t GooseSubscriber_getAppId(GooseSubscriber self)
Get the APPID value of the received GOOSE message.
struct sGooseSubscriber * GooseSubscriber
Definition: goose_subscriber.h:53
LIB61850_API void GooseSubscriber_getSrcMac(GooseSubscriber self, uint8_t *buffer)
Get the source MAC address of the received GOOSE message.
LIB61850_API void GooseSubscriber_setDstMac(GooseSubscriber self, uint8_t dstMac[6])
set the destination mac address used by the subscriber to filter relevant messages.
LIB61850_API void GooseSubscriber_setAppId(GooseSubscriber self, uint16_t appId)
set the APPID used by the subscriber to filter relevant messages.
@ GOOSE_PARSE_ERROR_UNDERFLOW
Definition: goose_subscriber.h:47
@ GOOSE_PARSE_ERROR_TYPE_MISMATCH
Definition: goose_subscriber.h:48
@ GOOSE_PARSE_ERROR_UNKNOWN_TAG
Definition: goose_subscriber.h:43
@ GOOSE_PARSE_ERROR_LENGTH_MISMATCH
Definition: goose_subscriber.h:49
@ GOOSE_PARSE_ERROR_NO_ERROR
Definition: goose_subscriber.h:42
@ GOOSE_PARSE_ERROR_SUBLEVEL
Definition: goose_subscriber.h:45
@ GOOSE_PARSE_ERROR_OVERFLOW
Definition: goose_subscriber.h:46
@ GOOSE_PARSE_ERROR_INVALID_PADDING
Definition: goose_subscriber.h:50
@ GOOSE_PARSE_ERROR_TAGDECODE
Definition: goose_subscriber.h:44