MCPcopy Create free account
hub / github.com/golang/mobile / Enable

Function Enable

exp/sensor/sensor.go:103–111  ·  view source on GitHub ↗

Enable enables the specified sensor type with the given delay rate. Users must set a non-nil Sender via Notify before enabling a sensor, otherwise an error will be returned.

(t Type, delay time.Duration)

Source from the content-addressed store, hash-verified

101// Users must set a non-nil Sender via Notify before enabling a sensor,
102// otherwise an error will be returned.
103func Enable(t Type, delay time.Duration) error {
104 if t < 0 || int(t) >= len(sensorNames) {
105 return errors.New("sensor: unknown sensor type")
106 }
107 if err := validSender(); err != nil {
108 return err
109 }
110 return enable(t, delay)
111}
112
113// Disable disables to feed the manager with the specified sensor.
114// Disable is not safe for concurrent use.

Callers

nothing calls this directly

Calls 3

validSenderFunction · 0.85
NewMethod · 0.80
enableFunction · 0.70

Tested by

no test coverage detected