Commit 9d0283a5 authored by Ivan Tyagov's avatar Ivan Tyagov

UUID -> ID (less bytes to transfer).

parent 5ae38787
...@@ -55,7 +55,7 @@ static struct argp_option options[] = { ...@@ -55,7 +55,7 @@ static struct argp_option options[] = {
{"password", 'w', "", 0, "Password."}, {"password", 'w', "", 0, "Password."},
{"key", 'k', "", 0, "x509 key."}, {"key", 'k', "", 0, "x509 key."},
{"certificate", 'c', "", 0, "X509 certificate."}, {"certificate", 'c', "", 0, "X509 certificate."},
{"uuid", 'i', "", 0, "UUID of coupler"}, {"id", 'i', "", 0, "ID of coupler."},
{0} {0}
}; };
...@@ -69,7 +69,7 @@ struct arguments ...@@ -69,7 +69,7 @@ struct arguments
char *password; char *password;
char *key; char *key;
char *certificate; char *certificate;
char *uuid; char *id;
}; };
static error_t parse_opt(int key, char *arg, struct argp_state *state) static error_t parse_opt(int key, char *arg, struct argp_state *state)
...@@ -101,7 +101,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) ...@@ -101,7 +101,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
arguments->key = arg; arguments->key = arg;
break; break;
case 'i': case 'i':
arguments->uuid = arg; arguments->id = arg;
break; break;
case ARGP_KEY_ARG: case ARGP_KEY_ARG:
return 0; return 0;
...@@ -138,7 +138,7 @@ int main(int argc, char **argv) ...@@ -138,7 +138,7 @@ int main(int argc, char **argv)
arguments.password = ""; arguments.password = "";
arguments.key = ""; arguments.key = "";
arguments.certificate = ""; arguments.certificate = "";
arguments.uuid = ""; arguments.id = "";
argp_parse(&argp, argc, argv, 0, 0, &arguments); argp_parse(&argp, argc, argv, 0, 0, &arguments);
printf("Mode=%d\n", arguments.mode); printf("Mode=%d\n", arguments.mode);
...@@ -147,7 +147,7 @@ int main(int argc, char **argv) ...@@ -147,7 +147,7 @@ int main(int argc, char **argv)
printf("Slave address list=%s\n", arguments.slave_address_list); printf("Slave address list=%s\n", arguments.slave_address_list);
printf("Key=%s\n", arguments.key); printf("Key=%s\n", arguments.key);
printf("Certificate=%s\n", arguments.certificate); printf("Certificate=%s\n", arguments.certificate);
printf("UUID=%s\n", arguments.uuid); printf("ID=%s\n", arguments.id);
// transfer to global variables (CLI input) // transfer to global variables (CLI input)
...@@ -229,6 +229,7 @@ int main(int argc, char **argv) ...@@ -229,6 +229,7 @@ int main(int argc, char **argv)
// enable keep-alive // enable keep-alive
UA_Int64 defaultInt64 = 0; UA_Int64 defaultInt64 = 0;
UA_Int64 couplerID = atoi(arguments.id);
const PublishedVariable publishedVariableArray[] = { const PublishedVariable publishedVariableArray[] = {
// representing time in millis since start of process // representing time in millis since start of process
{ {
...@@ -241,7 +242,7 @@ int main(int argc, char **argv) ...@@ -241,7 +242,7 @@ int main(int argc, char **argv)
{ {
.name = "id", .name = "id",
.description = "ID", .description = "ID",
.pdefaultValue = &defaultInt64, .pdefaultValue = &couplerID,
.type = UA_TYPES[UA_TYPES_INT64] .type = UA_TYPES[UA_TYPES_INT64]
} }
}; };
......
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