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 
17 package android.net.wifi;
18 
19 /**
20  * This object contains the payload of an ANQP element.
21  * Vendor id is the vendor ID for the element, or 0 if it is an 802.11(u) element.
22  * Hotspot 2.0 uses the WFA Vendor ID which is 0x506f9a
23  * The payload contains the bytes of the payload, starting after the length octet(s).
24  * @hide
25  */
26 public class AnqpInformationElement {
27     public static final int HOTSPOT20_VENDOR_ID = 0x506f9a;
28 
29     public static final int ANQP_QUERY_LIST = 256;
30     public static final int ANQP_CAPABILITY_LIST = 257;
31     public static final int ANQP_VENUE_NAME = 258;
32     public static final int ANQP_EMERGENCY_NUMBER = 259;
33     public static final int ANQP_NWK_AUTH_TYPE = 260;
34     public static final int ANQP_ROAMING_CONSORTIUM = 261;
35     public static final int ANQP_IP_ADDR_AVAILABILITY = 262;
36     public static final int ANQP_NAI_REALM = 263;
37     public static final int ANQP_3GPP_NETWORK = 264;
38     public static final int ANQP_GEO_LOC = 265;
39     public static final int ANQP_CIVIC_LOC = 266;
40     public static final int ANQP_LOC_URI = 267;
41     public static final int ANQP_DOM_NAME = 268;
42     public static final int ANQP_EMERGENCY_ALERT = 269;
43     public static final int ANQP_TDLS_CAP = 270;
44     public static final int ANQP_EMERGENCY_NAI = 271;
45     public static final int ANQP_NEIGHBOR_REPORT = 272;
46     public static final int ANQP_VENDOR_SPEC = 56797;
47 
48     public static final int HS_QUERY_LIST = 1;
49     public static final int HS_CAPABILITY_LIST = 2;
50     public static final int HS_FRIENDLY_NAME = 3;
51     public static final int HS_WAN_METRICS = 4;
52     public static final int HS_CONN_CAPABILITY = 5;
53     public static final int HS_NAI_HOME_REALM_QUERY = 6;
54     public static final int HS_OPERATING_CLASS = 7;
55     public static final int HS_OSU_PROVIDERS = 8;
56     public static final int HS_ICON_REQUEST = 10;
57     public static final int HS_ICON_FILE = 11;
58 
59     private final int mVendorId;
60     private final int mElementId;
61     private final byte[] mPayload;
62 
AnqpInformationElement(int vendorId, int elementId, byte[] payload)63     public AnqpInformationElement(int vendorId, int elementId, byte[] payload) {
64         mVendorId = vendorId;
65         mElementId = elementId;
66         mPayload = payload;
67     }
68 
getVendorId()69     public int getVendorId() {
70         return mVendorId;
71     }
72 
getElementId()73     public int getElementId() {
74         return mElementId;
75     }
76 
getPayload()77     public byte[] getPayload() {
78         return mPayload;
79     }
80 }
81