Feat: extended rate parsing #142
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 linkcommand (i.e.rx bitrate: 173.3 MBit/s VHT-MCS 8 short GI VHT-NSS 2).Changes
RateModulationInfowith the following Methodes:GetMCS() intGetNSS() intDescription() stringWifiGeneration() stringHTModulationInfo,VHTModulationInfo,HEModulationInfoandEHTModulationInforateInfofromclient_linux.gotowifi.goand make it publicRateModulationInfoInterface to theRateInfostruct. Also addChannelWidthandModulationTypeparseRateInfo(b []byte) (*RateInfo, error)function to populate the new fieldsRateInfo(for Rx and Tx) to theStationInfoStructCaveats
RateInfoStruct. 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 TypesDescription()can differ from theiwoutput (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 theiwoutput)Station Infothere is now duplicate Information (the bitrate itself) is available directly viaStationInfo.ReceiveBitrateand is also Part of the RateInfo TypeStationInfo.ReceiveRateInfo.Bitrate. This keeps the API of Station Info backwards-compatible but also groups it with the rest of the rate and modulation info.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