Commit a43f1d4c authored by Ivan Tyagov's avatar Ivan Tyagov

wip

parent 2c6d0822
#!/bin/bash #!/bin/bash
rm -f server_publish server_subscribe
# build OPC UA server which publishes msgs # build OPC UA server which publishes msgs
gcc -I /usr/local/include/ -std=c99 server.c -o server_publish -l:libopen62541.so -L/usr/local/lib -lmbedcrypto -lmbedx509 gcc -o server_publish -I /usr/local/include/ -std=c99 server.c -l:libopen62541.so -L/usr/local/lib -lmbedcrypto -lmbedx509
# build OPC Ua server which subscribes to msgs # build OPC Ua server which subscribes to msgs
gcc -o server_subscribe -I /usr/local/include/ -std=c99 server_subscribe.c -l:libopen62541.so -L/usr/local/lib -I ~/open62541/src/pubsub/ -I ~/open62541/deps/ gcc -o server_subscribe -I /usr/local/include/ -std=c99 server_subscribe.c -l:libopen62541.so -L/usr/local/lib -I ~/open62541/src/pubsub/ -I ~/open62541/deps/
......
...@@ -228,8 +228,8 @@ int main(int argc, char **argv) ...@@ -228,8 +228,8 @@ int main(int argc, char **argv)
#endif #endif
// enable keep-alive // enable keep-alive
//UA_Float defaultFloat = 0; UA_Float defaultFloat = 0;
//UA_Double defaultDouble = 0; UA_Double defaultDouble = 0;
UA_Int64 defaultInt64 = 0; UA_Int64 defaultInt64 = 0;
const PublishedVariable publishedVariableArray[] = { const PublishedVariable publishedVariableArray[] = {
{ {
...@@ -244,7 +244,7 @@ int main(int argc, char **argv) ...@@ -244,7 +244,7 @@ int main(int argc, char **argv)
UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp"); UA_STRING("http://opcfoundation.org/UA-Profile/Transport/pubsub-udp-uadp");
UA_NetworkAddressUrlDataType networkAddressUrl = UA_NetworkAddressUrlDataType networkAddressUrl =
{UA_STRING_NULL , UA_STRING("opc.udp://224.0.0.22:4840/")}; {UA_STRING_NULL , UA_STRING("opc.udp://224.0.0.22:4840/")};
/*
UA_ServerConfig_addPubSubTransportLayer(config, UA_PubSubTransportLayerUDPMP()); UA_ServerConfig_addPubSubTransportLayer(config, UA_PubSubTransportLayerUDPMP());
addPubSubConnection(server, &transportProfile, &networkAddressUrl); addPubSubConnection(server, &transportProfile, &networkAddressUrl);
...@@ -256,7 +256,7 @@ int main(int argc, char **argv) ...@@ -256,7 +256,7 @@ int main(int argc, char **argv)
} }
addWriterGroup(server); addWriterGroup(server);
addDataSetWriter(server); addDataSetWriter(server);
*/
// run server // run server
UA_StatusCode retval = UA_Server_run(server, &running); UA_StatusCode retval = UA_Server_run(server, &running);
UA_Server_delete(server); UA_Server_delete(server);
......
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