1.3.4.1.1 MAC_PLC_Init Function
C
void MAC_PLC_Init
(
MAC_PLC_INIT *init
);Summary
Initializes the MAC PLC module.
Description
This routine initializes the MAC PLC. Callback handlers for event notification are set in this function. A Pointer to MAC PLC Tables is also set here so MAC library can use them.
Precondition
None.
Parameters
| Param | Description |
|---|---|
| init | Pointer to the init data structure containing any data necessary to initialize the module. |
Returns
None.
Example
// The following code snippet shows an example MAC PLC initialization.
MAC_PLC_INIT macPlcInit = {
.macPlcHandlers.macPlcDataConfirm = appDataConfirm,
.macPlcHandlers.macPlcDataIndication = appDataIndication,
.macPlcHandlers.macPlcResetConfirm = appResetConfirm,
.macPlcHandlers.macPlcBeaconNotifyIndication = appBeaconIndication,
.macPlcHandlers.macPlcScanConfirm = appScanConfirm,
.macPlcHandlers.macPlcStartConfirm = NULL, // Start primitive not used
.macPlcHandlers.macPlcCommStatusIndication = appCommStatus,
.macPlcHandlers.macPlcMacSnifferIndication = NULL, // MAC Sniffer not used
.macPlcTables = &tables, // Variable containing the MAC PLC Tables
.plcBand = MAC_PLC_BAND_CENELEC_A,
};
MAC_PLC_Init(&macPlcInit);Remarks
This routine must be called before any other MAC PLC routine is called.
