ua_services_discovery.c 1.4 KB

1234567891011121314151617181920212223242526
  1. #include "ua_services.h"
  2. UA_Int32 Service_GetEndpoints(SL_Channel *channel, const UA_GetEndpointsRequest* request, UA_GetEndpointsResponse *response) {
  3. UA_String_printx("endpointUrl=", &(request->endpointUrl));
  4. response->endpointsSize = 1;
  5. UA_Array_new((void**) &(response->endpoints),response->endpointsSize,UA_ENDPOINTDESCRIPTION);
  6. //Security issues:
  7. //The policy should be 'http://opcfoundation.org/UA/SecurityPolicy#None'
  8. //FIXME String or ByteString
  9. UA_String_copy((UA_String*)&(channel->localAsymAlgSettings.securityPolicyUri),&(response->endpoints[0]->securityPolicyUri));
  10. //FIXME hard-coded code
  11. response->endpoints[0]->securityMode = UA_MESSAGESECURITYMODE_NONE;
  12. UA_String_copy(&(channel->tlConnection->localEndpointUrl),&(response->endpoints[0]->endpointUrl));
  13. UA_String_copycstring("http://open62541.info/product/release",&(response->endpoints[0]->server.productUri));
  14. // FIXME: This information should be provided by the application, preferably in the address space
  15. UA_String_copycstring("http://open62541.info/applications/4711",&(response->endpoints[0]->server.applicationUri));
  16. UA_LocalizedText_copycstring("The open62541 application",&(response->endpoints[0]->server.applicationName));
  17. // FIXME: This should be a feature of the application and an enum
  18. response->endpoints[0]->server.applicationType = UA_APPLICATIONTYPE_SERVER;
  19. // all the other strings are empty by initialization
  20. return UA_SUCCESS;
  21. }