diff --git a/src/iec61850/client/ied_connection.c b/src/iec61850/client/ied_connection.c index b49a1fe7..c97c3894 100644 --- a/src/iec61850/client/ied_connection.c +++ b/src/iec61850/client/ied_connection.c @@ -675,6 +675,16 @@ IedConnection_getRequestTimeout(IedConnection self) return 0; } +uint32_t +IedConnection_getInvokeId(IedConnection self) +{ + if (self->connection) { + return MmsConnection_getInvokeId(self->connection); + } + else + return 0; +} + void IedConnection_setTimeQuality(IedConnection self, bool leapSecondKnown, bool clockFailure, bool clockNotSynchronized, int subsecondPrecision) { diff --git a/src/iec61850/inc/iec61850_client.h b/src/iec61850/inc/iec61850_client.h index 852f2192..4e7bca39 100644 --- a/src/iec61850/inc/iec61850_client.h +++ b/src/iec61850/inc/iec61850_client.h @@ -266,6 +266,16 @@ IedConnection_setRequestTimeout(IedConnection self, uint32_t timeoutInMs); LIB61850_API uint32_t IedConnection_getRequestTimeout(IedConnection self); +/** + * \brief get current InvokeId + * + * \param self the connection object + * + * \return current InvokeId + */ +LIB61850_API uint32_t +IedConnection_getInvokeId(IedConnection self); + /** * \brief Set the time quality for all timestamps generated by this IedConnection instance * diff --git a/src/mms/inc/mms_client_connection.h b/src/mms/inc/mms_client_connection.h index 70bedc28..5e00ae27 100644 --- a/src/mms/inc/mms_client_connection.h +++ b/src/mms/inc/mms_client_connection.h @@ -170,6 +170,16 @@ MmsConnection_setRequestTimeout(MmsConnection self, uint32_t timeoutInMs); LIB61850_API uint32_t MmsConnection_getRequestTimeout(MmsConnection self); +/** + * \brief Get current invokeId + * + * \param self MmsConnection instance to operate on + * + * \return current invokeId + */ +LIB61850_API uint32_t +MmsConnection_getInvokeId(MmsConnection self); + /** * \brief Set the connect timeout in ms for this connection instance * diff --git a/src/mms/iso_mms/client/mms_client_connection.c b/src/mms/iso_mms/client/mms_client_connection.c index e1bb0039..7b79db8d 100644 --- a/src/mms/iso_mms/client/mms_client_connection.c +++ b/src/mms/iso_mms/client/mms_client_connection.c @@ -1658,6 +1658,12 @@ MmsConnection_getRequestTimeout(MmsConnection self) return self->requestTimeout; } +uint32_t +MmsConnection_getInvokeId(MmsConnection self) +{ + return self->nextInvokeId; +} + void MmsConnection_setConnectTimeout(MmsConnection self, uint32_t timeoutInMs) {