Skip to content

Conversation

@lukas-mbag
Copy link
Contributor

This Pull Request makes the RateInfo available for the user.

I am looking for feedback (@SuperQ ?)on the API-Design for the User of this Library. If nobody objects, I will add in testcases and cleanup the documentation before un-drafting this Pull Request.

My Usecase
I want to access the MCS-Index and the number of Spacial Stream (NSS) for RX and TX of the current Connection together with a string description similar to the one provided by the iw wlan0 link command (i.e. rx bitrate: 173.3 MBit/s VHT-MCS 8 short GI VHT-NSS 2).

Changes

  • Introduce a new public Interface RateModulationInfo with the following Methodes:
    • GetMCS() int
    • GetNSS() int
    • Description() string
    • WifiGeneration() string
  • Introduce 4 concrete Types that implement the interface: HTModulationInfo, VHTModulationInfo, HEModulationInfo and EHTModulationInfo
  • Move Type rateInfo from client_linux.go to wifi.go and make it public
  • Add the new RateModulationInfo Interface to the RateInfo struct. Also add ChannelWidth and ModulationType
  • extend the parseRateInfo(b []byte) (*RateInfo, error) function to populate the new fields
  • Add RateInfo (for Rx and Tx) to the StationInfo Struct

Caveats

  1. We return an Interface in the RateInfo Struct. If user wants to use parts of the types that are not in the Interface, they have type-cast the concrete struct to the desired type. MCS. NSS, Description and WiFiGeneration are available for all Types
  2. Sorting of the sub-stings in Description() can differ from the iw output (i.e. in my real-world testcase the "shortGI" string is placed at the End of the string not in-between MCS and NSS as in the iw output)
  3. Within Station Info there is now duplicate Information (the bitrate itself) is available directly via StationInfo.ReceiveBitrate and is also Part of the RateInfo Type StationInfo.ReceiveRateInfo.Bitrate. This keeps the API of Station Info backwards-compatible but also groups it with the rest of the rate and modulation info.
  4. No Test-Cases yet (see above, will be added if we go forward with the current design)

The program was tested solely for our own use cases, which might differ from yours.

Lukas Raffelt < [email protected] > on behalf of Mercedes-Benz Tech Innovation GmbH, Provider Information

Licensed under MIT

add basic MCS Decoding
test: add additional station info test case with MCS attributes
feat: add support for VHT MCS indexes in StationInfo and related parsing logic
feat: enhance StationInfo with detailed rate information and VHT support
expose Interface
create subtypes that implement the interface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant