Building the component
Let's get started on building our battery implementation
A Mock Battery
In our example, we will build the full functionality of our component in a standard local-computer development environment.
This allows us to begin development without worrying about hardware complications while still implementing nearly all of the system’s behavior. In the end, we will have a fully functional—albeit artificial—battery subsystem.
Once complete, our battery implementation is ready to be flashed and tested on the target embedded hardware, where it should behave identically.
If in this step we had actual battery hardware to attach to, we would replace our mock implmentations at the HAL layer with actual hardware bindings.
In our example case, our battery will remain virtual, and can continue to serve its simulated purpose when integrated as part of the 'virtual laptop' project later.