1.3.2.3.33 MAC_WRP_GetAvailableMacLayers Function
C
MAC_WRP_AVAILABLE_MAC_LAYERS MAC_WRP_GetAvailableMacLayers ( MAC_WRP_HANDLE handle );
Summary
The MAC_WRP_GetAvailableMacLayers primitive gets the available MAC layer(s).
Description
G3 projects may include PLC MAC, RF MAC, or both. This funtion allows upper layers to get which MAC layer(s) is/are available at runtime.
Precondition
A valid handle has to be obtained before calling this function, by means of MAC_WRP_Open function.
Parameters
Param | Description |
---|---|
handle | A valid handle which identifies the Mac Wrapper instance |
Returns
Mac layer availability as a MAC_WRP_AVAILABLE_MAC_LAYERS enumerated value.
Example
// ...
MAC_WRP_HANDLE handle;
handle = MAC_WRP_Open(G3_MAC_WRP_INDEX_0, MAC_WRP_BAND_CENELEC_A);
// ...
MAC_WRP_AVAILABLE_MAC_LAYERS availableLayers;
availableLayers = MAC_WRP_GetAvailableMacLayers(handle);
if (availableLayers == MAC_WRP_AVAILABLE_MAC_PLC) {
// Only PLC MAC available
}
else if (availableLayers == MAC_WRP_AVAILABLE_MAC_RF) {
// Only RF MAC available
}
else {
// Both MAC layers available
}
Remarks
None.