lr-wpan: Add attributes to MLME-SET and MLME-GET
This MR adds a few attributes to the MLME-SET and MLME-GET (newly added, See 802.15.4-2011 6.2.5.2) primitives. This ongoing effort is to add complete support to these MAC primitives to support all the PIB attributes.
Currently, the attributes supported are being added as they are required for my current projects.
In this MR, I included support for macShortAddress and macExtendedAddress. attributes to the primitives.
MLME-GET.confirm should contain 3 parameters: the status, the attribute id, and the struct of all the attributes than can be possibly returned by the GET primitive. In this MR I return the whole struct, but my question is, is there a more effective way to do this? Should LrWpanMacPibAttribute be a pointer instead? is there any real gain in doing this?
A similar primitive is implemented in the PHY: LrWpanPhy::PlmeGetAttributeConfirm for a similar purpose and uses a pointer, but this implementation is just a place holder which does not return any attribute which makes me question its real utility in case it gets used in a real code.
In the end, I went with the pointer approach to keep consistency with the SET GET primitives found in the PHY. This is a list of changes:
- Added
LrwpanMac::MlmeGetRequestandLrwpanMac::MlmeGetConfirmprimitives. - Added
macShortAddressandmacExtendendAddressto the list of attributes to be used with the primitives mentioned above. - Updated
LrWpanPhy::PlmeSetAttributeandLrWpanPhy::PlmeGetAttribute(Request and Confirm) to use smart pointers. - Modified
LrWpanPhy::PlmeGetAttributeRequestto include support for a few attributes (none were supported before the change).
Any opinions are much appreciated.