Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions VeDirectFrameHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,11 @@ void VeDirectFrameHandler::rxData(uint8_t inbyte)
* This function is called every time a new name/value is successfully parsed. It writes the values to the temporary buffer.
*/
void VeDirectFrameHandler::textRxEvent(char * mName, char * mValue) {
strcpy(tempName[frameIndex], mName); // copy name to temporary buffer
strcpy(tempValue[frameIndex], mValue); // copy value to temporary buffer
frameIndex++;
if (frameIndex < frameLen) {
strcpy(tempName[frameIndex], mName); // copy name to temporary buffer
strcpy(tempValue[frameIndex], mValue); // copy value to temporary buffer
frameIndex++;
Copy link

@redPanther redPanther Oct 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to move frameIndex++; after if block, otherwise I get chrashes constantly.
with:

void VeDirectFrameHandler::textRxEvent(char * mName, char * mValue) {
        if (frameIndex < frameLen) {
                strcpy(tempName[frameIndex], mName);    // copy name to temporary buffer
                strcpy(tempValue[frameIndex], mValue);  // copy value to temporary buffer
         }
        frameIndex++;
}

it works perfectly

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redPanther - what Victron device are you talking to?

}
}

/*
Expand Down