Code that i have written for hardware-software interface class