Function omnisensor::sensor::install_or_activate
source · [−]pub async fn install_or_activate<F>(
entry: Entry<'_, String, Arc<Mutex<Sensor>>>,
cr: &SyncMutex<Crossroads>,
io: SensorIOCtx,
sensor_intfs: &SensorIntfData,
ctor: F
)where
F: FnOnce() -> Sensor,
Expand description
Given a SensorMapEntry
from get_nonactive_sensor_entry()
, either activate the
inactive sensor or instantiate a new one.
If needed (there’s no existing inactive sensor), a new sensor is constructed by
calling ctor()
, added to dbus, and inserted into entry
. In either case, the
sensor is activated with io
as its I/O context.