libiec61850  1.2.0
goose_subscriber.h
Go to the documentation of this file.
1 /*
2  * goose_subscriber.h
3  *
4  * Copyright 2013, 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_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 struct sGooseSubscriber* GooseSubscriber;
41 
48 typedef void (*GooseListener)(GooseSubscriber subscriber, void* parameter);
49 
70 GooseSubscriber
71 GooseSubscriber_create(char* goCbRef, MmsValue* dataSetValues);
72 
73 //char*
74 //GooseSubscriber_getGoCbRef(GooseSubscriber self);
75 
84 void
85 GooseSubscriber_setAppId(GooseSubscriber self, uint16_t appId);
86 
94 bool
95 GooseSubscriber_isValid(GooseSubscriber self);
96 
97 void
98 GooseSubscriber_destroy(GooseSubscriber self);
99 
107 void
108 GooseSubscriber_setListener(GooseSubscriber self, GooseListener listener, void* parameter);
109 
119 uint32_t
120 GooseSubscriber_getStNum(GooseSubscriber self);
121 
132 uint32_t
133 GooseSubscriber_getSqNum(GooseSubscriber self);
134 
144 bool
145 GooseSubscriber_isTest(GooseSubscriber self);
146 
155 uint32_t
156 GooseSubscriber_getConfRev(GooseSubscriber self);
157 
168 bool
169 GooseSubscriber_needsCommission(GooseSubscriber self);
170 
178 uint32_t
179 GooseSubscriber_getTimeAllowedToLive(GooseSubscriber self);
180 
188 uint64_t
189 GooseSubscriber_getTimestamp(GooseSubscriber self);
190 
202 MmsValue*
203 GooseSubscriber_getDataSetValues(GooseSubscriber self);
204 
205 #ifdef __cplusplus
206 }
207 #endif
208 
209 
212 #endif /* GOOSE_SUBSCRIBER_H_ */
void GooseSubscriber_setAppId(GooseSubscriber self, uint16_t appId)
set the APPID used by the subscriber to filter relevant messages.
void(* GooseListener)(GooseSubscriber subscriber, void *parameter)
user provided callback function that will be invoked when a GOOSE message is received.
Definition: goose_subscriber.h:48
struct sGooseSubscriber * GooseSubscriber
Definition: goose_subscriber.h:40
void GooseSubscriber_destroy(GooseSubscriber self)
uint32_t GooseSubscriber_getStNum(GooseSubscriber self)
return the state number (stNum) of the last received GOOSE message.
uint32_t GooseSubscriber_getConfRev(GooseSubscriber self)
returns the confRev value of the last received GOOSE message
uint32_t GooseSubscriber_getTimeAllowedToLive(GooseSubscriber self)
Get the TimeAllowedToLive value of the last received message.
uint32_t GooseSubscriber_getSqNum(GooseSubscriber self)
return the sequence number (sqNum) of the last received GOOSE message.
bool GooseSubscriber_needsCommission(GooseSubscriber self)
returns the value of the ndsCom (needs commission) flag of the last received GOOSE message...
bool GooseSubscriber_isTest(GooseSubscriber self)
returns the test flag of the last received GOOSE message
GooseSubscriber GooseSubscriber_create(char *goCbRef, MmsValue *dataSetValues)
create a new GOOSE subscriber instance.
void GooseSubscriber_setListener(GooseSubscriber self, GooseListener listener, void *parameter)
set a callback function that will be invoked when a GOOSE message has been received.
uint64_t GooseSubscriber_getTimestamp(GooseSubscriber self)
Get the timestamp of the last received message.
bool GooseSubscriber_isValid(GooseSubscriber self)
Check if subscriber state is valid.
MmsValue * GooseSubscriber_getDataSetValues(GooseSubscriber self)
get the data set values received with the last report
struct sMmsValue MmsValue
Definition: mms_value.h:68