- fixed problem in client report handling when report contains no report ID

pull/8/head
Michael Zillgith 9 years ago
parent 9dc1a36568
commit c093852fda

@ -52,10 +52,6 @@ int main(int argc, char** argv) {
IedConnection con = IedConnection_create();
MmsConnection mmsCon = IedConnection_getMmsConnection(con);
MmsConnection_setLocalDetail(mmsCon, 800);
IedConnection_connect(con, &error, hostname, tcpPort);
if (error == IED_ERROR_OK) {

@ -359,11 +359,14 @@ private_IedConnection_handleReport(IedConnection self, MmsValue* value)
while (element != NULL) {
ClientReport report = (ClientReport) element->data;
char defaultRptId[129];
char* rptId = report->rptId;
if (rptId == NULL)
rptId = report->rcbReference;
if ((rptId == NULL) || (rptId && (strlen(rptId) == 0))) {
strncpy(defaultRptId, report->rcbReference, 129);
StringUtils_replace(defaultRptId, '.', '$');
rptId = defaultRptId;
}
if (strcmp(MmsValue_toString(rptIdValue), rptId) == 0) {
matchingReport = report;

Loading…
Cancel
Save