1.3.2.3.2 MAC_WRP_Open Function

C

MAC_WRP_HANDLE MAC_WRP_Open (
    const SYS_MODULE_INDEX index,
    MAC_WRP_BAND band
);

Summary

Opens the specified MAC Wrapper instance and returns a handle to it.

Description

This routine opens the specified MAC Wrapper instance and provides a handle that must be provided to all other client-level operations to identify the caller and the instance of the module.

Precondition

Function MAC_WRP_Initialize must have been called before calling this function.

Parameters

ParamDescription
indexIndex for the instance to be opened
bandWorking band for PLC (should be inline with the hardware)

Returns

If successful, the routine returns a valid open-instance handle (a number identifying both the caller and the module instance). If an error occurs, the return value is MAC_WRP_HANDLE_INVALID.

Example

MAC_WRP_HANDLE handle;
SYS_MODULE_OBJ sysObjMacWrp;

// Populate initData if needed

sysObjMacWrp = MAC_WRP_Initialize(G3_MAC_WRP_INDEX_0);

handle = MAC_WRP_Open(G3_MAC_WRP_INDEX_0, MAC_WRP_BAND_CENELEC_A);
if (handle == MAC_WRP_HANDLE_INVALID)
{
    // Handle error
}

Remarks

This routine must be called before any other MAC Wrapper API function, except MAC_WRP_Initialize.