   return NULL;
 }
 
+// {port}?type={type string}なqueryを分解.
+// typeのバッファに16文字コピーを行うので、
+// typeのバッファサイズは16以上にすること。
+// またtypeの文字列は16文字未満の文字列とすること.
+char* checkPortWithType(String portWithType, uint8_t *port, char *type){
+  String typeQuery;
+
+  char* error = checkPortWithQuery(portWithType, port, &typeQuery);
+  if(error){
+    return error;
+  }
+
+  if(typeQuery.startsWith("type=")){
+    typeQuery.replace("type=", "");
+    if(typeQuery.length() > 16){
+      return NgReturnJson(ILLEGAL_QUERY);
+    }
+    typeQuery.toCharArray(type, 16);
+  }else{
+    return NgReturnJson(ILLEGAL_QUERY);
+  }
+  return NULL;
+}
+
 char* checkPortWithValue(String portWithValue, uint8_t *port, int *val){
 
   String valQuery;

     example => d/mode/3?type=INPUT
   */
  {"d/mode/", &switchPinModeTask},

  /*
    DI連続転送ON

  {"EXTERNAL", EXTERNAL}
};

const struct STR_UINT8_PEAR INTERRUPT_MODE_TBL[] = {
  {"LOW", LOW},
  {"CHANGE", CHANGE},
  {"RISING", RISING},
  {"FALLING", FALLING}
};

volatile uint32_t interrupt_counter[2] = {0};
void interrupt0(void){
  ++interrupt_counter[0];
}

void interrupt1(void){
  ++interrupt_counter[1];
}

const VOID_FUNC_PTR INTERRUPT_FUNC_TBL[] = {
  interrupt0,
  interrupt1,
};

#endif

const prog_char ILLEGAL_COMMAND[] PROGMEM       = "Illegal command.";
