ua_services_session.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include "ua_services.h"
  2. #include "ua_server.h"
  3. UA_Int32 Service_CreateSession(UA_Server *server, UA_SecureChannel *channel,
  4. const UA_CreateSessionRequest *request,
  5. UA_CreateSessionResponse *response) {
  6. /* UA_Session *newSession;
  7. UA_Int64 timeout;
  8. UA_SessionManager_getSessionTimeout(&timeout);
  9. UA_Session_new(&newSession);
  10. //TODO get maxResponseMessageSize
  11. UA_Session_setApplicationPointer(newSession, &server->applications[0]); // todo: select application according to the endpointurl in the request
  12. UA_Session_init(newSession, (UA_String*)&request->sessionName,
  13. request->requestedSessionTimeout,
  14. request->maxResponseMessageSize,
  15. 9999,
  16. (UA_Session_idProvider)UA_SessionManager_generateSessionId,
  17. timeout);
  18. UA_SessionManager_addSession(newSession);
  19. UA_Session_getId(newSession, &response->sessionId);
  20. UA_Session_getToken(newSession, &(response->authenticationToken));
  21. response->revisedSessionTimeout = timeout; */
  22. //TODO fill results
  23. return UA_SUCCESS;
  24. }
  25. UA_Int32 Service_ActivateSession(UA_Server *server, UA_Session *session,
  26. const UA_ActivateSessionRequest *request,
  27. UA_ActivateSessionResponse *response) {
  28. //UA_Session_bind(session, channel);
  29. //TODO fill results
  30. return UA_SUCCESS;
  31. }
  32. UA_Int32 Service_CloseSession(UA_Server *server, UA_Session *session,
  33. const UA_CloseSessionRequest *request,
  34. UA_CloseSessionResponse *response) {
  35. /* UA_NodeId sessionId; */
  36. /* UA_Session_getId(session,&sessionId); */
  37. /* UA_SessionManager_removeSession(&sessionId); */
  38. // FIXME: set response
  39. return UA_SUCCESS;
  40. }