1 /*
2 * Copyright (c) 2025 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 #include "wifi_id.h"
17 #include "parcel_macro.h"
18 #include "edm_log.h"
19
20 namespace OHOS {
21 namespace EDM {
Marshalling(MessageParcel & parcel) const22 bool WifiId::Marshalling(MessageParcel &parcel) const
23 {
24 WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, ssid_);
25 WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, bssid_);
26 return true;
27 }
28
Unmarshalling(MessageParcel & parcel,WifiId & wifiId)29 bool WifiId::Unmarshalling(MessageParcel &parcel, WifiId &wifiId)
30 {
31 std::string ssid = parcel.ReadString();
32 std::string bssid = parcel.ReadString();
33 wifiId.SetSsid(ssid);
34 wifiId.SetBssid(bssid);
35 return true;
36 }
37
SetSsid(std::string ssid)38 void WifiId::SetSsid(std::string ssid)
39 {
40 ssid_ = ssid;
41 }
42
SetBssid(std::string bssid)43 void WifiId::SetBssid(std::string bssid)
44 {
45 bssid_ = bssid;
46 }
47
GetSsid() const48 std::string WifiId::GetSsid() const
49 {
50 return ssid_;
51 }
52
GetBssid() const53 std::string WifiId::GetBssid() const
54 {
55 return bssid_;
56 }
57 } // namespace EDM
58 } // namespace OHOS