From 7c68e3e3f6efc9d7df55f2b5b2a6943c2115660b Mon Sep 17 00:00:00 2001 From: Mikael Bourhis Date: Mon, 27 Jul 2020 15:44:55 +0200 Subject: [PATCH] Python wrapper: add the support of the 'Goose subscription' The callback for the processing of the received GOOSE is still missing for now. --- pyiec61850/iec61850.i | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/pyiec61850/iec61850.i b/pyiec61850/iec61850.i index d4a91afb..9869c69f 100644 --- a/pyiec61850/iec61850.i +++ b/pyiec61850/iec61850.i @@ -51,3 +51,42 @@ ModelNode* toModelNode(DataObject *); DataAttribute* toDataAttribute(DataObject *); DataAttribute* toDataAttribute(ModelNode *); char* toCharP(void *); + +/* Goose Subscriber section */ +%{ +struct sGooseSubscriber; +typedef struct sGooseSubscriber* GooseSubscriber; +#include "goose_subscriber.h" +#include "goose_receiver.h" + +void GooseSubscriber_setDstMac(GooseSubscriber subscriber, + uint8_t dst_mac_0, + uint8_t dst_mac_1, + uint8_t dst_mac_2, + uint8_t dst_mac_3, + uint8_t dst_mac_4, + uint8_t dst_mac_5) +{ + uint8_t dst_mac[6]; + dst_mac[0] = dst_mac_0; + dst_mac[1] = dst_mac_1; + dst_mac[2] = dst_mac_2; + dst_mac[3] = dst_mac_3; + dst_mac[4] = dst_mac_4; + dst_mac[5] = dst_mac_5; + + GooseSubscriber_setDstMac(subscriber, dst_mac); +} +%} + +%include "goose_subscriber.h" +%include "goose_receiver.h" + +void GooseSubscriber_setDstMac(GooseSubscriber subscriber, + uint8_t dst_mac_0, + uint8_t dst_mac_1, + uint8_t dst_mac_2, + uint8_t dst_mac_3, + uint8_t dst_mac_4, + uint8_t dst_mac_5); +