diff --git a/examples/iec61850_client_example3/client_example3.c b/examples/iec61850_client_example3/client_example3.c index 9c2e014..02cc78f 100644 --- a/examples/iec61850_client_example3/client_example3.c +++ b/examples/iec61850_client_example3/client_example3.c @@ -57,6 +57,8 @@ int main(int argc, char** argv) { MmsValue* ctlVal = MmsValue_newBoolean(true); + ControlObjectClient_setOrigin(control, NULL, 3); + if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { printf("simpleIOGenericIO/GGIO1.SPCSO1 operated successfully\n"); } diff --git a/src/iec61850/client/client_control.c b/src/iec61850/client/client_control.c index d638c0a..54f4938 100644 --- a/src/iec61850/client/client_control.c +++ b/src/iec61850/client/client_control.c @@ -422,7 +422,11 @@ ControlObjectClient_setOrigin(ControlObjectClient self, const char* orIdent, int if (self->orIdent != NULL) GLOBAL_FREEMEM(self->orIdent); - self->orIdent = copyString(orIdent); + if (orIdent != NULL) + self->orIdent = copyString(orIdent); + else + self->orIdent = NULL; + self->orCat = orCat; }