Below are a list of steps necessary to create a loadable Radio Model plugin. Order is not important and each step is not as simple as it sounds. This is merely a plugin API checklist.
- Derive your plugin from MACLayerImplementor
- Override all of the Component state transition methods:
- initialize
- Register plugin configuration items and an optional configuration validator
- Register plugin statistics and statistic tables
- Register plugin events of interest
- configure
- Process all loaded configuration
- start
- Emulation starts at the conclusion of this method. Do any startup logic.
- postStart
- All components in the NEM layer stack are now in the start state. Do any cross layer startup handshaking.
- stop
- Opposite of start. Do any tear down logic.
- destroy
- Opposite of initialize. Do any cleanup logic.
- Override all the methods for handling packet and control messages:
- If your plugin will be processing events you will need to override:
- If your plugin will be scheduling timed events you will need to override:
- If your plugin will allow running-state configuration modifications you will need to override:
- Declare your plugin using DECLARE_MAC_LAYER