This commit is contained in:
Gunnar Skjold
2021-03-24 09:37:46 +01:00
parent be569d1802
commit 606bac100a
5 changed files with 20 additions and 7 deletions

View File

@@ -175,6 +175,14 @@ byte* DlmsReader::getBuffer() {
return buffer + (3 + destinationAddressLength + sourceAddressLength + 2 + 1);
}
byte* DlmsReader::getFullBuffer() {
return buffer;
}
int DlmsReader::getFullBufferLength() {
return dataLength;
}
int DlmsReader::GetAddress(int addressPosition, byte* addressBuffer, int start, int length)
{
int addressBufferPos = start;

View File

@@ -20,6 +20,8 @@ class DlmsReader
int GetRawData(byte *buffer, int start, int length);
int getBytesRead();
byte* getBuffer();
byte* getFullBuffer();
int getFullBufferLength();
protected:
Crc16Class Crc16;

View File

@@ -40,7 +40,10 @@ bool HanReader::read(byte data) {
if (debugger->isActive(RemoteDebug::INFO)) {
printI("Got valid DLMS data (%d bytes)", bytesRead);
if (debugger->isActive(RemoteDebug::DEBUG)) {
debugPrint(buffer, 0, bytesRead);
byte* full = reader.getFullBuffer();
int size = reader.getFullBufferLength();
printI("Full DLMS frame (%d bytes)", size);
debugPrint(full, 0, size);
}
}