     if(ai_stream_info[i].interval_ms){
       if(ai_stream_info[i].counter > ai_stream_info[i].interval_ms){
         ai_stream_info[i].counter = 0;
-        Serial.println(aiRead(i));
+        Serial.println(wrapEventJson("ai", aiRead(i)));
       }
     }
   }

}


String switchTypeReturnJson(String msg, String refType){
  String body = stringJson("msg", msg) + ","
    + stringJson("type", refType);

    if(di_stream_info[i].interval_ms){
      if(di_stream_info[i].counter > di_stream_info[i].interval_ms){
        di_stream_info[i].counter = 0;
        Serial.println(wrapEventJson("di", diRead(i)));
      }
    }
  }

}


String task(String msg){
  // 関数テーブルからタスクを決定する.
