@@ -1909,6 +1909,37 @@ bool COMMAND::execute_command (int cmd, String cmd_params, tpipe output, level_a
19091909 case 810 :
19101910 web_interface->blockserial = false ;
19111911 break ;
1912+ case 900 :
1913+ parameter = get_param (cmd_params, " " , true );
1914+ #ifdef AUTHENTICATION_FEATURE
1915+ if (auth_type == LEVEL_GUEST) {
1916+ ESPCOM::println (INCORRECT_CMD_MSG, output, espresponse);
1917+ response = false ;
1918+ }
1919+ #endif
1920+ if (parameter.length () == 0 ) {
1921+ if (CONFIG::is_com_enabled) {
1922+ ESPCOM::print (F (" ENABLED" ), output, espresponse);
1923+ } else {
1924+ ESPCOM::print (F (" DISABLED" ), output, espresponse);
1925+ }
1926+ } else {
1927+ if (parameter == " ENABLE" ) {
1928+ CONFIG::DisableSerial ();
1929+ if (!CONFIG::InitBaudrate ()){
1930+ ESPCOM::print (F (" Cannot enable serial communication" ), output, espresponse);
1931+ } else {
1932+ ESPCOM::print (F (" Enable serial communication" ), output, espresponse);
1933+ }
1934+ } else if (parameter == " DISABLE" ) {
1935+ ESPCOM::print (F (" Disable serial communication" ), output, espresponse);
1936+ CONFIG::DisableSerial ();
1937+ } else {
1938+ ESPCOM::println (INCORRECT_CMD_MSG, output, espresponse);
1939+ response = false ;
1940+ }
1941+ }
1942+ break ;
19121943
19131944 default :
19141945 ESPCOM::println (INCORRECT_CMD_MSG, output, espresponse);
0 commit comments