1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_DP_CHARACTERISTIC_PROFILE_H 17 #define OHOS_DP_CHARACTERISTIC_PROFILE_H 18 19 #include <cstdint> 20 #include <string> 21 #include "dp_parcel.h" 22 23 namespace OHOS { 24 namespace DistributedDeviceProfile { 25 class CharacteristicProfile : public DpParcel { 26 public: CharacteristicProfile(const std::string & deviceId,const std::string & serviceName,const std::string & characteristicKey,const std::string & characteristicValue)27 CharacteristicProfile(const std::string& deviceId, const std::string& serviceName, 28 const std::string& characteristicKey, const std::string& characteristicValue) 29 : deviceId_(deviceId), 30 serviceName_(serviceName), 31 characteristicKey_(characteristicKey), 32 characteristicValue_(characteristicValue) 33 {} 34 CharacteristicProfile() = default; 35 ~CharacteristicProfile() = default; 36 37 std::string GetDeviceId() const; 38 void SetDeviceId(const std::string& deviceId); 39 std::string GetServiceName() const; 40 void SetServiceName(const std::string& serviceName); 41 std::string GetCharacteristicKey() const; 42 void SetCharacteristicKey(const std::string& characteristicId); 43 std::string GetCharacteristicValue() const; 44 void SetCharacteristicValue(const std::string& characteristicValue); 45 bool Marshalling(MessageParcel& parcel) const override; 46 bool UnMarshalling(MessageParcel& parcel) override; 47 bool operator!=(const CharacteristicProfile& charProfile) const; 48 std::string dump() const override; 49 50 private: 51 std::string deviceId_ = ""; 52 std::string serviceName_ = ""; 53 std::string characteristicKey_ = ""; 54 std::string characteristicValue_ = ""; 55 }; 56 } // namespace DistributedDeviceProfile 57 } // namespace OHOS 58 #endif // OHOS_DP_CHARACTERISTIC_PROFILE_H 59