Commit 1510d153 authored by Ivan Tyagov's avatar Ivan Tyagov

Add UUID of the coupler to the published data set.

parent 0c67ab1c
...@@ -228,15 +228,21 @@ int main(int argc, char **argv) ...@@ -228,15 +228,21 @@ int main(int argc, char **argv)
#endif #endif
// enable keep-alive // enable keep-alive
UA_Float defaultFloat = 0;
UA_Double defaultDouble = 0;
UA_Int64 defaultInt64 = 0; UA_Int64 defaultInt64 = 0;
const PublishedVariable publishedVariableArray[] = { const PublishedVariable publishedVariableArray[] = {
// representing time in millis since start of process
{ {
.name = "heart_beat", .name = "heart_beat",
.description = "Heart beat", .description = "Heart beat",
.pdefaultValue = &defaultInt64, .pdefaultValue = &defaultInt64,
.type = UA_TYPES[UA_TYPES_INT64] .type = UA_TYPES[UA_TYPES_INT64]
},
// represnting the UUID of the coupler
{
.name = "uuid",
.description = "UUID",
.pdefaultValue = &defaultInt64,
.type = UA_TYPES[UA_TYPES_INT64]
} }
}; };
......
...@@ -198,11 +198,11 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) { ...@@ -198,11 +198,11 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) {
/* Static definition of number of fields size to 4 to create four different /* Static definition of number of fields size to 4 to create four different
* targetVariables of distinct datatype * targetVariables of distinct datatype
* Currently the publisher sends only DateTime data type */ * Currently the publisher sends only DateTime data type */
pMetaData->fieldsSize = 1; pMetaData->fieldsSize = 2;
pMetaData->fields = (UA_FieldMetaData*)UA_Array_new (pMetaData->fieldsSize, pMetaData->fields = (UA_FieldMetaData*)UA_Array_new (pMetaData->fieldsSize,
&UA_TYPES[UA_TYPES_FIELDMETADATA]); &UA_TYPES[UA_TYPES_FIELDMETADATA]);
/* DateTime DataType */ /* heartbeat */
UA_FieldMetaData_init (&pMetaData->fields[0]); UA_FieldMetaData_init (&pMetaData->fields[0]);
UA_NodeId_copy (&UA_TYPES[UA_TYPES_INT64].typeId, UA_NodeId_copy (&UA_TYPES[UA_TYPES_INT64].typeId,
&pMetaData->fields[0].dataType); &pMetaData->fields[0].dataType);
...@@ -210,6 +210,13 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) { ...@@ -210,6 +210,13 @@ static void fillTestDataSetMetaData(UA_DataSetMetaDataType *pMetaData) {
pMetaData->fields[0].name = UA_STRING ("Heartbeat (subscribed)"); pMetaData->fields[0].name = UA_STRING ("Heartbeat (subscribed)");
pMetaData->fields[0].valueRank = -1; /* scalar */ pMetaData->fields[0].valueRank = -1; /* scalar */
// UUID
UA_FieldMetaData_init (&pMetaData->fields[1]);
UA_NodeId_copy (&UA_TYPES[UA_TYPES_INT64].typeId,
&pMetaData->fields[1].dataType);
pMetaData->fields[1].builtInType = UA_NS0ID_INT64;
pMetaData->fields[1].name = UA_STRING ("UUID (subscribed)");
pMetaData->fields[1].valueRank = -1; /* scalar */
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment