Beispiel #1
0
static void setup_lds(void) {
    // start LDS server
    running_lds = UA_Boolean_new();
    *running_lds = true;
    config_lds = UA_ServerConfig_new_default();
    config_lds->applicationDescription.applicationType = UA_APPLICATIONTYPE_DISCOVERYSERVER;
    UA_String_deleteMembers(&config_lds->applicationDescription.applicationUri);
    config_lds->applicationDescription.applicationUri =
        UA_STRING_ALLOC("urn:open62541.test.local_discovery_server");
    UA_LocalizedText_deleteMembers(&config_lds->applicationDescription.applicationName);
    config_lds->applicationDescription.applicationName
        = UA_LOCALIZEDTEXT_ALLOC("en", "LDS Server");
    config_lds->mdnsServerName = UA_String_fromChars("LDS_test");
    config_lds->serverCapabilitiesSize = 1;
    UA_String *caps = UA_String_new();
    *caps = UA_String_fromChars("LDS");
    config_lds->serverCapabilities = caps;
    config_lds->discoveryCleanupTimeout = registerTimeout;
    server_lds = UA_Server_new(config_lds);
    UA_Server_run_startup(server_lds);
    pthread_create(&server_thread_lds, NULL, serverloop_lds, NULL);

    // wait until LDS started
    UA_sleep(1000);
    sleep(1);
}
Beispiel #2
0
static void setup(void) {
    running = UA_Boolean_new();
    *running = true;
    config = UA_ServerConfig_new_default();
    server = UA_Server_new(config);
    UA_Server_run_startup(server);
    pthread_create(&server_thread, NULL, serverloop, NULL);
}
Beispiel #3
0
static void setup_server(void) {
    // start server
    running_translate_browse = UA_Boolean_new();
    *running_translate_browse = true;
    server_translate_config = UA_ServerConfig_new_default();
    UA_String_deleteMembers(&server_translate_config->applicationDescription.applicationUri);
    server_translate_config->applicationDescription.applicationUri =
        UA_String_fromChars("urn:open62541.test.server_translate_browse");
    server_translate_browse = UA_Server_new(server_translate_config);
    UA_Server_run_startup(server_translate_browse);
    pthread_create(&server_thread_translate_browse, NULL, serverloop_register, NULL);
}
Beispiel #4
0
static void setup_lds(void) {
    // start LDS server
    running_lds = UA_Boolean_new();
    *running_lds = true;

    server_lds = UA_Server_new();
    configure_lds_server(server_lds);

    UA_Server_run_startup(server_lds);
    THREAD_CREATE(server_thread_lds, serverloop_lds);

    // wait until LDS started
    UA_fakeSleep(1000);
    UA_realSleep(1000);
}
static void setup(void) {
    running = UA_Boolean_new();
    *running = true;
    config = UA_ServerConfig_new_default();
    config->maxPublishReqPerSession = 5;
    server = UA_Server_new(config);
    UA_Server_run_startup(server);
    addNewEventType();
    setupSelectClauses();
    THREAD_CREATE(server_thread, serverloop);

    client = UA_Client_new(UA_ClientConfig_default);
    UA_StatusCode retval = UA_Client_connect(client, "opc.tcp://localhost:4840");
    ck_assert_uint_eq(retval, UA_STATUSCODE_GOOD);
    setupSubscription();
}
Beispiel #6
0
static void setup_register(void) {
    // start register server
    running_register = UA_Boolean_new();
    *running_register = true;
    config_register = UA_ServerConfig_new_minimal(16664, NULL);
    UA_String_deleteMembers(&config_register->applicationDescription.applicationUri);
    config_register->applicationDescription.applicationUri =
        UA_String_fromChars("urn:open62541.test.server_register");
    UA_LocalizedText_deleteMembers(&config_register->applicationDescription.applicationName);
    config_register->applicationDescription.applicationName =
        UA_LOCALIZEDTEXT_ALLOC("de", "Anmeldungsserver");
    config_register->mdnsServerName = UA_String_fromChars("Register_test");
    server_register = UA_Server_new(config_register);
    UA_Server_run_startup(server_register);
    pthread_create(&server_thread_register, NULL, serverloop_register, NULL);
}
Beispiel #7
0
static void setup_register(void) {
    // start register server
    running_register = UA_Boolean_new();
    *running_register = true;

    server_register = UA_Server_new();
    UA_ServerConfig *config_register = UA_Server_getConfig(server_register);
    UA_ServerConfig_setMinimal(config_register, 16664, NULL);

    UA_String_deleteMembers(&config_register->applicationDescription.applicationUri);
    config_register->applicationDescription.applicationUri =
        UA_String_fromChars("urn:open62541.test.server_register");
    UA_LocalizedText_deleteMembers(&config_register->applicationDescription.applicationName);
    config_register->applicationDescription.applicationName =
        UA_LOCALIZEDTEXT_ALLOC("de", "Anmeldungsserver");
#ifdef UA_ENABLE_DISCOVERY_MULTICAST
    config_register->discovery.mdns.mdnsServerName = UA_String_fromChars("Register_test");
#endif

    UA_Server_run_startup(server_register);
    THREAD_CREATE(server_thread_register, serverloop_register);
}