Implemnt a base device logic

A base device logic has been implemented.
Also tests have been written.