/** * @param rawData rawData * @param offset offset * @param length length * @throws IllegalRawDataException if parsing the raw data fails. */ private Dot112040BssCoexistenceElement(byte[] rawData, int offset, int length) throws IllegalRawDataException { super(rawData, offset, length, Dot11InformationElementId.IE_20_40_BSS_COEXISTENCE); if (getLengthAsInt() != 1) { throw new IllegalRawDataException( "The length must be 1 but is actually: " + getLengthAsInt()); } this.informationRequested = (rawData[offset + 2] & 0x01) != 0; this.fortyMhzIntolerant = (rawData[offset + 2] & 0x02) != 0; this.twentyMhzBssWidthRequested = (rawData[offset + 2] & 0x04) != 0; this.obssScanningExemptionRequested = (rawData[offset + 2] & 0x08) != 0; this.obssScanningExemptionGranted = (rawData[offset + 2] & 0x10) != 0; this.bit5 = (rawData[offset + 2] & 0x20) != 0; this.bit6 = (rawData[offset + 2] & 0x40) != 0; this.bit7 = (rawData[offset + 2] & 0x80) != 0; }
/** * @param indent indent * @return the string representation of this object. */ public String toString(String indent) { StringBuilder sb = new StringBuilder(); String ls = System.getProperty("line.separator"); sb.append(indent).append("20/40 BSS Coexistence:").append(ls); sb.append(indent).append(" Element ID: ").append(getElementId()).append(ls); sb.append(indent).append(" Length: ").append(getLengthAsInt()).append(" bytes").append(ls); sb.append(indent).append(" Information Requested: ").append(informationRequested).append(ls); sb.append(indent).append(" 40 MHz Intolerant: ").append(fortyMhzIntolerant).append(ls); sb.append(indent) .append(" 20 MHz BSS Width Requested: ") .append(twentyMhzBssWidthRequested) .append(ls); sb.append(indent) .append(" OBSS Scanning Exemption Requested: ") .append(obssScanningExemptionRequested) .append(ls); sb.append(indent) .append(" OBSS Scanning Exemption Granted: ") .append(obssScanningExemptionGranted) .append(ls); sb.append(indent).append(" Bit 5: ").append(bit5).append(ls); sb.append(indent).append(" Bit 6: ").append(bit6).append(ls); sb.append(indent).append(" Bit 7: ").append(bit7).append(ls); return sb.toString(); }
/** * @param rawData rawData * @param offset offset * @param length length * @throws IllegalRawDataException if parsing the raw data fails. */ private Dot112040BssCoexistenceElement(byte[] rawData, int offset, int length) throws IllegalRawDataException { super(rawData, offset, length, Dot11InformationElementId.IE_20_40_BSS_COEXISTENCE); if (getLengthAsInt() != 1) { throw new IllegalRawDataException( "The length must be 1 but is actually: " + getLengthAsInt()); } this.informationRequested = (rawData[offset + 2] & 0x01) != 0; this.fortyMhzIntolerant = (rawData[offset + 2] & 0x02) != 0; this.twentyMhzBssWidthRequested = (rawData[offset + 2] & 0x04) != 0; this.obssScanningExemptionRequested = (rawData[offset + 2] & 0x08) != 0; this.obssScanningExemptionGranted = (rawData[offset + 2] & 0x10) != 0; this.bit5 = (rawData[offset + 2] & 0x20) != 0; this.bit6 = (rawData[offset + 2] & 0x40) != 0; this.bit7 = (rawData[offset + 2] & 0x80) != 0; }
/** * @param indent indent * @return the string representation of this object. */ public String toString(String indent) { StringBuilder sb = new StringBuilder(); String ls = System.getProperty("line.separator"); sb.append(indent).append("20/40 BSS Coexistence:").append(ls); sb.append(indent).append(" Element ID: ").append(getElementId()).append(ls); sb.append(indent).append(" Length: ").append(getLengthAsInt()).append(" bytes").append(ls); sb.append(indent).append(" Information Requested: ").append(informationRequested).append(ls); sb.append(indent).append(" 40 MHz Intolerant: ").append(fortyMhzIntolerant).append(ls); sb.append(indent) .append(" 20 MHz BSS Width Requested: ") .append(twentyMhzBssWidthRequested) .append(ls); sb.append(indent) .append(" OBSS Scanning Exemption Requested: ") .append(obssScanningExemptionRequested) .append(ls); sb.append(indent) .append(" OBSS Scanning Exemption Granted: ") .append(obssScanningExemptionGranted) .append(ls); sb.append(indent).append(" Bit 5: ").append(bit5).append(ls); sb.append(indent).append(" Bit 6: ").append(bit6).append(ls); sb.append(indent).append(" Bit 7: ").append(bit7).append(ls); return sb.toString(); }