     }
   }
   // TODO JSONでエスケープするべき文字が入っていると受信した側でヤバイ気がする.
-  return NgReturnJson("Illegal command.", msg);
+  return NgReturnJson(ILLEGAL_COMMAND, msg);
 }
 
 String switchPinModeTask(String portWithQuery){


String checkPortQuery(String portQuery){
  if(!isInt(portQuery)){
    return NgReturnJson("Illegal port number.", portQuery);
  }
  return NULL;
}

#include <avr/pgmspace.h>

#define ARRAYSIZE(array) (sizeof(array) / sizeof(array[0]))

const prog_char ILLEGAL_COMMAND[] PROGMEM       = "Illegal command.";
const prog_char ILLEGAL_TYPE[] PROGMEM          = "Illegal type.";
const prog_char ILLEGAL_QUERY[] PROGMEM         = "Illegal query.";
const prog_char ILLEGAL_VALUE[] PROGMEM         = "Illegal value.";
const prog_char ILLEGAL_PORT_NUMBER[] PROGMEM   = "Illegal port number.";
const prog_char QUERY_NOT_FOUND[] PROGMEM       = "Query not found.";
const prog_char TYPE_IS_NOT_SPECIFIED[] PROGMEM = "type is not specified.";
const prog_char VAL_IS_NOT_SPECIFIED[] PROGMEM  = "val is not specified.";
const prog_char COMMAND_IS_TOO_LONG[] PROGMEM   = "Command is too long.";


char read_buf[128];
int buf_index = 0;
