- MMS client: added function MmsConnection_sendRawData for test purposes

pull/396/head
Michael Zillgith 3 years ago
parent 4fb8113821
commit aeb8cb6157

@ -285,6 +285,10 @@ MmsConnection_connectAsync(MmsConnection self, MmsError* mmsError, const char* s
LIB61850_API bool
MmsConnection_tick(MmsConnection self);
/* NOTE: This function is for test purposes! */
LIB61850_API void
MmsConnection_sendRawData(MmsConnection self, MmsError* mmsError, uint8_t* buffer, int bufSize);
/**
* \brief Close the connection - not recommended
*

@ -4616,6 +4616,28 @@ exit_function:
return;
}
void
MmsConnection_sendRawData(MmsConnection self, MmsError* mmsError, uint8_t* buffer, int bufSize)
{
if (getConnectionState(self) != MMS_CONNECTION_STATE_CONNECTED) {
if (mmsError)
*mmsError = MMS_ERROR_CONNECTION_LOST;
goto exit_function;
}
ByteBuffer* payload = IsoClientConnection_allocateTransmitBuffer(self->isoClient);
ByteBuffer_append(payload, buffer, bufSize);
sendMessage(self, payload);
if (mmsError)
*mmsError = MMS_ERROR_NONE;
exit_function:
return;
}
void
MmsServerIdentity_destroy(MmsServerIdentity* self)
{

Loading…
Cancel
Save