'convergence_remote_app_control_service.h',
'convergence_app_communication_service.cc',
'convergence_app_communication_service.h',
- 'convergence_channel.cc',
- 'convergence_channel.h',
+ 'convergence_channel_info.cc',
+ 'convergence_channel_info.h',
'convergence_payload.cc',
'convergence_payload.h',
'convergence_client_info.cc',
break;
case 'onStart':
native_.callIfPossible(s._startCallback,
- new Channel(result.channel.uri, result.channel.id), null);
+ new ChannelInfo(result.channel.uri, result.channel.id), null);
break;
case 'onPublish':
native_.callIfPossible(s._sendCallback,
- new Channel(result.channel.uri, result.channel.id), null);
+ new ChannelInfo(result.channel.uri, result.channel.id), null);
break;
case 'onStop':
native_.callIfPossible(s._stopCallback,
- new Channel(result.channel.uri, result.channel.id), null);
+ new ChannelInfo(result.channel.uri, result.channel.id), null);
break;
case 'onMessage': {
var payload = [];
}
native_.callIfPossible(s._listenerCallback,
- new Channel(result.channel.uri, result.channel.id),
+ new ChannelInfo(result.channel.uri, result.channel.id),
payload, result.senderId);
}
break;
{
name: 'channel',
type: types_.PLATFORM_OBJECT,
- values: tizen.Channel,
+ values: tizen.ChannelInfo,
optional: false,
nullable: false
},
{
name: 'channel',
type: types_.PLATFORM_OBJECT,
- values: tizen.Channel,
+ values: tizen.ChannelInfo,
optional: false,
nullable: false
},
{
name: 'channel',
type: types_.PLATFORM_OBJECT,
- values: tizen.Channel,
+ values: tizen.ChannelInfo,
optional: false,
nullable: false
},
native_.callIfPossible(successCallback, this);
};
-function Channel(uri, id) {
- validator_.isConstructorCall(this, Channel);
+function ChannelInfo(uri, id) {
+ validator_.isConstructorCall(this, ChannelInfo);
this.uri = uri;
this.id = id;
}
tizen.RemoteAppControlService = RemoteAppControlService;
tizen.AppCommunicationServerService = AppCommunicationServerService;
tizen.AppCommunicationClientService = AppCommunicationClientService;
-tizen.Channel = Channel;
+tizen.ChannelInfo = ChannelInfo;
tizen.PayloadString = PayloadString;
tizen.PayloadRawBytes = PayloadRawBytes;
#include <stdlib.h>
#include "convergence/convergence_instance.h"
-#include "convergence/convergence_channel.h"
+#include "convergence/convergence_channel_info.h"
#include "convergence/convergence_payload.h"
#include "convergence/convergence_client_info.h"
#include "common/logger.h"
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// TODO check includes
-#include "convergence/convergence_channel.h"
-
-#include <glib.h>
-#include <d2d_conv_internal.h>
-
-#include "convergence/convergence_instance.h"
-#include "convergence/convergence_utils.h"
-#include "common/logger.h"
-
-namespace extension {
-namespace convergence {
-
-namespace {
-// Channel keys
-static const std::string kId = "id"; // This id is used in arguments (comes from JS layer)
-static const std::string kChannelId = "channel_id"; // This id is used in the App Comm Service engine
-static const std::string kUri = "uri";
-} // namespace
-
-ConvergenceChannel::ConvergenceChannel()
- : channel_handle_(nullptr) {
- ScopeLogger();
-}
-
-ConvergenceChannel::ConvergenceChannel(const picojson::value &channel_json)
- : channel_handle_(nullptr) {
- ScopeLogger();
- FromJson(channel_json);
-}
-
-ConvergenceChannel::~ConvergenceChannel() {
- ScopeLogger();
-
- if (channel_handle_) {
- conv_channel_destroy(channel_handle_);
- channel_handle_ = NULL;
- }
-}
-
-conv_channel_h ConvergenceChannel::GetHandle() const {
- ScopeLogger();
- return channel_handle_;
-}
-
-
-void ConvergenceChannel::FromJson(const picojson::value &channel_json) {
- ScopeLogger();
- if (channel_json.is<picojson::null>()) {
- LoggerE("ERROR: Channel json value is NULL");
- return;
- }
-
- if (channel_handle_) {
- conv_channel_destroy(channel_handle_);
- channel_handle_ = NULL;
- }
-
- int error = conv_channel_create(&channel_handle_);
- if ((CONV_ERROR_NONE != error) || !channel_handle_) {
- trace_conv_error(error, __LINE__, "creating channel handle");
- return;
- }
-
- const std::string id = channel_json.get(kId).to_str();
- error = conv_channel_set_string(channel_handle_, kChannelId.c_str(), id.c_str());
- if (CONV_ERROR_NONE != error) {
- trace_conv_error(error, __LINE__, "setting channel string Id");
- }
-
- const std::string uri = channel_json.get(kUri).to_str();
- error = conv_channel_set_string(channel_handle_, kUri.c_str(), uri.c_str());
- if (CONV_ERROR_NONE != error) {
- trace_conv_error(error, __LINE__, "setting channel string URI");
- }
-}
-
-picojson::value ConvergenceChannel::ToJson(conv_channel_h channel_handle) {
- ScopeLogger();
-
- picojson::object channel_object;
- if (!channel_handle) {
- LoggerE("Error: trying to convert NULL channel handle to json");
- return picojson::value(channel_object);
- }
-
- { // Extracting channel ID
- char *id = nullptr;
- const int error = conv_channel_get_string(channel_handle, kChannelId.c_str(), &id);
- if (CONV_ERROR_NONE != error) {
- trace_conv_error(error, __LINE__, "getting channel string Id");
- } else {
- channel_object[kId] = picojson::value(id);
- free(id);
- }
- }
-
- { // Extracting channel URI
- char *uri = nullptr;
- const int error = conv_channel_get_string(channel_handle, kUri.c_str(), &uri);
- if (CONV_ERROR_NONE != error) {
- trace_conv_error(error, __LINE__, "getting channel string URI");
- } else {
- channel_object[kUri] = picojson::value(uri);
- free(uri);
- }
- };
-
- return picojson::value(channel_object);
-}
-
-
-} // namespace convergence
-} // namespace extension
+++ /dev/null
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef CONVERGENCE_CONVERGENCE_CHANNEL_H__
-#define CONVERGENCE_CONVERGENCE_CHANNEL_H__
-
-// TODO check includes
-#include <d2d_conv_manager.h>
-
-#include <string>
-#include <unordered_map>
-
-#include "common/tizen_result.h"
-
-namespace extension {
-namespace convergence {
-
-class ConvergenceChannel {
-
- public:
- ConvergenceChannel();
- ConvergenceChannel(const picojson::value &channel_json);
- virtual ~ConvergenceChannel();
- ConvergenceChannel(const ConvergenceChannel&) = delete;
- ConvergenceChannel(ConvergenceChannel&&) = delete;
- ConvergenceChannel& operator=(const ConvergenceChannel&) = delete;
- ConvergenceChannel& operator=(ConvergenceChannel&&) = delete;
-
- public:
- conv_channel_h GetHandle() const;
- void FromJson(const picojson::value &channel_json);
-
- public:
- static picojson::value ToJson(conv_channel_h channel_handle);
-
- private:
- conv_channel_h channel_handle_;
-};
-
-} // namespace convergence
-} // namespace extension
-
-#endif // CONVERGENCE_CONVERGENCE_CHANNEL_H__
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// TODO check includes
+#include "convergence/convergence_channel_info.h"
+
+#include <glib.h>
+#include <d2d_conv_internal.h>
+
+#include "convergence/convergence_instance.h"
+#include "convergence/convergence_utils.h"
+#include "common/logger.h"
+
+namespace extension {
+namespace convergence {
+
+namespace {
+// Channel keys
+static const std::string kId = "id"; // This id is used in arguments (comes from JS layer)
+static const std::string kChannelId = "channel_id"; // This id is used in the App Comm Service engine
+static const std::string kUri = "uri";
+} // namespace
+
+ConvergenceChannel::ConvergenceChannel()
+ : channel_handle_(nullptr) {
+ ScopeLogger();
+}
+
+ConvergenceChannel::ConvergenceChannel(const picojson::value &channel_json)
+ : channel_handle_(nullptr) {
+ ScopeLogger();
+ FromJson(channel_json);
+}
+
+ConvergenceChannel::~ConvergenceChannel() {
+ ScopeLogger();
+
+ if (channel_handle_) {
+ conv_channel_destroy(channel_handle_);
+ channel_handle_ = NULL;
+ }
+}
+
+conv_channel_h ConvergenceChannel::GetHandle() const {
+ ScopeLogger();
+ return channel_handle_;
+}
+
+
+void ConvergenceChannel::FromJson(const picojson::value &channel_json) {
+ ScopeLogger();
+ if (channel_json.is<picojson::null>()) {
+ LoggerE("ERROR: Channel json value is NULL");
+ return;
+ }
+
+ if (channel_handle_) {
+ conv_channel_destroy(channel_handle_);
+ channel_handle_ = NULL;
+ }
+
+ int error = conv_channel_create(&channel_handle_);
+ if ((CONV_ERROR_NONE != error) || !channel_handle_) {
+ trace_conv_error(error, __LINE__, "creating channel handle");
+ return;
+ }
+
+ const std::string id = channel_json.get(kId).to_str();
+ error = conv_channel_set_string(channel_handle_, kChannelId.c_str(), id.c_str());
+ if (CONV_ERROR_NONE != error) {
+ trace_conv_error(error, __LINE__, "setting channel string Id");
+ }
+
+ const std::string uri = channel_json.get(kUri).to_str();
+ error = conv_channel_set_string(channel_handle_, kUri.c_str(), uri.c_str());
+ if (CONV_ERROR_NONE != error) {
+ trace_conv_error(error, __LINE__, "setting channel string URI");
+ }
+}
+
+picojson::value ConvergenceChannel::ToJson(conv_channel_h channel_handle) {
+ ScopeLogger();
+
+ picojson::object channel_object;
+ if (!channel_handle) {
+ LoggerE("Error: trying to convert NULL channel handle to json");
+ return picojson::value(channel_object);
+ }
+
+ { // Extracting channel ID
+ char *id = nullptr;
+ const int error = conv_channel_get_string(channel_handle, kChannelId.c_str(), &id);
+ if (CONV_ERROR_NONE != error) {
+ trace_conv_error(error, __LINE__, "getting channel string Id");
+ } else {
+ channel_object[kId] = picojson::value(id);
+ free(id);
+ }
+ }
+
+ { // Extracting channel URI
+ char *uri = nullptr;
+ const int error = conv_channel_get_string(channel_handle, kUri.c_str(), &uri);
+ if (CONV_ERROR_NONE != error) {
+ trace_conv_error(error, __LINE__, "getting channel string URI");
+ } else {
+ channel_object[kUri] = picojson::value(uri);
+ free(uri);
+ }
+ };
+
+ return picojson::value(channel_object);
+}
+
+
+} // namespace convergence
+} // namespace extension
--- /dev/null
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef CONVERGENCE_CONVERGENCE_CHANNEL_H__
+#define CONVERGENCE_CONVERGENCE_CHANNEL_H__
+
+// TODO check includes
+#include <d2d_conv_manager.h>
+
+#include <string>
+#include <unordered_map>
+
+#include "common/tizen_result.h"
+
+namespace extension {
+namespace convergence {
+
+class ConvergenceChannel {
+
+ public:
+ ConvergenceChannel();
+ ConvergenceChannel(const picojson::value &channel_json);
+ virtual ~ConvergenceChannel();
+ ConvergenceChannel(const ConvergenceChannel&) = delete;
+ ConvergenceChannel(ConvergenceChannel&&) = delete;
+ ConvergenceChannel& operator=(const ConvergenceChannel&) = delete;
+ ConvergenceChannel& operator=(ConvergenceChannel&&) = delete;
+
+ public:
+ conv_channel_h GetHandle() const;
+ void FromJson(const picojson::value &channel_json);
+
+ public:
+ static picojson::value ToJson(conv_channel_h channel_handle);
+
+ private:
+ conv_channel_h channel_handle_;
+};
+
+} // namespace convergence
+} // namespace extension
+
+#endif // CONVERGENCE_CONVERGENCE_CHANNEL_H__
"tizen.RemoteAppControlService",
"tizen.AppCommunicationServerService",
"tizen.AppCommunicationClientService",
- "tizen.Channel",
+ "tizen.ChannelInfo",
"tizen.PayloadString",
"tizen.PayloadRawBytes",
nullptr
#include "convergence/convergence_manager.h"
#include "convergence/convergence_remote_app_control_service.h"
#include "convergence/convergence_app_communication_service.h"
-#include "convergence/convergence_channel.h"
+#include "convergence/convergence_channel_info.h"
#include "convergence/convergence_payload.h"
#include "common/logger.h"
#include "common/picojson.h"