add sensor API and its unit test
generic sensor API and its unit test