2 * Copyright (c) 2020 Project CHIP Authors
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 package com.google.chip.chiptool.commissioner.thread;
21 import android.os.Parcel;
22 import android.os.Parcelable;
23 import androidx.annotation.NonNull;
25 public class ThreadNetworkInfo implements Parcelable {
27 @NonNull private final String networkName;
29 @NonNull private final byte[] extendedPanId;
31 public ThreadNetworkInfo(@NonNull String networkName, @NonNull byte[] extendedPanId) {
32 this.networkName = networkName;
33 this.extendedPanId = extendedPanId;
36 protected ThreadNetworkInfo(Parcel in) {
37 networkName = in.readString();
38 extendedPanId = in.createByteArray();
41 public String getNetworkName() {
45 public byte[] getExtendedPanId() {
49 public static final Creator<ThreadNetworkInfo> CREATOR =
50 new Creator<ThreadNetworkInfo>() {
52 public ThreadNetworkInfo createFromParcel(Parcel in) {
53 return new ThreadNetworkInfo(in);
57 public ThreadNetworkInfo[] newArray(int size) {
58 return new ThreadNetworkInfo[size];
63 public int describeContents() {
68 public void writeToParcel(Parcel parcel, int flags) {
69 parcel.writeString(networkName);
70 parcel.writeByteArray(extendedPanId);
74 public String toString() {
76 "{name=%s, extendedPanId=%s}", networkName, CommissionerUtils.getHexString(extendedPanId));