|
|
|
@ -65,7 +65,11 @@ void Challenge_App_Init(void){ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void Challenge_App_SetMode(bool modeStationary){ |
|
|
|
bool Challenge_App_GetRobotMode(void){ |
|
|
|
|
|
|
|
return robotModeStationary; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void Challenge_App_SetRobotMode(bool modeStationary){ |
|
|
|
robotModeStationary = modeStationary; |
|
|
|
robotModeStationary = modeStationary; |
|
|
|
ESP_LOGI(TAG, "Changed robot mode to %s", robotModeStationary?(unsigned char*)"stationary":(unsigned char*)"mobile"); |
|
|
|
ESP_LOGI(TAG, "Changed robot mode to %s", robotModeStationary?(unsigned char*)"stationary":(unsigned char*)"mobile"); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -97,11 +101,11 @@ uint8_t Challenge_ParseCommand(const unsigned char* cmd, bool *handled, const Mc |
|
|
|
else if (McuUtility_strcmp((char*)cmd, (char*)"challenge setMode stationary")==0 || |
|
|
|
else if (McuUtility_strcmp((char*)cmd, (char*)"challenge setMode stationary")==0 || |
|
|
|
McuUtility_strcmp((char*)cmd, (char*)"challenge setMode s")==0) { |
|
|
|
McuUtility_strcmp((char*)cmd, (char*)"challenge setMode s")==0) { |
|
|
|
*handled = TRUE; |
|
|
|
*handled = TRUE; |
|
|
|
Challenge_App_SetMode(true); // set stationary
|
|
|
|
Challenge_App_SetRobotMode(true); // set stationary
|
|
|
|
} else if (McuUtility_strcmp((char*)cmd, (char*)"challenge setMode mobile")==0 || |
|
|
|
} else if (McuUtility_strcmp((char*)cmd, (char*)"challenge setMode mobile")==0 || |
|
|
|
McuUtility_strcmp((char*)cmd, (char*)"challenge setMode m")==0 ) { |
|
|
|
McuUtility_strcmp((char*)cmd, (char*)"challenge setMode m")==0 ) { |
|
|
|
*handled = TRUE; |
|
|
|
*handled = TRUE; |
|
|
|
Challenge_App_SetMode(false); // set mobile
|
|
|
|
Challenge_App_SetRobotMode(false); // set mobile
|
|
|
|
} |
|
|
|
} |
|
|
|
return ERR_OK; |
|
|
|
return ERR_OK; |
|
|
|
} |
|
|
|
} |
|
|
|
|