 #include <ESP8266WebServer.h>
 #include <ESP8266mDNS.h>
 #include <IRremoteESP8266.h>
+#include <IRsend.h>
+#include <IRrecv.h>
 #include <aJSON.h>
 
 const int send_pin = 12;

      aJsonObject* freq = aJson.getObjectItem(root, "freq");
      aJsonObject* data = aJson.getObjectItem(root, "data");
      if (freq != NULL && data != NULL) {
        const int d_size = aJson.getArraySize(data);
        unsigned int rawData[d_size];
        for (int i = 0; i < d_size; i++) {
          aJsonObject* d_int = aJson.getArrayItem(data, i);
          rawData[i] = d_int->valueint;
        }
        irsend.sendRaw(rawData, d_size, freq->valueint);
        irrecv.enableIRIn();
        req = "";
        aJson.deleteItem(root);

String dumpIRcode (decode_results *results) {
  String s = "";
  for (int i = 1;  i < results->rawlen;  i++) {
    s += results->rawbuf[i] * RAWTICK;
    if ( i < results->rawlen - 1 ) s += ",";
  }
  return s;
