From d53da75df65a35f885f5d59956ad621cc2c9f6d9 Mon Sep 17 00:00:00 2001 From: Michael Zillgith Date: Fri, 1 Sep 2023 11:07:10 +0100 Subject: [PATCH] - R-Session: changed parser to accept GOOSE and SV payloads --- src/r_session/r_session.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/r_session/r_session.c b/src/r_session/r_session.c index c740e314..ea38c653 100644 --- a/src/r_session/r_session.c +++ b/src/r_session/r_session.c @@ -569,14 +569,15 @@ parseSessionMessage(RSession self, uint8_t* buffer, int msgSize, RSessionPayload DEBUG_PRINTF("ASDU %02x sim: %i APPID: %04x length: %i", payloadElementType, simulation, appId, asduLength); - if (payloadElementType == 0x82) { + if (payloadElementType == 0x81 || + payloadElementType == 0x82) { /* user payload */ //TODO copy ASDU payload to ??? handler(handlerParam, appId, buffer + bufPos, asduLength); } else { - DEBUG_PRINTF("unexpected payload type! (expect 82h)"); + DEBUG_PRINTF("unexpected payload type! (expect 81h (GOOSE) or 82h (SV))"); } bufPos += asduLength; @@ -731,14 +732,15 @@ parseSessionMessage(RSession self, uint8_t* buffer, int msgSize, RSessionPayload DEBUG_PRINTF("ASDU %02x sim: %i APPID: %04x length: %i", payloadElementType, simulation, appId, asduLength); - if (payloadElementType == 0x82) { + if (payloadElementType == 0x81 || + payloadElementType == 0x82) { /* user payload */ //TODO copy ASDU payload to ??? handler(handlerParam, appId, buffer + bufPos, asduLength); } else { - DEBUG_PRINTF("unexpected payload type! (expect 82h)"); + DEBUG_PRINTF("unexpected payload type! (expect 81h (GOOSE) or 82h (SV))"); } bufPos += asduLength;