File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -388,7 +388,18 @@ void UITask::handleButtonTriplePress() {
388388void UITask::handleButtonQuadruplePress () {
389389 MESH_DEBUG_PRINTLN (" UITask: quad press triggered" );
390390 if (_sensors != NULL ) {
391- _sensors->toggleGps ();
391+ // toggle GPS onn/off
392+ int num = _sensors->getNumSettings ();
393+ for (int i = 0 ; i < num; i++) {
394+ if (strcmp (_sensors->getSettingName (i), " gps" ) == 0 ) {
395+ if (strcmp (_sensors->getSettingValue (i), " 1" ) == 0 ) {
396+ _sensors->setSettingValue (" gps" , " 0" );
397+ } else {
398+ _sensors->setSettingValue (" gps" , " 1" );
399+ }
400+ break ;
401+ }
402+ }
392403 }
393404 _need_refresh = true ;
394405}
Original file line number Diff line number Diff line change @@ -21,6 +21,4 @@ class SensorManager {
2121 virtual const char * getSettingName (int i) const { return NULL ; }
2222 virtual const char * getSettingValue (int i) const { return NULL ; }
2323 virtual bool setSettingValue (const char * name, const char * value) { return false ; }
24- virtual bool getGpsStatus () { return false ; }
25- virtual bool toggleGps () { return false ; }
2624};
Original file line number Diff line number Diff line change @@ -28,8 +28,6 @@ class T1000SensorManager: public SensorManager {
2828 const char * getSettingName (int i) const override ;
2929 const char * getSettingValue (int i) const override ;
3030 bool setSettingValue (const char * name, const char * value) override ;
31- bool getGpsStatus () override { return gps_active; }
32- bool toggleGps () override { gps_active ? sleep_gps () : start_gps (); return gps_active; }
3331};
3432
3533#ifdef DISPLAY_CLASS
You can’t perform that action at this time.
0 commit comments