Commit 425c6a8e authored by Ivan Tyagov's avatar Ivan Tyagov

Allow to set OPC-UA's port over -p CLI switch.

parent 27a854d3
...@@ -435,10 +435,10 @@ int main(int argc, char **argv) { ...@@ -435,10 +435,10 @@ int main(int argc, char **argv) {
arguments.device = DEFAULT_I2C_BLOCK_DEVICE_NAME; arguments.device = DEFAULT_I2C_BLOCK_DEVICE_NAME;
arguments.slave_address_list = DEFAULT_I2C_0_ADDR; arguments.slave_address_list = DEFAULT_I2C_0_ADDR;
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);
printf("port=%d\n", arguments.port); printf("Listening port=%d\n", arguments.port);
printf("device=%s\n", arguments.device); printf("Block device=%s\n", arguments.device);
printf("slave-address-list=%s\n", arguments.slave_address_list); printf("Slave address list=%s\n", arguments.slave_address_list);
// transfer to global variables (CLI input) // transfer to global variables (CLI input)
I2C_VIRTUAL_MODE = arguments.mode; I2C_VIRTUAL_MODE = arguments.mode;
...@@ -462,7 +462,7 @@ int main(int argc, char **argv) { ...@@ -462,7 +462,7 @@ int main(int argc, char **argv) {
signal(SIGTERM, stopHandler); signal(SIGTERM, stopHandler);
UA_Server *server = UA_Server_new(); UA_Server *server = UA_Server_new();
UA_ServerConfig_setDefault(UA_Server_getConfig(server)); UA_ServerConfig_setMinimal(UA_Server_getConfig(server), arguments.port, NULL);
UA_ServerConfig* config = UA_Server_getConfig(server); UA_ServerConfig* config = UA_Server_getConfig(server);
config->verifyRequestTimestamp = UA_RULEHANDLING_ACCEPT; config->verifyRequestTimestamp = UA_RULEHANDLING_ACCEPT;
......
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