Home | History | Annotate | Download | only in anqp
      1 package com.android.server.wifi.anqp;
      2 
      3 import java.net.ProtocolException;
      4 import java.nio.ByteBuffer;
      5 import java.nio.charset.StandardCharsets;
      6 import java.util.ArrayList;
      7 import java.util.List;
      8 
      9 /**
     10  * The Emergency Number ANQP Element, IEEE802.11-2012 section 8.4.4.5
     11  */
     12 public class EmergencyNumberElement extends ANQPElement {
     13     private final List<String> mNumbers;
     14 
     15     public EmergencyNumberElement(Constants.ANQPElementType infoID, ByteBuffer payload)
     16             throws ProtocolException {
     17         super(infoID);
     18 
     19         mNumbers = new ArrayList<String>();
     20 
     21         while (payload.hasRemaining()) {
     22             mNumbers.add(Constants.getPrefixedString(payload, 1, StandardCharsets.UTF_8));
     23         }
     24     }
     25 
     26     public List<String> getNumbers() {
     27         return mNumbers;
     28     }
     29 
     30     @Override
     31     public String toString() {
     32         return "EmergencyNumber{" +
     33                 "mNumbers=" + mNumbers +
     34                 '}';
     35     }
     36 }
     37