- added Timestamp_toMmsValue function
This commit is contained in:
parent
ad98531b1b
commit
b9ba81f8a0
5 changed files with 28 additions and 3 deletions
|
@ -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
|
||||
*
|
||||
|
|
|
@ -561,4 +561,5 @@ EXPORTS
|
|||
Timestamp_create
|
||||
Timestamp_destroy
|
||||
Timestamp_setByMmsUtcTime
|
||||
IedServer_setLocalIpAddress
|
||||
IedServer_setLocalIpAddress
|
||||
Timestamp_toMmsValue
|
||||
|
|
|
@ -639,4 +639,5 @@ EXPORTS
|
|||
Timestamp_create
|
||||
Timestamp_destroy
|
||||
Timestamp_setByMmsUtcTime
|
||||
IedServer_setLocalIpAddress
|
||||
IedServer_setLocalIpAddress
|
||||
Timestamp_toMmsValue
|
||||
|
|
Loading…
Add table
Reference in a new issue