Merge pull request #268 from cedricboudinet/svsub_getSmpSynch

- SV subscriber: get smp synch
v1.3
Michael Zillgith 5 years ago committed by GitHub
commit 756e198066
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -44,6 +44,8 @@ main(int argc, char** argv)
int ts2 = SVPublisher_ASDU_addTimestamp(asdu2); int ts2 = SVPublisher_ASDU_addTimestamp(asdu2);
SVPublisher_setupComplete(svPublisher); SVPublisher_setupComplete(svPublisher);
SVPublisher_ASDU_setSmpSynch(asdu1, 2);
SVPublisher_ASDU_setSmpSynch(asdu2, 1);
float fVal1 = 1234.5678f; float fVal1 = 1234.5678f;
float fVal2 = 0.12345f; float fVal2 = 0.12345f;

@ -32,6 +32,7 @@ svUpdateListener (SVSubscriber subscriber, void* parameter, SVSubscriber_ASDU as
printf(" smpCnt: %i\n", SVSubscriber_ASDU_getSmpCnt(asdu)); printf(" smpCnt: %i\n", SVSubscriber_ASDU_getSmpCnt(asdu));
printf(" confRev: %u\n", SVSubscriber_ASDU_getConfRev(asdu)); printf(" confRev: %u\n", SVSubscriber_ASDU_getConfRev(asdu));
printf(" smpSynch: %u\n", SVSubscriber_ASDU_getSmpSynch(asdu));
/* /*
* Access to the data requires a priori knowledge of the data set. * Access to the data requires a priori knowledge of the data set.

@ -878,6 +878,12 @@ SVSubscriber_ASDU_getDataSize(SVSubscriber_ASDU self)
return self->dataBufferLength; return self->dataBufferLength;
} }
uint8_t
SVSubscriber_ASDU_getSmpSynch(SVSubscriber_ASDU self)
{
return self->smpSynch[0];
}
uint16_t uint16_t
SVClientASDU_getSmpCnt(SVSubscriber_ASDU self) SVClientASDU_getSmpCnt(SVSubscriber_ASDU self)
{ {

@ -528,6 +528,16 @@ SVSubscriber_ASDU_getQuality(SVSubscriber_ASDU self, int index);
int int
SVSubscriber_ASDU_getDataSize(SVSubscriber_ASDU self); SVSubscriber_ASDU_getDataSize(SVSubscriber_ASDU self);
/**
* \brief return the SmpSynch value included in the SV ASDU
*
* The SmpSynch gives information about the clock synchronization.
*
* \param self ASDU object instance
*/
uint8_t
SVSubscriber_ASDU_getSmpSynch(SVSubscriber_ASDU self);
#ifndef DEPRECATED #ifndef DEPRECATED
#if defined(__GNUC__) || defined(__clang__) #if defined(__GNUC__) || defined(__clang__)
#define DEPRECATED __attribute__((deprecated)) #define DEPRECATED __attribute__((deprecated))

Loading…
Cancel
Save