refactor(pubsub): Remove the unused SubscribingInterval from the ReaderGroup config

This commit is contained in:
Julius Pfrommer 2023-07-19 11:54:28 +02:00 committed by Julius Pfrommer
parent e937c47809
commit fea29ebcd0
8 changed files with 2 additions and 16 deletions

View File

@ -17,7 +17,6 @@
#define SUBSCRIBER_METADATAQUEUENAME "MetaDataTopic"
#define SUBSCRIBER_METADATAUPDATETIME 0
#define BROKER_ADDRESS_URL "opc.mqtt://127.0.0.1:1883"
#define SUBSCRIBE_INTERVAL 500
// Uncomment the following line to enable MQTT login for the example
// #define EXAMPLE_USE_MQTT_LOGIN
@ -134,7 +133,7 @@ addPubSubConnection(UA_Server *server, char *addressUrl) {
* is removed. All network message related filters are only available in the DataSetReader. */
/* Add ReaderGroup to the created connection */
static UA_StatusCode
addReaderGroup(UA_Server *server, int interval) {
addReaderGroup(UA_Server *server) {
if(server == NULL) {
return UA_STATUSCODE_BADINTERNALERROR;
}
@ -143,7 +142,6 @@ addReaderGroup(UA_Server *server, int interval) {
UA_ReaderGroupConfig readerGroupConfig;
memset (&readerGroupConfig, 0, sizeof(UA_ReaderGroupConfig));
readerGroupConfig.name = UA_STRING("ReaderGroup1");
readerGroupConfig.subscribingInterval = interval;
if(useJson)
readerGroupConfig.encodingMimeType = UA_PUBSUB_ENCODING_JSON;
@ -366,8 +364,6 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) {
int main(int argc, char **argv) {
char *addressUrl = BROKER_ADDRESS_URL;
//char *topic = SUBSCRIBER_TOPIC;
int interval = SUBSCRIBE_INTERVAL;
/* Return value initialized to Status Good */
UA_Server *server = UA_Server_new();
@ -389,7 +385,7 @@ int main(int argc, char **argv) {
goto cleanup;
/* Add ReaderGroup to the created PubSubConnection */
retval |= addReaderGroup(server, interval);
retval |= addReaderGroup(server);
if (retval != UA_STATUSCODE_GOOD)
goto cleanup;

View File

@ -480,7 +480,6 @@ addReaderGroup(UA_Server *server) {
memset(&readerGroupConfig, 0, sizeof(UA_ReaderGroupConfig));
readerGroupConfig.name = UA_STRING("ReaderGroup");
readerGroupConfig.rtLevel = UA_PUBSUB_RT_FIXED_SIZE;
readerGroupConfig.subscribingInterval = cycleTimeInMsec;
#ifdef UA_ENABLE_PUBSUB_ENCRYPTION
/* Encryption settings */

View File

@ -363,7 +363,6 @@ addReaderGroup(UA_Server *server) {
memset (&readerGroupConfig, 0, sizeof(UA_ReaderGroupConfig));
readerGroupConfig.name = UA_STRING("ReaderGroup");
readerGroupConfig.rtLevel = UA_PUBSUB_RT_FIXED_SIZE;
readerGroupConfig.subscribingInterval = cycleTimeInMsec;
UA_Server_addReaderGroup(server, connectionIdentSubscriber, &readerGroupConfig,
&readerGroupIdentifier);

View File

@ -476,7 +476,6 @@ addReaderGroup(UA_Server *server) {
memset(&readerGroupConfig, 0, sizeof(UA_ReaderGroupConfig));
readerGroupConfig.name = UA_STRING("ReaderGroup1");
readerGroupConfig.rtLevel = UA_PUBSUB_RT_FIXED_SIZE;
readerGroupConfig.subscribingInterval = cycleTimeInMsec;
#ifdef UA_ENABLE_PUBSUB_ENCRYPTION
/* Encryption settings */

View File

@ -375,7 +375,6 @@ addReaderGroup(UA_Server *server) {
memset (&readerGroupConfig, 0, sizeof(UA_ReaderGroupConfig));
readerGroupConfig.name = UA_STRING("ReaderGroup");
readerGroupConfig.rtLevel = UA_PUBSUB_RT_FIXED_SIZE;
readerGroupConfig.subscribingInterval = cycleTimeInMsec;
UA_Server_addReaderGroup(server, connectionIdentSubscriber, &readerGroupConfig,
&readerGroupIdentifier);

View File

@ -779,7 +779,6 @@ UA_Server_removeStandaloneSubscribedDataSet(UA_Server *server, const UA_NodeId s
typedef struct {
UA_String name;
/* non std. field */
UA_Duration subscribingInterval; // Callback interval for subscriber: set the least publishingInterval value of all DSRs in this RG
UA_UInt32 timeout; // Timeout for receive to wait for the packets
UA_PubSubRTLevel rtLevel;
UA_KeyValueMap groupProperties;

View File

@ -112,10 +112,6 @@ UA_ReaderGroup_create(UA_Server *server, UA_NodeId connectionId,
return retval;
}
/* Check user configured params and define it accordingly */
if(newGroup->config.subscribingInterval <= 0.0)
newGroup->config.subscribingInterval = 5; /* Set default to 5 ms */
newGroup->linkedConnection = connection;
/* Add to the connection */

View File

@ -221,7 +221,6 @@ START_TEST(SinglePublishSubscribeDateTime){
UA_ReaderGroupConfig readerGroupConfig;
memset (&readerGroupConfig, 0, sizeof(UA_ReaderGroupConfig));
readerGroupConfig.name = UA_STRING("ReaderGroup1");
readerGroupConfig.subscribingInterval = SUBSCRIBE_INTERVAL;
/* configure the mqtt publish topic */
UA_BrokerWriterGroupTransportDataType brokerTransportSettingsSubscriber;