sensor start/stop
This commit is contained in:
parent
2b3cbecb59
commit
df7e15c292
@ -64,3 +64,21 @@ func (ss *SensorService) Remove(s *Sensor) (string, error) {
|
|||||||
|
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ss *SensorService) Start(s *Sensor) (string, error) {
|
||||||
|
s.MetaSensorStatus = meta.NewMetaSensorStatus(meta.SENSOR_STATUS_RUNNING)
|
||||||
|
res, err := ss.Regist(s)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ss *SensorService) Stop(s *Sensor) (string, error) {
|
||||||
|
s.MetaSensorStatus = meta.NewMetaSensorStatus(meta.SENSOR_STATUS_STOPPED)
|
||||||
|
res, err := ss.Regist(s)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user