Functions in sensor.h