auto channel_arg = ConvergenceUtils::GetArg(args, kJSArgumentChannel);
std::vector<ConvergenceChannel*>::iterator channel_it = service->GetChannel(channel_arg);
- if (service->IsChannelStarted(channel_it)) {
+ if (service->opened_channels.end() != channel_it) {
result = LogAndCreateTizenError(InvalidStateError, "Service is already started for the channel.",
("Service is already started for the channel."));
} else {
auto channel_arg = ConvergenceUtils::GetArg(args, kJSArgumentChannel);
std::vector<ConvergenceChannel*>::iterator channel_it = service->GetChannel(channel_arg);
- if (!service->IsChannelStarted(channel_it)) {
+ if (service->opened_channels.end() == channel_it) {
result = LogAndCreateTizenError(InvalidStateError, "Service is not started for the channel.",
("Service is not started for the channel."));
} else {
auto channel_arg = ConvergenceUtils::GetArg(args, kJSArgumentChannel);
std::vector<ConvergenceChannel*>::iterator channel_it = service->GetChannel(channel_arg);
- if (!service->IsChannelStarted(channel_it)) {
+ if (service->opened_channels.end() == channel_it) {
result = LogAndCreateTizenError(InvalidStateError, "Service is not started for the channel.",
("Service is not started for the channel."));
} else {
auto channel_arg = ConvergenceUtils::GetArg(args, kJSArgumentChannel);
std::vector<ConvergenceChannel*>::iterator channel_it = service->GetChannel(channel_arg);
- if (!service->IsChannelStarted(channel_it)) {
+ if (service->opened_channels.end() == channel_it) {
result = LogAndCreateTizenError(InvalidStateError, "Service is not started for the channel.",
("Service is not started for the channel."));
} else {
public:
void Refresh();
std::vector<ConvergenceChannel*>::iterator GetChannel(const picojson::value &channel_json);
- bool IsChannelStarted(std::vector<ConvergenceChannel*>::iterator);
void RemoveChannel(std::vector<ConvergenceChannel*>::iterator);
public:
//conv_service_e get_type() const { return type_; }
//conv_device_h get_device() const {return device_; }
picojson::value ToJson() const;
+ std::vector<ConvergenceChannel*> opened_channels;
protected:
conv_service_h FindServiceHandle() const;
conv_device_h device_; // TODO rename to device_handle_
conv_service_e type_;
mutable conv_service_h service_handle_;
- std::vector<ConvergenceChannel*> opened_channels;
friend class ConvergenceAppCommunicationServerService; // It is needed to register the local service
private:
conv_service_connection_state_e connection_state_;