mz-automation / libiec61850

Official repository for libIEC61850, the open-source library for the IEC 61850 protocols
http://libiec61850.com/libiec61850
GNU General Public License v3.0
857 stars 459 forks source link

ReportControl and rptID is empty #3

Closed Uskok closed 7 years ago

Uskok commented 7 years ago

Hi Michael,

I made some testing together with Anvil from Triangle MicroWorks (IEC61850 Test Suite). There is one case file TMWSample.icd where prtID is not set inside ReportControl. You can register as client the reports but the callback function is not executed.

I found small problem in private_IedConnection_handleReport(IedConnection self, MmsValue* value) (file client_report.c)


while (element != NULL) {
    ClientReport report = (ClientReport) element->data;
    char repID[129];
    char* rptId = report->rptId;

    if (rptId == NULL || (rptId && (strlen(rptId)== 0)))
    {
        strcpy(repID, report->rcbReference);
        StringUtils_replace(repID, '.', '$');
        rptId = repID;
    }

    if (strcmp(MmsValue_toString(rptIdValue), rptId) == 0) {
        matchingReport = report;
        break;
    }

    element = LinkedList_getNext(element);
}

More or less rptId pointer was not NULL but the string was empty. Regards,

Boris
mzillgith commented 7 years ago

Hi Boris, thanks. I will commit the fix. Regards, Michael

Uskok commented 7 years ago

Hi Michael, Thanks for the fast replay. You can close the case. Regards,

Boris