ソースを参照

Use UA_Duration to align with NS0

Stefan Profanter 7 年 前
コミット
7352951317
共有4 個のファイルを変更した14 個の追加11 個の削除を含む
  1. 5 5
      include/ua_server_config.h
  2. 5 5
      plugins/ua_config_standard.c
  3. 3 1
      tests/check_types_memory.c
  4. 1 0
      tools/schema/datatypes_minimal.txt

+ 5 - 5
include/ua_server_config.h

@@ -26,9 +26,9 @@ typedef struct {
 } UA_UInt32Range;
 
 typedef struct {
-    UA_Double min;
-    UA_Double max;
-} UA_DoubleRange;
+    UA_Duration min;
+    UA_Duration max;
+} UA_DurationRange;
 
 struct UA_ServerConfig {
     UA_UInt16 nThreads; /* only if multithreading is enabled */
@@ -70,14 +70,14 @@ struct UA_ServerConfig {
     UA_Double maxSessionTimeout; /* in ms */
 
     /* Limits for Subscriptions */
-    UA_DoubleRange publishingIntervalLimits;
+    UA_DurationRange publishingIntervalLimits;
     UA_UInt32Range lifeTimeCountLimits;
     UA_UInt32Range keepAliveCountLimits;
     UA_UInt32 maxNotificationsPerPublish;
     UA_UInt32 maxRetransmissionQueueSize; /* 0 -> unlimited size */
 
     /* Limits for MonitoredItems */
-    UA_DoubleRange samplingIntervalLimits;
+    UA_DurationRange samplingIntervalLimits;
     UA_UInt32Range queueSizeLimits; /* Negotiated with the client */
 
     /* Discovery */

+ 5 - 5
plugins/ua_config_standard.c

@@ -20,9 +20,9 @@ UA_UINT32RANGE(UA_UInt32 min, UA_UInt32 max) {
     return range;
 }
 
-static UA_INLINE UA_DoubleRange
-UA_DOUBLERANGE(UA_Double min, UA_Double max) {
-    UA_DoubleRange range = {min, max};
+static UA_INLINE UA_DurationRange
+UA_DURATIONRANGE(UA_Double min, UA_Double max) {
+    UA_DurationRange range = {min, max};
     return range;
 }
 
@@ -169,14 +169,14 @@ UA_ServerConfig_new_minimal(UA_UInt16 portNumber,
     conf->maxSessionTimeout = 60.0 * 60.0 * 1000.0; /* 1h */
 
     /* Limits for Subscriptions */
-    conf->publishingIntervalLimits = UA_DOUBLERANGE(100.0, 3600.0 * 1000.0);
+    conf->publishingIntervalLimits = UA_DURATIONRANGE(100.0, 3600.0 * 1000.0);
     conf->lifeTimeCountLimits = UA_UINT32RANGE(3, 15000);
     conf->keepAliveCountLimits = UA_UINT32RANGE(1, 100);
     conf->maxNotificationsPerPublish = 1000;
     conf->maxRetransmissionQueueSize = 0; /* unlimited */
 
     /* Limits for MonitoredItems */
-    conf->samplingIntervalLimits = UA_DOUBLERANGE(50.0, 24.0 * 3600.0 * 1000.0);
+    conf->samplingIntervalLimits = UA_DURATIONRANGE(50.0, 24.0 * 3600.0 * 1000.0);
     conf->queueSizeLimits = UA_UINT32RANGE(1, 100);
 
 #ifdef UA_ENABLE_DISCOVERY

+ 3 - 1
tests/check_types_memory.c

@@ -106,7 +106,9 @@ END_TEST
 
 START_TEST(decodeShallFailWithTruncatedBufferButSurvive) {
     //Skip test for void*
-    if (_i == UA_TYPES_DISCOVERYCONFIGURATION || _i == UA_TYPES_FILTEROPERAND || _i == UA_TYPES_MONITORINGFILTER)
+    if (_i == UA_TYPES_DISCOVERYCONFIGURATION ||
+            _i == UA_TYPES_FILTEROPERAND ||
+            _i == UA_TYPES_MONITORINGFILTER)
         return;
     // given
     UA_ByteString msg1;

+ 1 - 0
tools/schema/datatypes_minimal.txt

@@ -178,3 +178,4 @@ SimpleAttributeOperand
 EventNotificationList
 EventFieldList
 StatusChangeNotification
+Duration