- added Timestamp_toMmsValue function

pull/21/head
Michael Zillgith 8 years ago
parent ad98531b1b
commit b9ba81f8a0

@ -20,7 +20,7 @@ void sigint_handler(int signalId)
int
main(int argc, char** argv)
{
SampledValuesPublisher svPublisher = SampledValuesPublisher_create("vboxnet0");
SampledValuesPublisher svPublisher = SampledValuesPublisher_create("eth0");
SV_ASDU asdu1 = SampledValuesPublisher_addASDU(svPublisher, "svpub1", NULL, 1);

@ -405,6 +405,20 @@ Timestamp_setByMmsUtcTime(Timestamp* self, MmsValue* mmsValue)
memcpy(self->val, mmsValue->value.utcTime, 8);
}
MmsValue*
Timestamp_toMmsValue(Timestamp* self, MmsValue* mmsValue)
{
MmsValue* convertedValue = mmsValue;
if (convertedValue == NULL)
convertedValue = MmsValue_newUtcTime(0);
if (convertedValue != NULL)
memcpy(convertedValue->value.utcTime, self->val, 8);
return convertedValue;
}
char*
LibIEC61850_getVersionString()
{

@ -406,6 +406,15 @@ Timestamp_setTimeInMilliseconds(Timestamp* self, uint64_t millisSinceEpoch);
void
Timestamp_setByMmsUtcTime(Timestamp* self, MmsValue* mmsValue);
/**
* \brief Set an MmsValue instance of type UTCTime to the timestamp value
*
* \param self the Timestamp instance
* \param mmsValue the mmsValue instance, if NULL a new instance will be created
*/
MmsValue*
Timestamp_toMmsValue(Timestamp* self, MmsValue* mmsValue);
/**
* \brief Get the version of the library as string
*

@ -562,3 +562,4 @@ EXPORTS
Timestamp_destroy
Timestamp_setByMmsUtcTime
IedServer_setLocalIpAddress
Timestamp_toMmsValue

@ -640,3 +640,4 @@ EXPORTS
Timestamp_destroy
Timestamp_setByMmsUtcTime
IedServer_setLocalIpAddress
Timestamp_toMmsValue

Loading…
Cancel
Save