|
@@ -1,40 +1,50 @@
|
|
#include "ua_services.h"
|
|
#include "ua_services.h"
|
|
-UA_Int32 Service_GetEndpoints(SL_Channel channel, const UA_GetEndpointsRequest* request, UA_GetEndpointsResponse *response) {
|
|
+UA_Int32 Service_GetEndpoints(SL_Channel channel,
|
|
|
|
+ const UA_GetEndpointsRequest* request,
|
|
|
|
+ UA_GetEndpointsResponse *response) {
|
|
#ifdef DEBUG
|
|
#ifdef DEBUG
|
|
UA_String_printx("endpointUrl=", &request->endpointUrl);
|
|
UA_String_printx("endpointUrl=", &request->endpointUrl);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
response->endpointsSize = 1;
|
|
response->endpointsSize = 1;
|
|
- UA_Array_new((void**) &response->endpoints,response->endpointsSize,&UA_.types[UA_ENDPOINTDESCRIPTION]);
|
|
+ UA_Array_new((void**) &response->endpoints, response->endpointsSize,
|
|
|
|
+ &UA_.types[UA_ENDPOINTDESCRIPTION]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UA_AsymmetricAlgorithmSecurityHeader *asymSettings;
|
|
UA_AsymmetricAlgorithmSecurityHeader *asymSettings;
|
|
SL_Channel_getLocalAsymAlgSettings(channel, &asymSettings);
|
|
SL_Channel_getLocalAsymAlgSettings(channel, &asymSettings);
|
|
- UA_String_copy((UA_String *)&(asymSettings->securityPolicyUri), &response->endpoints[0].securityPolicyUri);
|
|
+ UA_String_copy((UA_String *) &(asymSettings->securityPolicyUri),
|
|
|
|
+ &response->endpoints[0].securityPolicyUri);
|
|
|
|
|
|
response->endpoints[0].securityMode = UA_MESSAGESECURITYMODE_NONE;
|
|
response->endpoints[0].securityMode = UA_MESSAGESECURITYMODE_NONE;
|
|
- UA_String_copycstring("http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary", &response->endpoints[0].transportProfileUri);
|
|
+ UA_String_copycstring(
|
|
|
|
+ "http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary",
|
|
|
|
+ &response->endpoints[0].transportProfileUri);
|
|
|
|
|
|
response->endpoints[0].userIdentityTokensSize = 1;
|
|
response->endpoints[0].userIdentityTokensSize = 1;
|
|
- UA_Array_new((void**) &response->endpoints[0].userIdentityTokens, response->endpoints[0].userIdentityTokensSize,
|
|
+ UA_Array_new((void**) &response->endpoints[0].userIdentityTokens,
|
|
- &UA_.types[UA_USERTOKENPOLICY]);
|
|
+ response->endpoints[0].userIdentityTokensSize,
|
|
|
|
+ &UA_.types[UA_USERTOKENPOLICY]);
|
|
UA_UserTokenPolicy *token = &response->endpoints[0].userIdentityTokens[0];
|
|
UA_UserTokenPolicy *token = &response->endpoints[0].userIdentityTokens[0];
|
|
UA_String_copycstring("my-anonymous-policy", &token->policyId);
|
|
UA_String_copycstring("my-anonymous-policy", &token->policyId);
|
|
token->tokenType = UA_USERTOKENTYPE_ANONYMOUS;
|
|
token->tokenType = UA_USERTOKENTYPE_ANONYMOUS;
|
|
- token->issuerEndpointUrl = (UA_String) {-1, UA_NULL};
|
|
+ token->issuerEndpointUrl = (UA_String ) { -1, UA_NULL };
|
|
- token->issuedTokenType = (UA_String) {-1, UA_NULL};
|
|
+ token->issuedTokenType = (UA_String ) { -1, UA_NULL };
|
|
- token->securityPolicyUri = (UA_String) {-1, UA_NULL};
|
|
+ token->securityPolicyUri = (UA_String ) { -1, UA_NULL };
|
|
|
|
|
|
- UA_String_copy(&request->endpointUrl,&response->endpoints[0].endpointUrl);
|
|
+ UA_String_copy(&request->endpointUrl, &response->endpoints[0].endpointUrl);
|
|
- UA_String_copycstring("http://open62541.info/product/release",&(response->endpoints[0].server.productUri));
|
|
+ UA_String_copycstring("http://open62541.info/product/release",
|
|
|
|
+ &(response->endpoints[0].server.productUri));
|
|
|
|
|
|
- UA_String_copycstring("http://open62541.info/applications/4711",&(response->endpoints[0].server.applicationUri));
|
|
+ UA_String_copycstring("http://open62541.info/applications/4711",
|
|
- UA_LocalizedText_copycstring("The open62541 application",&(response->endpoints[0].server.applicationName));
|
|
+ &(response->endpoints[0].server.applicationUri));
|
|
|
|
+ UA_LocalizedText_copycstring("The open62541 application",
|
|
|
|
+ &(response->endpoints[0].server.applicationName));
|
|
|
|
|
|
response->endpoints[0].server.applicationType = UA_APPLICATIONTYPE_SERVER;
|
|
response->endpoints[0].server.applicationType = UA_APPLICATIONTYPE_SERVER;
|
|
|
|
|
|
-
|
|
+
|
|
return UA_SUCCESS;
|
|
return UA_SUCCESS;
|
|
}
|
|
}
|