 #include <LTask.h>
 #include <MQTTClient.h>
 
-#define JSON_BUF_SIZE 256
+#define JSON_BUF_SIZE 1024
 
 #define PIN_MOTOR 0
 #define PIN_LOCK_STATUS 5

  *(VMINT *)userData = vm_cell_open();
  return TRUE;
}


/*
  Wrapper to the low-level function vm_cell_get_cur_cell_info()

    root["battery"] = LBattery.level();
    root["charge"] = (LBattery.isCharging() == true);

    VMINT *neighbor_cell_number;
    vm_cell_info_struct *current_cell_ptr;
    vm_cell_info_struct **neighbor_cell_ptr;
    LTask.remoteCall(&get_current_cell_info, (void *)&current_cell_ptr);
    LTask.remoteCall(&get_neighbor_cell_number, (void *)&neighbor_cell_number);
    LTask.remoteCall(&get_neighbor_cell_info, (void *)&neighbor_cell_ptr);

    JsonArray& json_array = root.createNestedArray("cell");
    add_cell_info(json_array, current_cell_ptr);
    if (neighbor_cell_number && *neighbor_cell_number > 0) {
      for (int i = 0; i < *neighbor_cell_number && i < 4; i++) {
        add_cell_info(json_array, neighbor_cell_ptr[i]);
      }
    }

    g_report_other = false;
  }

