2 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file client_ide_support.cpp
18 * @author Jihoon Chung (jihoon.chung@samsung.com)
21 #include "client_ide_support.h"
23 #include <dpl/log/log.h>
24 #include <dpl/exception.h>
29 namespace ClientModule {
31 const char* const KEY_DEBUG = "debug";
32 const char* const KEY_PORT = "port";
33 const char* const VALUE_TRUE = "true";
36 bool IDESupport::getDebugMode(bundle* b)
39 LogWarning("bundle is empty");
43 const char* value = bundle_get_val(b, KEY_DEBUG);
44 if (value != NULL && !strcmp(value, VALUE_TRUE)) {
51 bool IDESupport::sendReply(bundle* b, unsigned int portNum)
53 bundle* request = NULL;
54 if (appsvc_create_result_bundle(b, &request) != APPSVC_RET_OK) {
55 LogWarning("Fail to create result bundle");
60 sprintf(port, "%u", portNum);
61 if (appsvc_add_data(request, KEY_PORT, port) != APPSVC_RET_OK) {
62 LogWarning("Fail to add data");
67 if (appsvc_send_result(request, APPSVC_RES_OK) != APPSVC_RET_OK) {
68 LogWarning("Fail to send result");