 
   Serial.flush();
 }
+

 */
void request(void (*func)()) {
  int code;
  do {
    JsonObject* response;
    do {
      // TODO: Currently we hard-code the argument in the code. Would handle the problem that how to solve
      // multiple arguments.

    //Serial.println(info);
    switch (code){
      case FAIL:
        delaytime = (1 << failcounts) + random(1000);
        if (delaytime > MAX_BACKOFF_TIME){
          delaytime = MAX_BACKOFF_TIME;
          // When there are too many fail attempts, turn on the light to notify
          // Meanwhile stop increasing the fail attempts counter
          digitalWrite(LED_BUILTIN, HIGH);
        }
        Serial.println(delaytime);
        delay(delaytime);
        // In case of the overflow
        if (failcounts < 15)
          failcounts = failcounts + 1;
        break;
      case MEASUREUNREG:
        exit(-1);
        break;
      case OK:
        failcounts = 0;
        digitalWrite(LED_BUILTIN, LOW);
        break;
      case TAGUNREG:
        failcounts = 0;
        digitalWrite(LED_BUILTIN, LOW);
        break;
      default:
        exit(-1);
