• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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_PLMN_FILE_H
17 #define OHOS_PLMN_FILE_H
18 
19 #include <iostream>
20 #include <sstream>
21 
22 #include "parcel.h"
23 #include "sim_utils.h"
24 #include "telephony_log_wrapper.h"
25 
26 namespace OHOS {
27 namespace Telephony {
28 class PlmnFile : public Parcelable {
29 public:
30     bool ReadFromParcel(Parcel &parcel);
31     bool Marshalling(Parcel &parcel) const override;
32     static PlmnFile *UnMarshalling(Parcel &parcel);
33     PlmnFile(unsigned char *bytes, int offset);
34     ~PlmnFile();
35 
36 private:
37     PlmnFile(const std::string &plmn, int accessTechs);
38     std::string AccessTechString();
39     static const uint32_t OFFSET_A = 3;
40     static const uint32_t OFFSET_B = 4;
41     static const uint32_t OFFSET_ALL = 8;
42     static const uint32_t RAT_UMTS = 0x8000;
43     static const uint32_t RAT_LTE = 0x4000;
44     static const uint32_t RAT_GSM = 0x0080;
45     static const uint32_t RAT_GSM_COMPACT = 0x0040;
46     static const uint32_t RAT_EVDO = 0x0020;
47     static const uint32_t RAT_1X = 0x0010;
48     static const uint32_t RAT_REMAINED = 0x3F0F;
49     std::string plmn_ = "";
50     uint32_t rat_ = 0;
51 };
52 } // namespace Telephony
53 } // namespace OHOS
54 #endif // OHOS_PLMN_FILE_H
55