src/drivers/irlock/irlock.cpp
/** initialise driver to communicate with sensor **/
initialise driver to communicate with sensor
initialise driver to communicate with sensor
int IRLOCK::init()
{
	int ret = I2C::init();
	if (ret != OK) {
		return ret;
	}
	_reports = new ringbuffer::RingBuffer(IRLOCK_OBJECTS_MAX, sizeof(struct irlock_s));
	if (_reports == nullptr) {
		return ENOTTY;
	} else {
		_sensor_ok = true;
		start();
		return OK;
	}
}
int IRLOCK :: init ( ) { int ret = I2C :: init ( ) ; if ( ret != OK ) { return ret ; } _reports = new ringbuffer :: RingBuffer ( IRLOCK_OBJECTS_MAX , sizeof ( struct irlock_s ) ) ; if ( _reports == nullptr ) { return ENOTTY ; } else { _sensor_ok = true ; start ( ) ; return OK ; } }
initialise driver to communicate with sensor
initialise driver to communicate with sensor
/** initialise I2C bus **/ /** allocate buffer storing values read from sensor **/ /** start work queue **/