Hi, i am using the gurux dlms data collector with wirepas , while i am using with HDLC i received the Connect command "7E A0 07 03 21 93 0F 01 7E" with client address 0x10 and while the reply is giving
"7E A0 1E 21 03 73 C3 7A 81 80 12 05 01 80 06 01 80 07 04 00 00 00 01 08 04 00 00 00 01 53 3B 7E"
code went into the DataReceivedSP function and set the "received" flag as 1
in the below function
in app.c line no 173:
static int com_readSerialPort(
unsigned char eop)
{
char loopCount = 0;
//Read reply data.
frameData.size = 0;
frameData.position = 0;
#ifdef USE_HDLC
int pos;
unsigned char eopFound = 0;
unsigned short lastReadIndex = 0;
do
{
++loopCount;
if (received)
{
char i = (char)frameData.size;Usart_sendBuffer(&i, 1);//Search eop.
if (frameData.size > 5)
{
//Some optical strobes can return extra bytes.
for (pos = frameData.size - 1; pos != lastReadIndex; --pos)
{
if (frameData.data[pos] == eop)
{
eopFound = 1;
received = false;
break;
}
}
lastReadIndex = pos;
}
}
user_delay_ms(50);
} while (eopFound == 0 && loopCount != 4);
if (!eopFound)
{
return 1;
}
#else
do
{
++loopCount;
user_delay_ms(50);
} while (!received && loopCount != 4);
if (!received)
{
return 1;
}
received = false;
#endif //USE_HDLC
return DLMS_ERROR_CODE_OK;
}
Here i am struck here while the receive flag is high and this condition is not satisfing in it" if (frameData.size > 5)" can you please tell what is the issue
Regards
Santosh
Hi, If you are reading data…
Hi,
If you are reading data from the serial port you need to change
Usart_sendBuffer to something that reads data from the serial port, not send it.
BR,
Mikko