jerry_request_init.h 900 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef JERRY_REQUEST_INIT_H__
  2. #define JERRY_REQUEST_INIT_H__
  3. #include <rtthread.h>
  4. #ifdef PKG_USING_WEBCLIENT
  5. #include <jerry_util.h>
  6. #include <jerry_event.h>
  7. #include <jerry_callbacks.h>
  8. #include <webclient.h>
  9. #include <jerry_buffer.h>
  10. #define READ_MAX_SIZE 50*1024
  11. #define HEADER_BUFSZ 1024
  12. struct request_callback_info
  13. {
  14. jerry_value_t target_value;
  15. jerry_value_t return_value;
  16. jerry_value_t data_value;
  17. char *callback_name;
  18. } typedef request_cbinfo_t;
  19. struct request_config_info
  20. {
  21. char *url;
  22. char *data;
  23. struct webclient_session *session;
  24. int method;
  25. int response;
  26. } typedef request_config_t;
  27. struct request_thread_info
  28. {
  29. jerry_value_t target_value;
  30. request_config_t *config;
  31. struct js_callback *request_callback;
  32. struct js_callback *close_callback;
  33. } typedef request_tdinfo_t;
  34. int jerry_request_init(jerry_value_t obj);
  35. #endif
  36. #endif