1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
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
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17package com.android.server.wifi.hotspot2;
18
19/**
20 * This class carries the payload of a Hotspot 2.0 Wireless Network Management (WNM) frame,
21 * described in the Hotspot 2.0 spec, section 3.2.
22 */
23public class WnmData {
24    public static final int ESS = 1;   // HS2.0 spec section 3.2.1.2, table 4
25
26    private final long mBssid;
27    private final String mUrl;
28    private final boolean mDeauthEvent;
29    private final int mMethod;
30    private final boolean mEss;
31    private final int mDelay;
32
33    public WnmData(long bssid, String url, int method) {
34        mBssid = bssid;
35        mUrl = url;
36        mMethod = method;
37        mEss = false;
38        mDelay = -1;
39        mDeauthEvent = false;
40    }
41
42    public WnmData(long bssid, String url, boolean ess, int delay) {
43        mBssid = bssid;
44        mUrl = url;
45        mEss = ess;
46        mDelay = delay;
47        mMethod = -1;
48        mDeauthEvent = true;
49    }
50
51    public long getBssid() {
52        return mBssid;
53    }
54
55    public String getUrl() {
56        return mUrl;
57    }
58
59    public boolean isDeauthEvent() {
60        return mDeauthEvent;
61    }
62
63    public int getMethod() {
64        return mMethod;
65    }
66
67    public boolean isEss() {
68        return mEss;
69    }
70
71    public int getDelay() {
72        return mDelay;
73    }
74}
75