Initial merge-commit of the OIC code. Should successfully do discovery for single...
[platform/upstream/iotivity.git] / csdk / controller / src / remoting / LiteSessionImpl.cpp
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Corporation All Rights Reserved.
4 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
5
6 #include <string>
7 #include "LiteSessionImpl.h"
8
9 #ifdef DEBUG
10 #include <android/log.h>
11 #endif
12
13 namespace remoting {
14
15   LiteSessionImpl::LiteSessionImpl(API::Context::SharedPtr pCCFContext, UUID_t uuid) : LiteSession(pCCFContext, uuid)
16   {
17 #ifdef DEBUG
18     __android_log_print(ANDROID_LOG_VERBOSE, tag, "LiteSessionImpl::LiteSessionImpl()");
19 #endif
20
21     if (pCCFContext_)
22     {
23       // Set callbacks
24       using namespace std::placeholders;
25
26       pCCFContext_->querySession(sessionId_, std::bind(&LiteSessionImpl::querySessionObserver, this, _1));
27     }
28   }
29
30   LiteSessionImpl::~LiteSessionImpl()
31   {
32     applicationSet_.clear();
33   }
34
35
36   void LiteSessionImpl::invite() {
37     if (!isConnected_ && !isInvited_) {
38       if (pCCFContext_) {
39         pInvitationBuilder_ = pCCFContext_->createInvitationBuilder();
40         isInvited_ = true;
41       }
42     }
43   }
44
45   void LiteSessionImpl::disconnect() {
46     // TODO:  implement
47   }
48
49   void LiteSessionImpl::querySessionObserver(const API::SessionQueryResult& sessionQueryResult)
50   {
51
52   }
53 }
54