#include #include #include "networklayer.h" #include "ua_application.h" #include #include #include #include #include #include #include "ua_stack_channel_manager.h" #include "ua_stack_session_manager.h" UA_Int32 serverCallback(void * arg) { char *name = (char *) arg; printf("%s does whatever servers do\n",name); Namespace* ns0 = (Namespace*)UA_indexedList_find(appMockup.namespaces, 0)->payload; UA_Int32 retval; UA_Node const * node; UA_ExpandedNodeId serverStatusNodeId = NS0EXPANDEDNODEID(2256); retval = Namespace_get(ns0, &(serverStatusNodeId.nodeId),&node, UA_NULL); if(retval == UA_SUCCESS){ ((UA_ServerStatusDataType*)(((UA_VariableNode*)node)->value.data))->currentTime = UA_DateTime_now(); } return UA_SUCCESS; } int main(int argc, char** argv) { appMockup_init(); NL_data* nl = NL_init(&NL_Description_TcpBinary,16664); struct timeval tv = {1, 0}; // 1 second SL_ChannelManager_init(2,3600000, 873, 23, &nl->endpointUrl); UA_SessionManager_init(2,30000,5); //UA_TL_ConnectionManager_init(10); NL_msgLoop(nl, &tv, serverCallback, argv[0]); }