2 * Copyright (c) 2022 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.
16 #include "AittOption.h"
18 #include "aitt_internal.h"
20 AittOption::AittOption() : clean_session_(false), use_custom_broker(false)
24 AittOption::AittOption(bool clean_session, bool use_custom_mqtt_broker)
25 : clean_session_(clean_session), use_custom_broker(use_custom_mqtt_broker)
29 void AittOption::SetCleanSession(bool val)
34 bool AittOption::GetCleanSession() const
36 return clean_session_;
39 void AittOption::SetUseCustomMqttBroker(bool val)
41 use_custom_broker = val;
44 bool AittOption::GetUseCustomMqttBroker() const
46 return use_custom_broker;
49 void AittOption::SetServiceID(const std::string& id)
51 RET_IF(false == use_custom_broker);
55 const char* AittOption::GetServiceID() const
57 return service_id.c_str();
60 void AittOption::SetLocationID(const std::string& id)
62 RET_IF(false == use_custom_broker);
66 const char* AittOption::GetLocationID() const
68 return location_id.c_str();
71 void AittOption::SetRootCA(const std::string& ca)
73 RET_IF(false == use_custom_broker);
77 const char* AittOption::GetRootCA() const
79 return root_ca.c_str();
82 void AittOption::SetCustomRWFile(const std::string& file)
84 RET_IF(false == use_custom_broker);
85 custom_rw_file = file;
88 const char* AittOption::GetCustomRWFile() const
90 return custom_rw_file.c_str();